google-cloud-gke_multi_cloud-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +144 -0
  6. data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/client.rb +1729 -0
  7. data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/credentials.rb +47 -0
  8. data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/operations.rb +767 -0
  9. data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/paths.rb +107 -0
  10. data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters.rb +51 -0
  11. data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/client.rb +2184 -0
  12. data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/credentials.rb +47 -0
  13. data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/operations.rb +767 -0
  14. data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/paths.rb +126 -0
  15. data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters.rb +51 -0
  16. data/lib/google/cloud/gke_multi_cloud/v1/version.rb +28 -0
  17. data/lib/google/cloud/gke_multi_cloud/v1.rb +41 -0
  18. data/lib/google/cloud/gkemulticloud/v1/aws_resources_pb.rb +187 -0
  19. data/lib/google/cloud/gkemulticloud/v1/aws_service_pb.rb +110 -0
  20. data/lib/google/cloud/gkemulticloud/v1/aws_service_services_pb.rb +90 -0
  21. data/lib/google/cloud/gkemulticloud/v1/azure_resources_pb.rb +183 -0
  22. data/lib/google/cloud/gkemulticloud/v1/azure_service_pb.rb +138 -0
  23. data/lib/google/cloud/gkemulticloud/v1/azure_service_services_pb.rb +115 -0
  24. data/lib/google/cloud/gkemulticloud/v1/common_resources_pb.rb +71 -0
  25. data/lib/google-cloud-gke_multi_cloud-v1.rb +21 -0
  26. data/proto_docs/README.md +4 -0
  27. data/proto_docs/google/api/field_behavior.rb +71 -0
  28. data/proto_docs/google/api/resource.rb +222 -0
  29. data/proto_docs/google/cloud/gkemulticloud/v1/aws_resources.rb +633 -0
  30. data/proto_docs/google/cloud/gkemulticloud/v1/aws_service.rb +383 -0
  31. data/proto_docs/google/cloud/gkemulticloud/v1/azure_resources.rb +716 -0
  32. data/proto_docs/google/cloud/gkemulticloud/v1/azure_service.rb +473 -0
  33. data/proto_docs/google/cloud/gkemulticloud/v1/common_resources.rb +164 -0
  34. data/proto_docs/google/longrunning/operations.rb +164 -0
  35. data/proto_docs/google/protobuf/any.rb +141 -0
  36. data/proto_docs/google/protobuf/duration.rb +98 -0
  37. data/proto_docs/google/protobuf/empty.rb +36 -0
  38. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  39. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  40. data/proto_docs/google/rpc/status.rb +46 -0
  41. metadata +232 -0
@@ -0,0 +1,1729 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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/cloud/gkemulticloud/v1/aws_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module GkeMultiCloud
25
+ module V1
26
+ module AwsClusters
27
+ ##
28
+ # Client for the AwsClusters service.
29
+ #
30
+ # The AwsClusters API provides a single centrally managed service
31
+ # to create and manage Anthos clusters that run on AWS infrastructure.
32
+ #
33
+ class Client
34
+ include Paths
35
+
36
+ # @private
37
+ attr_reader :aws_clusters_stub
38
+
39
+ ##
40
+ # Configure the AwsClusters Client class.
41
+ #
42
+ # See {::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # @example
46
+ #
47
+ # # Modify the configuration for all AwsClusters clients
48
+ # ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
51
+ #
52
+ # @yield [config] Configure the Client client.
53
+ # @yieldparam config [Client::Configuration]
54
+ #
55
+ # @return [Client::Configuration]
56
+ #
57
+ def self.configure
58
+ @configure ||= begin
59
+ namespace = ["Google", "Cloud", "GkeMultiCloud", "V1"]
60
+ parent_config = while namespace.any?
61
+ parent_name = namespace.join "::"
62
+ parent_const = const_get parent_name
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
+ namespace.pop
65
+ end
66
+ default_config = Client::Configuration.new parent_config
67
+
68
+ default_config.rpcs.create_aws_cluster.timeout = 60.0
69
+
70
+ default_config.rpcs.update_aws_cluster.timeout = 60.0
71
+
72
+ default_config.rpcs.get_aws_cluster.timeout = 60.0
73
+ default_config.rpcs.get_aws_cluster.retry_policy = {
74
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
75
+ }
76
+
77
+ default_config.rpcs.list_aws_clusters.timeout = 60.0
78
+ default_config.rpcs.list_aws_clusters.retry_policy = {
79
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
80
+ }
81
+
82
+ default_config.rpcs.delete_aws_cluster.timeout = 60.0
83
+
84
+ default_config.rpcs.generate_aws_access_token.timeout = 60.0
85
+ default_config.rpcs.generate_aws_access_token.retry_policy = {
86
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
87
+ }
88
+
89
+ default_config.rpcs.create_aws_node_pool.timeout = 60.0
90
+
91
+ default_config.rpcs.update_aws_node_pool.timeout = 60.0
92
+
93
+ default_config.rpcs.get_aws_node_pool.timeout = 60.0
94
+ default_config.rpcs.get_aws_node_pool.retry_policy = {
95
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
96
+ }
97
+
98
+ default_config.rpcs.list_aws_node_pools.timeout = 60.0
99
+ default_config.rpcs.list_aws_node_pools.retry_policy = {
100
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
101
+ }
102
+
103
+ default_config.rpcs.delete_aws_node_pool.timeout = 60.0
104
+
105
+ default_config.rpcs.get_aws_server_config.timeout = 60.0
106
+ default_config.rpcs.get_aws_server_config.retry_policy = {
107
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
108
+ }
109
+
110
+ default_config
111
+ end
112
+ yield @configure if block_given?
113
+ @configure
114
+ end
115
+
116
+ ##
117
+ # Configure the AwsClusters Client instance.
118
+ #
119
+ # The configuration is set to the derived mode, meaning that values can be changed,
120
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
121
+ # should be made on {Client.configure}.
122
+ #
123
+ # See {::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client::Configuration}
124
+ # for a description of the configuration fields.
125
+ #
126
+ # @yield [config] Configure the Client client.
127
+ # @yieldparam config [Client::Configuration]
128
+ #
129
+ # @return [Client::Configuration]
130
+ #
131
+ def configure
132
+ yield @config if block_given?
133
+ @config
134
+ end
135
+
136
+ ##
137
+ # Create a new AwsClusters client object.
138
+ #
139
+ # @example
140
+ #
141
+ # # Create a client using the default configuration
142
+ # client = ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new
143
+ #
144
+ # # Create a client using a custom configuration
145
+ # client = ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new do |config|
146
+ # config.timeout = 10.0
147
+ # end
148
+ #
149
+ # @yield [config] Configure the AwsClusters client.
150
+ # @yieldparam config [Client::Configuration]
151
+ #
152
+ def initialize
153
+ # These require statements are intentionally placed here to initialize
154
+ # the gRPC module only when it's required.
155
+ # See https://github.com/googleapis/toolkit/issues/446
156
+ require "gapic/grpc"
157
+ require "google/cloud/gkemulticloud/v1/aws_service_services_pb"
158
+
159
+ # Create the configuration object
160
+ @config = Configuration.new Client.configure
161
+
162
+ # Yield the configuration if needed
163
+ yield @config if block_given?
164
+
165
+ # Create credentials
166
+ credentials = @config.credentials
167
+ # Use self-signed JWT if the endpoint is unchanged from default,
168
+ # but only if the default endpoint does not have a region prefix.
169
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
170
+ !@config.endpoint.split(".").first.include?("-")
171
+ credentials ||= Credentials.default scope: @config.scope,
172
+ enable_self_signed_jwt: enable_self_signed_jwt
173
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
174
+ credentials = Credentials.new credentials, scope: @config.scope
175
+ end
176
+ @quota_project_id = @config.quota_project
177
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
178
+
179
+ @operations_client = Operations.new do |config|
180
+ config.credentials = credentials
181
+ config.quota_project = @quota_project_id
182
+ config.endpoint = @config.endpoint
183
+ end
184
+
185
+ @aws_clusters_stub = ::Gapic::ServiceStub.new(
186
+ ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Stub,
187
+ credentials: credentials,
188
+ endpoint: @config.endpoint,
189
+ channel_args: @config.channel_args,
190
+ interceptors: @config.interceptors
191
+ )
192
+ end
193
+
194
+ ##
195
+ # Get the associated client for long-running operations.
196
+ #
197
+ # @return [::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Operations]
198
+ #
199
+ attr_reader :operations_client
200
+
201
+ # Service calls
202
+
203
+ ##
204
+ # Creates a new {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster} resource on a given GCP project and region.
205
+ #
206
+ # If successful, the response contains a newly created
207
+ # {::Google::Longrunning::Operation Operation} resource that can be
208
+ # described to track the status of the operation.
209
+ #
210
+ # @overload create_aws_cluster(request, options = nil)
211
+ # Pass arguments to `create_aws_cluster` via a request object, either of type
212
+ # {::Google::Cloud::GkeMultiCloud::V1::CreateAwsClusterRequest} or an equivalent Hash.
213
+ #
214
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::CreateAwsClusterRequest, ::Hash]
215
+ # A request object representing the call parameters. Required. To specify no
216
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
217
+ # @param options [::Gapic::CallOptions, ::Hash]
218
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
219
+ #
220
+ # @overload create_aws_cluster(parent: nil, aws_cluster: nil, aws_cluster_id: nil, validate_only: nil)
221
+ # Pass arguments to `create_aws_cluster` via keyword arguments. Note that at
222
+ # least one keyword argument is required. To specify no parameters, or to keep all
223
+ # the default parameter values, pass an empty Hash as a request object (see above).
224
+ #
225
+ # @param parent [::String]
226
+ # Required. The parent location where this {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster} resource
227
+ # will be created.
228
+ #
229
+ # Location names are formatted as `projects/<project-id>/locations/<region>`.
230
+ #
231
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
232
+ # for more details on Google Cloud resource names.
233
+ # @param aws_cluster [::Google::Cloud::GkeMultiCloud::V1::AwsCluster, ::Hash]
234
+ # Required. The specification of the {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster} to create.
235
+ # @param aws_cluster_id [::String]
236
+ # Required. A client provided ID the resource. Must be unique within the parent
237
+ # resource.
238
+ #
239
+ # The provided ID will be part of the {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster}
240
+ # resource name formatted as
241
+ # `projects/<project-id>/locations/<region>/awsClusters/<cluster-id>`.
242
+ #
243
+ # Valid characters are `/[a-z][0-9]-/`. Cannot be longer than 40 characters.
244
+ # @param validate_only [::Boolean]
245
+ # If set, only validate the request, but do not actually create the cluster.
246
+ #
247
+ # @yield [response, operation] Access the result along with the RPC operation
248
+ # @yieldparam response [::Gapic::Operation]
249
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
250
+ #
251
+ # @return [::Gapic::Operation]
252
+ #
253
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
254
+ #
255
+ # @example Basic example
256
+ # require "google/cloud/gke_multi_cloud/v1"
257
+ #
258
+ # # Create a client object. The client can be reused for multiple calls.
259
+ # client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new
260
+ #
261
+ # # Create a request. To set request fields, pass in keyword arguments.
262
+ # request = Google::Cloud::GkeMultiCloud::V1::CreateAwsClusterRequest.new
263
+ #
264
+ # # Call the create_aws_cluster method.
265
+ # result = client.create_aws_cluster request
266
+ #
267
+ # # The returned object is of type Gapic::Operation. You can use this
268
+ # # object to check the status of an operation, cancel it, or wait
269
+ # # for results. Here is how to block until completion:
270
+ # result.wait_until_done! timeout: 60
271
+ # if result.response?
272
+ # p result.response
273
+ # else
274
+ # puts "Error!"
275
+ # end
276
+ #
277
+ def create_aws_cluster request, options = nil
278
+ raise ::ArgumentError, "request must be provided" if request.nil?
279
+
280
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::CreateAwsClusterRequest
281
+
282
+ # Converts hash and nil to an options object
283
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
284
+
285
+ # Customize the options with defaults
286
+ metadata = @config.rpcs.create_aws_cluster.metadata.to_h
287
+
288
+ # Set x-goog-api-client and x-goog-user-project headers
289
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
290
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
291
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
292
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
293
+
294
+ header_params = {}
295
+ if request.parent
296
+ header_params["parent"] = request.parent
297
+ end
298
+
299
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
300
+ metadata[:"x-goog-request-params"] ||= request_params_header
301
+
302
+ options.apply_defaults timeout: @config.rpcs.create_aws_cluster.timeout,
303
+ metadata: metadata,
304
+ retry_policy: @config.rpcs.create_aws_cluster.retry_policy
305
+
306
+ options.apply_defaults timeout: @config.timeout,
307
+ metadata: @config.metadata,
308
+ retry_policy: @config.retry_policy
309
+
310
+ @aws_clusters_stub.call_rpc :create_aws_cluster, request, options: options do |response, operation|
311
+ response = ::Gapic::Operation.new response, @operations_client, options: options
312
+ yield response, operation if block_given?
313
+ return response
314
+ end
315
+ rescue ::GRPC::BadStatus => e
316
+ raise ::Google::Cloud::Error.from_error(e)
317
+ end
318
+
319
+ ##
320
+ # Updates an {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster}.
321
+ #
322
+ # @overload update_aws_cluster(request, options = nil)
323
+ # Pass arguments to `update_aws_cluster` via a request object, either of type
324
+ # {::Google::Cloud::GkeMultiCloud::V1::UpdateAwsClusterRequest} or an equivalent Hash.
325
+ #
326
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::UpdateAwsClusterRequest, ::Hash]
327
+ # A request object representing the call parameters. Required. To specify no
328
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
329
+ # @param options [::Gapic::CallOptions, ::Hash]
330
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
331
+ #
332
+ # @overload update_aws_cluster(aws_cluster: nil, validate_only: nil, update_mask: nil)
333
+ # Pass arguments to `update_aws_cluster` via keyword arguments. Note that at
334
+ # least one keyword argument is required. To specify no parameters, or to keep all
335
+ # the default parameter values, pass an empty Hash as a request object (see above).
336
+ #
337
+ # @param aws_cluster [::Google::Cloud::GkeMultiCloud::V1::AwsCluster, ::Hash]
338
+ # Required. The {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster} resource to update.
339
+ # @param validate_only [::Boolean]
340
+ # If set, only validate the request, but do not actually update the cluster.
341
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
342
+ # Required. Mask of fields to update. At least one path must be supplied in
343
+ # this field. The elements of the repeated paths field can only include these
344
+ # fields from {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster}:
345
+ #
346
+ # * `description`.
347
+ # * `annotations`.
348
+ # * `control_plane.version`.
349
+ # * `authorization.admin_users`.
350
+ # * `control_plane.aws_services_authentication.role_arn`.
351
+ # * `control_plane.aws_services_authentication.role_session_name`.
352
+ # * `control_plane.config_encryption.kms_key_arn`.
353
+ # * `control_plane.instance_type`.
354
+ # * `control_plane.security_group_ids`.
355
+ # * `control_plane.proxy_config`.
356
+ # * `control_plane.proxy_config.secret_arn`.
357
+ # * `control_plane.proxy_config.secret_version`.
358
+ # * `control_plane.root_volume.iops`.
359
+ # * `control_plane.root_volume.kms_key_arn`.
360
+ # * `control_plane.root_volume.volume_type`.
361
+ # * `control_plane.root_volume.size_gib`.
362
+ # * `control_plane.ssh_config`.
363
+ # * `control_plane.ssh_config.ec2_key_pair`.
364
+ # * `control_plane.instance_placement.tenancy`.
365
+ # * `logging_config`.
366
+ #
367
+ # @yield [response, operation] Access the result along with the RPC operation
368
+ # @yieldparam response [::Gapic::Operation]
369
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
370
+ #
371
+ # @return [::Gapic::Operation]
372
+ #
373
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
374
+ #
375
+ # @example Basic example
376
+ # require "google/cloud/gke_multi_cloud/v1"
377
+ #
378
+ # # Create a client object. The client can be reused for multiple calls.
379
+ # client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new
380
+ #
381
+ # # Create a request. To set request fields, pass in keyword arguments.
382
+ # request = Google::Cloud::GkeMultiCloud::V1::UpdateAwsClusterRequest.new
383
+ #
384
+ # # Call the update_aws_cluster method.
385
+ # result = client.update_aws_cluster request
386
+ #
387
+ # # The returned object is of type Gapic::Operation. You can use this
388
+ # # object to check the status of an operation, cancel it, or wait
389
+ # # for results. Here is how to block until completion:
390
+ # result.wait_until_done! timeout: 60
391
+ # if result.response?
392
+ # p result.response
393
+ # else
394
+ # puts "Error!"
395
+ # end
396
+ #
397
+ def update_aws_cluster request, options = nil
398
+ raise ::ArgumentError, "request must be provided" if request.nil?
399
+
400
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::UpdateAwsClusterRequest
401
+
402
+ # Converts hash and nil to an options object
403
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
404
+
405
+ # Customize the options with defaults
406
+ metadata = @config.rpcs.update_aws_cluster.metadata.to_h
407
+
408
+ # Set x-goog-api-client and x-goog-user-project headers
409
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
410
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
411
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
412
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
413
+
414
+ header_params = {}
415
+ if request.aws_cluster&.name
416
+ header_params["aws_cluster.name"] = request.aws_cluster.name
417
+ end
418
+
419
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
420
+ metadata[:"x-goog-request-params"] ||= request_params_header
421
+
422
+ options.apply_defaults timeout: @config.rpcs.update_aws_cluster.timeout,
423
+ metadata: metadata,
424
+ retry_policy: @config.rpcs.update_aws_cluster.retry_policy
425
+
426
+ options.apply_defaults timeout: @config.timeout,
427
+ metadata: @config.metadata,
428
+ retry_policy: @config.retry_policy
429
+
430
+ @aws_clusters_stub.call_rpc :update_aws_cluster, request, options: options do |response, operation|
431
+ response = ::Gapic::Operation.new response, @operations_client, options: options
432
+ yield response, operation if block_given?
433
+ return response
434
+ end
435
+ rescue ::GRPC::BadStatus => e
436
+ raise ::Google::Cloud::Error.from_error(e)
437
+ end
438
+
439
+ ##
440
+ # Describes a specific {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster} resource.
441
+ #
442
+ # @overload get_aws_cluster(request, options = nil)
443
+ # Pass arguments to `get_aws_cluster` via a request object, either of type
444
+ # {::Google::Cloud::GkeMultiCloud::V1::GetAwsClusterRequest} or an equivalent Hash.
445
+ #
446
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::GetAwsClusterRequest, ::Hash]
447
+ # A request object representing the call parameters. Required. To specify no
448
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
449
+ # @param options [::Gapic::CallOptions, ::Hash]
450
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
451
+ #
452
+ # @overload get_aws_cluster(name: nil)
453
+ # Pass arguments to `get_aws_cluster` via keyword arguments. Note that at
454
+ # least one keyword argument is required. To specify no parameters, or to keep all
455
+ # the default parameter values, pass an empty Hash as a request object (see above).
456
+ #
457
+ # @param name [::String]
458
+ # Required. The name of the {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster} resource to describe.
459
+ #
460
+ # `AwsCluster` names are formatted as
461
+ # `projects/<project-id>/locations/<region>/awsClusters/<cluster-id>`.
462
+ #
463
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
464
+ # for more details on GCP resource names.
465
+ #
466
+ # @yield [response, operation] Access the result along with the RPC operation
467
+ # @yieldparam response [::Google::Cloud::GkeMultiCloud::V1::AwsCluster]
468
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
469
+ #
470
+ # @return [::Google::Cloud::GkeMultiCloud::V1::AwsCluster]
471
+ #
472
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
473
+ #
474
+ # @example Basic example
475
+ # require "google/cloud/gke_multi_cloud/v1"
476
+ #
477
+ # # Create a client object. The client can be reused for multiple calls.
478
+ # client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new
479
+ #
480
+ # # Create a request. To set request fields, pass in keyword arguments.
481
+ # request = Google::Cloud::GkeMultiCloud::V1::GetAwsClusterRequest.new
482
+ #
483
+ # # Call the get_aws_cluster method.
484
+ # result = client.get_aws_cluster request
485
+ #
486
+ # # The returned object is of type Google::Cloud::GkeMultiCloud::V1::AwsCluster.
487
+ # p result
488
+ #
489
+ def get_aws_cluster request, options = nil
490
+ raise ::ArgumentError, "request must be provided" if request.nil?
491
+
492
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::GetAwsClusterRequest
493
+
494
+ # Converts hash and nil to an options object
495
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
496
+
497
+ # Customize the options with defaults
498
+ metadata = @config.rpcs.get_aws_cluster.metadata.to_h
499
+
500
+ # Set x-goog-api-client and x-goog-user-project headers
501
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
502
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
503
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
504
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
505
+
506
+ header_params = {}
507
+ if request.name
508
+ header_params["name"] = request.name
509
+ end
510
+
511
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
512
+ metadata[:"x-goog-request-params"] ||= request_params_header
513
+
514
+ options.apply_defaults timeout: @config.rpcs.get_aws_cluster.timeout,
515
+ metadata: metadata,
516
+ retry_policy: @config.rpcs.get_aws_cluster.retry_policy
517
+
518
+ options.apply_defaults timeout: @config.timeout,
519
+ metadata: @config.metadata,
520
+ retry_policy: @config.retry_policy
521
+
522
+ @aws_clusters_stub.call_rpc :get_aws_cluster, request, options: options do |response, operation|
523
+ yield response, operation if block_given?
524
+ return response
525
+ end
526
+ rescue ::GRPC::BadStatus => e
527
+ raise ::Google::Cloud::Error.from_error(e)
528
+ end
529
+
530
+ ##
531
+ # Lists all {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster} resources on a given Google Cloud project and
532
+ # region.
533
+ #
534
+ # @overload list_aws_clusters(request, options = nil)
535
+ # Pass arguments to `list_aws_clusters` via a request object, either of type
536
+ # {::Google::Cloud::GkeMultiCloud::V1::ListAwsClustersRequest} or an equivalent Hash.
537
+ #
538
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::ListAwsClustersRequest, ::Hash]
539
+ # A request object representing the call parameters. Required. To specify no
540
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
541
+ # @param options [::Gapic::CallOptions, ::Hash]
542
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
543
+ #
544
+ # @overload list_aws_clusters(parent: nil, page_size: nil, page_token: nil)
545
+ # Pass arguments to `list_aws_clusters` via keyword arguments. Note that at
546
+ # least one keyword argument is required. To specify no parameters, or to keep all
547
+ # the default parameter values, pass an empty Hash as a request object (see above).
548
+ #
549
+ # @param parent [::String]
550
+ # Required. The parent location which owns this collection of
551
+ # {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster} resources.
552
+ #
553
+ # Location names are formatted as `projects/<project-id>/locations/<region>`.
554
+ #
555
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
556
+ # for more details on GCP resource names.
557
+ # @param page_size [::Integer]
558
+ # The maximum number of items to return.
559
+ #
560
+ # If not specified, a default value of 50 will be used by the service.
561
+ # Regardless of the pageSize value, the response can include a partial list
562
+ # and a caller should only rely on response's
563
+ # {::Google::Cloud::GkeMultiCloud::V1::ListAwsClustersResponse#next_page_token nextPageToken} to determine if
564
+ # there are more instances left to be queried.
565
+ # @param page_token [::String]
566
+ # The `nextPageToken` value returned from a previous
567
+ # {::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client#list_aws_clusters awsClusters.list} request, if any.
568
+ #
569
+ # @yield [response, operation] Access the result along with the RPC operation
570
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AwsCluster>]
571
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
572
+ #
573
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AwsCluster>]
574
+ #
575
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
576
+ #
577
+ # @example Basic example
578
+ # require "google/cloud/gke_multi_cloud/v1"
579
+ #
580
+ # # Create a client object. The client can be reused for multiple calls.
581
+ # client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new
582
+ #
583
+ # # Create a request. To set request fields, pass in keyword arguments.
584
+ # request = Google::Cloud::GkeMultiCloud::V1::ListAwsClustersRequest.new
585
+ #
586
+ # # Call the list_aws_clusters method.
587
+ # result = client.list_aws_clusters request
588
+ #
589
+ # # The returned object is of type Gapic::PagedEnumerable. You can
590
+ # # iterate over all elements by calling #each, and the enumerable
591
+ # # will lazily make API calls to fetch subsequent pages. Other
592
+ # # methods are also available for managing paging directly.
593
+ # result.each do |response|
594
+ # # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AwsCluster.
595
+ # p response
596
+ # end
597
+ #
598
+ def list_aws_clusters request, options = nil
599
+ raise ::ArgumentError, "request must be provided" if request.nil?
600
+
601
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::ListAwsClustersRequest
602
+
603
+ # Converts hash and nil to an options object
604
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
605
+
606
+ # Customize the options with defaults
607
+ metadata = @config.rpcs.list_aws_clusters.metadata.to_h
608
+
609
+ # Set x-goog-api-client and x-goog-user-project headers
610
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
611
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
612
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
613
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
614
+
615
+ header_params = {}
616
+ if request.parent
617
+ header_params["parent"] = request.parent
618
+ end
619
+
620
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
621
+ metadata[:"x-goog-request-params"] ||= request_params_header
622
+
623
+ options.apply_defaults timeout: @config.rpcs.list_aws_clusters.timeout,
624
+ metadata: metadata,
625
+ retry_policy: @config.rpcs.list_aws_clusters.retry_policy
626
+
627
+ options.apply_defaults timeout: @config.timeout,
628
+ metadata: @config.metadata,
629
+ retry_policy: @config.retry_policy
630
+
631
+ @aws_clusters_stub.call_rpc :list_aws_clusters, request, options: options do |response, operation|
632
+ response = ::Gapic::PagedEnumerable.new @aws_clusters_stub, :list_aws_clusters, request, response, operation, options
633
+ yield response, operation if block_given?
634
+ return response
635
+ end
636
+ rescue ::GRPC::BadStatus => e
637
+ raise ::Google::Cloud::Error.from_error(e)
638
+ end
639
+
640
+ ##
641
+ # Deletes a specific {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster} resource.
642
+ #
643
+ # Fails if the cluster has one or more associated {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool}
644
+ # resources.
645
+ #
646
+ # If successful, the response contains a newly created
647
+ # {::Google::Longrunning::Operation Operation} resource that can be
648
+ # described to track the status of the operation.
649
+ #
650
+ # @overload delete_aws_cluster(request, options = nil)
651
+ # Pass arguments to `delete_aws_cluster` via a request object, either of type
652
+ # {::Google::Cloud::GkeMultiCloud::V1::DeleteAwsClusterRequest} or an equivalent Hash.
653
+ #
654
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::DeleteAwsClusterRequest, ::Hash]
655
+ # A request object representing the call parameters. Required. To specify no
656
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
657
+ # @param options [::Gapic::CallOptions, ::Hash]
658
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
659
+ #
660
+ # @overload delete_aws_cluster(name: nil, validate_only: nil, allow_missing: nil, etag: nil)
661
+ # Pass arguments to `delete_aws_cluster` via keyword arguments. Note that at
662
+ # least one keyword argument is required. To specify no parameters, or to keep all
663
+ # the default parameter values, pass an empty Hash as a request object (see above).
664
+ #
665
+ # @param name [::String]
666
+ # Required. The resource name the {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster} to delete.
667
+ #
668
+ # `AwsCluster` names are formatted as
669
+ # `projects/<project-id>/locations/<region>/awsClusters/<cluster-id>`.
670
+ #
671
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
672
+ # for more details on GCP resource names.
673
+ # @param validate_only [::Boolean]
674
+ # If set, only validate the request, but do not actually delete the resource.
675
+ # @param allow_missing [::Boolean]
676
+ # If set to true, and the {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster} resource is not found,
677
+ # the request will succeed but no action will be taken on the server and a
678
+ # completed {::Google::Longrunning::Operation Operation} will be returned.
679
+ #
680
+ # Useful for idempotent deletion.
681
+ # @param etag [::String]
682
+ # The current etag of the {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster}.
683
+ #
684
+ # Allows clients to perform deletions through optimistic concurrency control.
685
+ #
686
+ # If the provided etag does not match the current etag of the cluster,
687
+ # the request will fail and an ABORTED error will be returned.
688
+ #
689
+ # @yield [response, operation] Access the result along with the RPC operation
690
+ # @yieldparam response [::Gapic::Operation]
691
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
692
+ #
693
+ # @return [::Gapic::Operation]
694
+ #
695
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
696
+ #
697
+ # @example Basic example
698
+ # require "google/cloud/gke_multi_cloud/v1"
699
+ #
700
+ # # Create a client object. The client can be reused for multiple calls.
701
+ # client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new
702
+ #
703
+ # # Create a request. To set request fields, pass in keyword arguments.
704
+ # request = Google::Cloud::GkeMultiCloud::V1::DeleteAwsClusterRequest.new
705
+ #
706
+ # # Call the delete_aws_cluster method.
707
+ # result = client.delete_aws_cluster request
708
+ #
709
+ # # The returned object is of type Gapic::Operation. You can use this
710
+ # # object to check the status of an operation, cancel it, or wait
711
+ # # for results. Here is how to block until completion:
712
+ # result.wait_until_done! timeout: 60
713
+ # if result.response?
714
+ # p result.response
715
+ # else
716
+ # puts "Error!"
717
+ # end
718
+ #
719
+ def delete_aws_cluster request, options = nil
720
+ raise ::ArgumentError, "request must be provided" if request.nil?
721
+
722
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::DeleteAwsClusterRequest
723
+
724
+ # Converts hash and nil to an options object
725
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
726
+
727
+ # Customize the options with defaults
728
+ metadata = @config.rpcs.delete_aws_cluster.metadata.to_h
729
+
730
+ # Set x-goog-api-client and x-goog-user-project headers
731
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
732
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
733
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
734
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
735
+
736
+ header_params = {}
737
+ if request.name
738
+ header_params["name"] = request.name
739
+ end
740
+
741
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
742
+ metadata[:"x-goog-request-params"] ||= request_params_header
743
+
744
+ options.apply_defaults timeout: @config.rpcs.delete_aws_cluster.timeout,
745
+ metadata: metadata,
746
+ retry_policy: @config.rpcs.delete_aws_cluster.retry_policy
747
+
748
+ options.apply_defaults timeout: @config.timeout,
749
+ metadata: @config.metadata,
750
+ retry_policy: @config.retry_policy
751
+
752
+ @aws_clusters_stub.call_rpc :delete_aws_cluster, request, options: options do |response, operation|
753
+ response = ::Gapic::Operation.new response, @operations_client, options: options
754
+ yield response, operation if block_given?
755
+ return response
756
+ end
757
+ rescue ::GRPC::BadStatus => e
758
+ raise ::Google::Cloud::Error.from_error(e)
759
+ end
760
+
761
+ ##
762
+ # Generates a short-lived access token to authenticate to a given
763
+ # {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster} resource.
764
+ #
765
+ # @overload generate_aws_access_token(request, options = nil)
766
+ # Pass arguments to `generate_aws_access_token` via a request object, either of type
767
+ # {::Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenRequest} or an equivalent Hash.
768
+ #
769
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenRequest, ::Hash]
770
+ # A request object representing the call parameters. Required. To specify no
771
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
772
+ # @param options [::Gapic::CallOptions, ::Hash]
773
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
774
+ #
775
+ # @overload generate_aws_access_token(aws_cluster: nil)
776
+ # Pass arguments to `generate_aws_access_token` via keyword arguments. Note that at
777
+ # least one keyword argument is required. To specify no parameters, or to keep all
778
+ # the default parameter values, pass an empty Hash as a request object (see above).
779
+ #
780
+ # @param aws_cluster [::String]
781
+ # Required. The name of the {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster} resource to authenticate to.
782
+ #
783
+ # `AwsCluster` names are formatted as
784
+ # `projects/<project-id>/locations/<region>/awsClusters/<cluster-id>`.
785
+ #
786
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
787
+ # for more details on Google Cloud resource names.
788
+ #
789
+ # @yield [response, operation] Access the result along with the RPC operation
790
+ # @yieldparam response [::Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenResponse]
791
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
792
+ #
793
+ # @return [::Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenResponse]
794
+ #
795
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
796
+ #
797
+ # @example Basic example
798
+ # require "google/cloud/gke_multi_cloud/v1"
799
+ #
800
+ # # Create a client object. The client can be reused for multiple calls.
801
+ # client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new
802
+ #
803
+ # # Create a request. To set request fields, pass in keyword arguments.
804
+ # request = Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenRequest.new
805
+ #
806
+ # # Call the generate_aws_access_token method.
807
+ # result = client.generate_aws_access_token request
808
+ #
809
+ # # The returned object is of type Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenResponse.
810
+ # p result
811
+ #
812
+ def generate_aws_access_token request, options = nil
813
+ raise ::ArgumentError, "request must be provided" if request.nil?
814
+
815
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenRequest
816
+
817
+ # Converts hash and nil to an options object
818
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
819
+
820
+ # Customize the options with defaults
821
+ metadata = @config.rpcs.generate_aws_access_token.metadata.to_h
822
+
823
+ # Set x-goog-api-client and x-goog-user-project headers
824
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
825
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
826
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
827
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
828
+
829
+ header_params = {}
830
+ if request.aws_cluster
831
+ header_params["aws_cluster"] = request.aws_cluster
832
+ end
833
+
834
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
835
+ metadata[:"x-goog-request-params"] ||= request_params_header
836
+
837
+ options.apply_defaults timeout: @config.rpcs.generate_aws_access_token.timeout,
838
+ metadata: metadata,
839
+ retry_policy: @config.rpcs.generate_aws_access_token.retry_policy
840
+
841
+ options.apply_defaults timeout: @config.timeout,
842
+ metadata: @config.metadata,
843
+ retry_policy: @config.retry_policy
844
+
845
+ @aws_clusters_stub.call_rpc :generate_aws_access_token, request, options: options do |response, operation|
846
+ yield response, operation if block_given?
847
+ return response
848
+ end
849
+ rescue ::GRPC::BadStatus => e
850
+ raise ::Google::Cloud::Error.from_error(e)
851
+ end
852
+
853
+ ##
854
+ # Creates a new {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool}, attached to a given {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster}.
855
+ #
856
+ # If successful, the response contains a newly created
857
+ # {::Google::Longrunning::Operation Operation} resource that can be
858
+ # described to track the status of the operation.
859
+ #
860
+ # @overload create_aws_node_pool(request, options = nil)
861
+ # Pass arguments to `create_aws_node_pool` via a request object, either of type
862
+ # {::Google::Cloud::GkeMultiCloud::V1::CreateAwsNodePoolRequest} or an equivalent Hash.
863
+ #
864
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::CreateAwsNodePoolRequest, ::Hash]
865
+ # A request object representing the call parameters. Required. To specify no
866
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
867
+ # @param options [::Gapic::CallOptions, ::Hash]
868
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
869
+ #
870
+ # @overload create_aws_node_pool(parent: nil, aws_node_pool: nil, aws_node_pool_id: nil, validate_only: nil)
871
+ # Pass arguments to `create_aws_node_pool` via keyword arguments. Note that at
872
+ # least one keyword argument is required. To specify no parameters, or to keep all
873
+ # the default parameter values, pass an empty Hash as a request object (see above).
874
+ #
875
+ # @param parent [::String]
876
+ # Required. The {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster} resource where this node pool will be created.
877
+ #
878
+ # `AwsCluster` names are formatted as
879
+ # `projects/<project-id>/locations/<region>/awsClusters/<cluster-id>`.
880
+ #
881
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
882
+ # for more details on Google Cloud resource names.
883
+ # @param aws_node_pool [::Google::Cloud::GkeMultiCloud::V1::AwsNodePool, ::Hash]
884
+ # Required. The specification of the {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool} to create.
885
+ # @param aws_node_pool_id [::String]
886
+ # Required. A client provided ID the resource. Must be unique within the parent
887
+ # resource.
888
+ #
889
+ # The provided ID will be part of the {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool}
890
+ # resource name formatted as
891
+ # `projects/<project-id>/locations/<region>/awsClusters/<cluster-id>/awsNodePools/<node-pool-id>`.
892
+ #
893
+ # Valid characters are `/[a-z][0-9]-/`. Cannot be longer than 40 characters.
894
+ # @param validate_only [::Boolean]
895
+ # If set, only validate the request, but do not actually create the node
896
+ # pool.
897
+ #
898
+ # @yield [response, operation] Access the result along with the RPC operation
899
+ # @yieldparam response [::Gapic::Operation]
900
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
901
+ #
902
+ # @return [::Gapic::Operation]
903
+ #
904
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
905
+ #
906
+ # @example Basic example
907
+ # require "google/cloud/gke_multi_cloud/v1"
908
+ #
909
+ # # Create a client object. The client can be reused for multiple calls.
910
+ # client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new
911
+ #
912
+ # # Create a request. To set request fields, pass in keyword arguments.
913
+ # request = Google::Cloud::GkeMultiCloud::V1::CreateAwsNodePoolRequest.new
914
+ #
915
+ # # Call the create_aws_node_pool method.
916
+ # result = client.create_aws_node_pool request
917
+ #
918
+ # # The returned object is of type Gapic::Operation. You can use this
919
+ # # object to check the status of an operation, cancel it, or wait
920
+ # # for results. Here is how to block until completion:
921
+ # result.wait_until_done! timeout: 60
922
+ # if result.response?
923
+ # p result.response
924
+ # else
925
+ # puts "Error!"
926
+ # end
927
+ #
928
+ def create_aws_node_pool request, options = nil
929
+ raise ::ArgumentError, "request must be provided" if request.nil?
930
+
931
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::CreateAwsNodePoolRequest
932
+
933
+ # Converts hash and nil to an options object
934
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
935
+
936
+ # Customize the options with defaults
937
+ metadata = @config.rpcs.create_aws_node_pool.metadata.to_h
938
+
939
+ # Set x-goog-api-client and x-goog-user-project headers
940
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
941
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
942
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
943
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
944
+
945
+ header_params = {}
946
+ if request.parent
947
+ header_params["parent"] = request.parent
948
+ end
949
+
950
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
951
+ metadata[:"x-goog-request-params"] ||= request_params_header
952
+
953
+ options.apply_defaults timeout: @config.rpcs.create_aws_node_pool.timeout,
954
+ metadata: metadata,
955
+ retry_policy: @config.rpcs.create_aws_node_pool.retry_policy
956
+
957
+ options.apply_defaults timeout: @config.timeout,
958
+ metadata: @config.metadata,
959
+ retry_policy: @config.retry_policy
960
+
961
+ @aws_clusters_stub.call_rpc :create_aws_node_pool, request, options: options do |response, operation|
962
+ response = ::Gapic::Operation.new response, @operations_client, options: options
963
+ yield response, operation if block_given?
964
+ return response
965
+ end
966
+ rescue ::GRPC::BadStatus => e
967
+ raise ::Google::Cloud::Error.from_error(e)
968
+ end
969
+
970
+ ##
971
+ # Updates an {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool}.
972
+ #
973
+ # @overload update_aws_node_pool(request, options = nil)
974
+ # Pass arguments to `update_aws_node_pool` via a request object, either of type
975
+ # {::Google::Cloud::GkeMultiCloud::V1::UpdateAwsNodePoolRequest} or an equivalent Hash.
976
+ #
977
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::UpdateAwsNodePoolRequest, ::Hash]
978
+ # A request object representing the call parameters. Required. To specify no
979
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
980
+ # @param options [::Gapic::CallOptions, ::Hash]
981
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
982
+ #
983
+ # @overload update_aws_node_pool(aws_node_pool: nil, validate_only: nil, update_mask: nil)
984
+ # Pass arguments to `update_aws_node_pool` via keyword arguments. Note that at
985
+ # least one keyword argument is required. To specify no parameters, or to keep all
986
+ # the default parameter values, pass an empty Hash as a request object (see above).
987
+ #
988
+ # @param aws_node_pool [::Google::Cloud::GkeMultiCloud::V1::AwsNodePool, ::Hash]
989
+ # Required. The {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool} resource to update.
990
+ # @param validate_only [::Boolean]
991
+ # If set, only validate the request, but don't actually update the node pool.
992
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
993
+ # Required. Mask of fields to update. At least one path must be supplied in
994
+ # this field. The elements of the repeated paths field can only include these
995
+ # fields from {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool}:
996
+ #
997
+ # * `annotations`.
998
+ # * `version`.
999
+ # * `autoscaling.min_node_count`.
1000
+ # * `autoscaling.max_node_count`.
1001
+ # * `config.config_encryption.kms_key_arn`.
1002
+ # * `config.security_group_ids`.
1003
+ # * `config.root_volume.iops`.
1004
+ # * `config.root_volume.kms_key_arn`.
1005
+ # * `config.root_volume.volume_type`.
1006
+ # * `config.root_volume.size_gib`.
1007
+ # * `config.proxy_config`.
1008
+ # * `config.proxy_config.secret_arn`.
1009
+ # * `config.proxy_config.secret_version`.
1010
+ # * `config.ssh_config`.
1011
+ # * `config.ssh_config.ec2_key_pair`.
1012
+ #
1013
+ # @yield [response, operation] Access the result along with the RPC operation
1014
+ # @yieldparam response [::Gapic::Operation]
1015
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1016
+ #
1017
+ # @return [::Gapic::Operation]
1018
+ #
1019
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1020
+ #
1021
+ # @example Basic example
1022
+ # require "google/cloud/gke_multi_cloud/v1"
1023
+ #
1024
+ # # Create a client object. The client can be reused for multiple calls.
1025
+ # client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new
1026
+ #
1027
+ # # Create a request. To set request fields, pass in keyword arguments.
1028
+ # request = Google::Cloud::GkeMultiCloud::V1::UpdateAwsNodePoolRequest.new
1029
+ #
1030
+ # # Call the update_aws_node_pool method.
1031
+ # result = client.update_aws_node_pool request
1032
+ #
1033
+ # # The returned object is of type Gapic::Operation. You can use this
1034
+ # # object to check the status of an operation, cancel it, or wait
1035
+ # # for results. Here is how to block until completion:
1036
+ # result.wait_until_done! timeout: 60
1037
+ # if result.response?
1038
+ # p result.response
1039
+ # else
1040
+ # puts "Error!"
1041
+ # end
1042
+ #
1043
+ def update_aws_node_pool request, options = nil
1044
+ raise ::ArgumentError, "request must be provided" if request.nil?
1045
+
1046
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::UpdateAwsNodePoolRequest
1047
+
1048
+ # Converts hash and nil to an options object
1049
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1050
+
1051
+ # Customize the options with defaults
1052
+ metadata = @config.rpcs.update_aws_node_pool.metadata.to_h
1053
+
1054
+ # Set x-goog-api-client and x-goog-user-project headers
1055
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1056
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1057
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
1058
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1059
+
1060
+ header_params = {}
1061
+ if request.aws_node_pool&.name
1062
+ header_params["aws_node_pool.name"] = request.aws_node_pool.name
1063
+ end
1064
+
1065
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1066
+ metadata[:"x-goog-request-params"] ||= request_params_header
1067
+
1068
+ options.apply_defaults timeout: @config.rpcs.update_aws_node_pool.timeout,
1069
+ metadata: metadata,
1070
+ retry_policy: @config.rpcs.update_aws_node_pool.retry_policy
1071
+
1072
+ options.apply_defaults timeout: @config.timeout,
1073
+ metadata: @config.metadata,
1074
+ retry_policy: @config.retry_policy
1075
+
1076
+ @aws_clusters_stub.call_rpc :update_aws_node_pool, request, options: options do |response, operation|
1077
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1078
+ yield response, operation if block_given?
1079
+ return response
1080
+ end
1081
+ rescue ::GRPC::BadStatus => e
1082
+ raise ::Google::Cloud::Error.from_error(e)
1083
+ end
1084
+
1085
+ ##
1086
+ # Describes a specific {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool} resource.
1087
+ #
1088
+ # @overload get_aws_node_pool(request, options = nil)
1089
+ # Pass arguments to `get_aws_node_pool` via a request object, either of type
1090
+ # {::Google::Cloud::GkeMultiCloud::V1::GetAwsNodePoolRequest} or an equivalent Hash.
1091
+ #
1092
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::GetAwsNodePoolRequest, ::Hash]
1093
+ # A request object representing the call parameters. Required. To specify no
1094
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1095
+ # @param options [::Gapic::CallOptions, ::Hash]
1096
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1097
+ #
1098
+ # @overload get_aws_node_pool(name: nil)
1099
+ # Pass arguments to `get_aws_node_pool` via keyword arguments. Note that at
1100
+ # least one keyword argument is required. To specify no parameters, or to keep all
1101
+ # the default parameter values, pass an empty Hash as a request object (see above).
1102
+ #
1103
+ # @param name [::String]
1104
+ # Required. The name of the {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool} resource to describe.
1105
+ #
1106
+ # `AwsNodePool` names are formatted as
1107
+ # `projects/<project-id>/locations/<region>/awsClusters/<cluster-id>/awsNodePools/<node-pool-id>`.
1108
+ #
1109
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
1110
+ # for more details on Google Cloud resource names.
1111
+ #
1112
+ # @yield [response, operation] Access the result along with the RPC operation
1113
+ # @yieldparam response [::Google::Cloud::GkeMultiCloud::V1::AwsNodePool]
1114
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1115
+ #
1116
+ # @return [::Google::Cloud::GkeMultiCloud::V1::AwsNodePool]
1117
+ #
1118
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1119
+ #
1120
+ # @example Basic example
1121
+ # require "google/cloud/gke_multi_cloud/v1"
1122
+ #
1123
+ # # Create a client object. The client can be reused for multiple calls.
1124
+ # client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new
1125
+ #
1126
+ # # Create a request. To set request fields, pass in keyword arguments.
1127
+ # request = Google::Cloud::GkeMultiCloud::V1::GetAwsNodePoolRequest.new
1128
+ #
1129
+ # # Call the get_aws_node_pool method.
1130
+ # result = client.get_aws_node_pool request
1131
+ #
1132
+ # # The returned object is of type Google::Cloud::GkeMultiCloud::V1::AwsNodePool.
1133
+ # p result
1134
+ #
1135
+ def get_aws_node_pool request, options = nil
1136
+ raise ::ArgumentError, "request must be provided" if request.nil?
1137
+
1138
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::GetAwsNodePoolRequest
1139
+
1140
+ # Converts hash and nil to an options object
1141
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1142
+
1143
+ # Customize the options with defaults
1144
+ metadata = @config.rpcs.get_aws_node_pool.metadata.to_h
1145
+
1146
+ # Set x-goog-api-client and x-goog-user-project headers
1147
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1148
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1149
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
1150
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1151
+
1152
+ header_params = {}
1153
+ if request.name
1154
+ header_params["name"] = request.name
1155
+ end
1156
+
1157
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1158
+ metadata[:"x-goog-request-params"] ||= request_params_header
1159
+
1160
+ options.apply_defaults timeout: @config.rpcs.get_aws_node_pool.timeout,
1161
+ metadata: metadata,
1162
+ retry_policy: @config.rpcs.get_aws_node_pool.retry_policy
1163
+
1164
+ options.apply_defaults timeout: @config.timeout,
1165
+ metadata: @config.metadata,
1166
+ retry_policy: @config.retry_policy
1167
+
1168
+ @aws_clusters_stub.call_rpc :get_aws_node_pool, request, options: options do |response, operation|
1169
+ yield response, operation if block_given?
1170
+ return response
1171
+ end
1172
+ rescue ::GRPC::BadStatus => e
1173
+ raise ::Google::Cloud::Error.from_error(e)
1174
+ end
1175
+
1176
+ ##
1177
+ # Lists all {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool} resources on a given {::Google::Cloud::GkeMultiCloud::V1::AwsCluster AwsCluster}.
1178
+ #
1179
+ # @overload list_aws_node_pools(request, options = nil)
1180
+ # Pass arguments to `list_aws_node_pools` via a request object, either of type
1181
+ # {::Google::Cloud::GkeMultiCloud::V1::ListAwsNodePoolsRequest} or an equivalent Hash.
1182
+ #
1183
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::ListAwsNodePoolsRequest, ::Hash]
1184
+ # A request object representing the call parameters. Required. To specify no
1185
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1186
+ # @param options [::Gapic::CallOptions, ::Hash]
1187
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1188
+ #
1189
+ # @overload list_aws_node_pools(parent: nil, page_size: nil, page_token: nil)
1190
+ # Pass arguments to `list_aws_node_pools` via keyword arguments. Note that at
1191
+ # least one keyword argument is required. To specify no parameters, or to keep all
1192
+ # the default parameter values, pass an empty Hash as a request object (see above).
1193
+ #
1194
+ # @param parent [::String]
1195
+ # Required. The parent `AwsCluster` which owns this collection of
1196
+ # {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool} resources.
1197
+ #
1198
+ # `AwsCluster` names are formatted as
1199
+ # `projects/<project-id>/locations/<region>/awsClusters/<cluster-id>`.
1200
+ #
1201
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
1202
+ # for more details on Google Cloud resource names.
1203
+ # @param page_size [::Integer]
1204
+ # The maximum number of items to return.
1205
+ #
1206
+ # If not specified, a default value of 50 will be used by the service.
1207
+ # Regardless of the pageSize value, the response can include a partial list
1208
+ # and a caller should only rely on response's
1209
+ # {::Google::Cloud::GkeMultiCloud::V1::ListAwsNodePoolsResponse#next_page_token nextPageToken} to determine if
1210
+ # there are more instances left to be queried.
1211
+ # @param page_token [::String]
1212
+ # The `nextPageToken` value returned from a previous
1213
+ # {::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client#list_aws_node_pools awsNodePools.list} request, if any.
1214
+ #
1215
+ # @yield [response, operation] Access the result along with the RPC operation
1216
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AwsNodePool>]
1217
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1218
+ #
1219
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AwsNodePool>]
1220
+ #
1221
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1222
+ #
1223
+ # @example Basic example
1224
+ # require "google/cloud/gke_multi_cloud/v1"
1225
+ #
1226
+ # # Create a client object. The client can be reused for multiple calls.
1227
+ # client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new
1228
+ #
1229
+ # # Create a request. To set request fields, pass in keyword arguments.
1230
+ # request = Google::Cloud::GkeMultiCloud::V1::ListAwsNodePoolsRequest.new
1231
+ #
1232
+ # # Call the list_aws_node_pools method.
1233
+ # result = client.list_aws_node_pools request
1234
+ #
1235
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1236
+ # # iterate over all elements by calling #each, and the enumerable
1237
+ # # will lazily make API calls to fetch subsequent pages. Other
1238
+ # # methods are also available for managing paging directly.
1239
+ # result.each do |response|
1240
+ # # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AwsNodePool.
1241
+ # p response
1242
+ # end
1243
+ #
1244
+ def list_aws_node_pools request, options = nil
1245
+ raise ::ArgumentError, "request must be provided" if request.nil?
1246
+
1247
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::ListAwsNodePoolsRequest
1248
+
1249
+ # Converts hash and nil to an options object
1250
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1251
+
1252
+ # Customize the options with defaults
1253
+ metadata = @config.rpcs.list_aws_node_pools.metadata.to_h
1254
+
1255
+ # Set x-goog-api-client and x-goog-user-project headers
1256
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1257
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1258
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
1259
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1260
+
1261
+ header_params = {}
1262
+ if request.parent
1263
+ header_params["parent"] = request.parent
1264
+ end
1265
+
1266
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1267
+ metadata[:"x-goog-request-params"] ||= request_params_header
1268
+
1269
+ options.apply_defaults timeout: @config.rpcs.list_aws_node_pools.timeout,
1270
+ metadata: metadata,
1271
+ retry_policy: @config.rpcs.list_aws_node_pools.retry_policy
1272
+
1273
+ options.apply_defaults timeout: @config.timeout,
1274
+ metadata: @config.metadata,
1275
+ retry_policy: @config.retry_policy
1276
+
1277
+ @aws_clusters_stub.call_rpc :list_aws_node_pools, request, options: options do |response, operation|
1278
+ response = ::Gapic::PagedEnumerable.new @aws_clusters_stub, :list_aws_node_pools, request, response, operation, options
1279
+ yield response, operation if block_given?
1280
+ return response
1281
+ end
1282
+ rescue ::GRPC::BadStatus => e
1283
+ raise ::Google::Cloud::Error.from_error(e)
1284
+ end
1285
+
1286
+ ##
1287
+ # Deletes a specific {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool} resource.
1288
+ #
1289
+ # If successful, the response contains a newly created
1290
+ # {::Google::Longrunning::Operation Operation} resource that can be
1291
+ # described to track the status of the operation.
1292
+ #
1293
+ # @overload delete_aws_node_pool(request, options = nil)
1294
+ # Pass arguments to `delete_aws_node_pool` via a request object, either of type
1295
+ # {::Google::Cloud::GkeMultiCloud::V1::DeleteAwsNodePoolRequest} or an equivalent Hash.
1296
+ #
1297
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::DeleteAwsNodePoolRequest, ::Hash]
1298
+ # A request object representing the call parameters. Required. To specify no
1299
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1300
+ # @param options [::Gapic::CallOptions, ::Hash]
1301
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1302
+ #
1303
+ # @overload delete_aws_node_pool(name: nil, validate_only: nil, allow_missing: nil, etag: nil)
1304
+ # Pass arguments to `delete_aws_node_pool` via keyword arguments. Note that at
1305
+ # least one keyword argument is required. To specify no parameters, or to keep all
1306
+ # the default parameter values, pass an empty Hash as a request object (see above).
1307
+ #
1308
+ # @param name [::String]
1309
+ # Required. The resource name the {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool} to delete.
1310
+ #
1311
+ # `AwsNodePool` names are formatted as
1312
+ # `projects/<project-id>/locations/<region>/awsClusters/<cluster-id>/awsNodePools/<node-pool-id>`.
1313
+ #
1314
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
1315
+ # for more details on Google Cloud resource names.
1316
+ # @param validate_only [::Boolean]
1317
+ # If set, only validate the request, but do not actually delete the node
1318
+ # pool.
1319
+ # @param allow_missing [::Boolean]
1320
+ # If set to true, and the {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool} resource is not found,
1321
+ # the request will succeed but no action will be taken on the server and a
1322
+ # completed {::Google::Longrunning::Operation Operation} will be returned.
1323
+ #
1324
+ # Useful for idempotent deletion.
1325
+ # @param etag [::String]
1326
+ # The current ETag of the {::Google::Cloud::GkeMultiCloud::V1::AwsNodePool AwsNodePool}.
1327
+ #
1328
+ # Allows clients to perform deletions through optimistic concurrency control.
1329
+ #
1330
+ # If the provided ETag does not match the current etag of the node pool,
1331
+ # the request will fail and an ABORTED error will be returned.
1332
+ #
1333
+ # @yield [response, operation] Access the result along with the RPC operation
1334
+ # @yieldparam response [::Gapic::Operation]
1335
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1336
+ #
1337
+ # @return [::Gapic::Operation]
1338
+ #
1339
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1340
+ #
1341
+ # @example Basic example
1342
+ # require "google/cloud/gke_multi_cloud/v1"
1343
+ #
1344
+ # # Create a client object. The client can be reused for multiple calls.
1345
+ # client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new
1346
+ #
1347
+ # # Create a request. To set request fields, pass in keyword arguments.
1348
+ # request = Google::Cloud::GkeMultiCloud::V1::DeleteAwsNodePoolRequest.new
1349
+ #
1350
+ # # Call the delete_aws_node_pool method.
1351
+ # result = client.delete_aws_node_pool request
1352
+ #
1353
+ # # The returned object is of type Gapic::Operation. You can use this
1354
+ # # object to check the status of an operation, cancel it, or wait
1355
+ # # for results. Here is how to block until completion:
1356
+ # result.wait_until_done! timeout: 60
1357
+ # if result.response?
1358
+ # p result.response
1359
+ # else
1360
+ # puts "Error!"
1361
+ # end
1362
+ #
1363
+ def delete_aws_node_pool request, options = nil
1364
+ raise ::ArgumentError, "request must be provided" if request.nil?
1365
+
1366
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::DeleteAwsNodePoolRequest
1367
+
1368
+ # Converts hash and nil to an options object
1369
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1370
+
1371
+ # Customize the options with defaults
1372
+ metadata = @config.rpcs.delete_aws_node_pool.metadata.to_h
1373
+
1374
+ # Set x-goog-api-client and x-goog-user-project headers
1375
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1376
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1377
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
1378
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1379
+
1380
+ header_params = {}
1381
+ if request.name
1382
+ header_params["name"] = request.name
1383
+ end
1384
+
1385
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1386
+ metadata[:"x-goog-request-params"] ||= request_params_header
1387
+
1388
+ options.apply_defaults timeout: @config.rpcs.delete_aws_node_pool.timeout,
1389
+ metadata: metadata,
1390
+ retry_policy: @config.rpcs.delete_aws_node_pool.retry_policy
1391
+
1392
+ options.apply_defaults timeout: @config.timeout,
1393
+ metadata: @config.metadata,
1394
+ retry_policy: @config.retry_policy
1395
+
1396
+ @aws_clusters_stub.call_rpc :delete_aws_node_pool, request, options: options do |response, operation|
1397
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1398
+ yield response, operation if block_given?
1399
+ return response
1400
+ end
1401
+ rescue ::GRPC::BadStatus => e
1402
+ raise ::Google::Cloud::Error.from_error(e)
1403
+ end
1404
+
1405
+ ##
1406
+ # Returns information, such as supported AWS regions and Kubernetes
1407
+ # versions, on a given Google Cloud location.
1408
+ #
1409
+ # @overload get_aws_server_config(request, options = nil)
1410
+ # Pass arguments to `get_aws_server_config` via a request object, either of type
1411
+ # {::Google::Cloud::GkeMultiCloud::V1::GetAwsServerConfigRequest} or an equivalent Hash.
1412
+ #
1413
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::GetAwsServerConfigRequest, ::Hash]
1414
+ # A request object representing the call parameters. Required. To specify no
1415
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1416
+ # @param options [::Gapic::CallOptions, ::Hash]
1417
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1418
+ #
1419
+ # @overload get_aws_server_config(name: nil)
1420
+ # Pass arguments to `get_aws_server_config` via keyword arguments. Note that at
1421
+ # least one keyword argument is required. To specify no parameters, or to keep all
1422
+ # the default parameter values, pass an empty Hash as a request object (see above).
1423
+ #
1424
+ # @param name [::String]
1425
+ # Required. The name of the {::Google::Cloud::GkeMultiCloud::V1::AwsServerConfig AwsServerConfig} resource to describe.
1426
+ #
1427
+ # `AwsServerConfig` names are formatted as
1428
+ # `projects/<project-id>/locations/<region>/awsServerConfig`.
1429
+ #
1430
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
1431
+ # for more details on Google Cloud resource names.
1432
+ #
1433
+ # @yield [response, operation] Access the result along with the RPC operation
1434
+ # @yieldparam response [::Google::Cloud::GkeMultiCloud::V1::AwsServerConfig]
1435
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1436
+ #
1437
+ # @return [::Google::Cloud::GkeMultiCloud::V1::AwsServerConfig]
1438
+ #
1439
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1440
+ #
1441
+ # @example Basic example
1442
+ # require "google/cloud/gke_multi_cloud/v1"
1443
+ #
1444
+ # # Create a client object. The client can be reused for multiple calls.
1445
+ # client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new
1446
+ #
1447
+ # # Create a request. To set request fields, pass in keyword arguments.
1448
+ # request = Google::Cloud::GkeMultiCloud::V1::GetAwsServerConfigRequest.new
1449
+ #
1450
+ # # Call the get_aws_server_config method.
1451
+ # result = client.get_aws_server_config request
1452
+ #
1453
+ # # The returned object is of type Google::Cloud::GkeMultiCloud::V1::AwsServerConfig.
1454
+ # p result
1455
+ #
1456
+ def get_aws_server_config request, options = nil
1457
+ raise ::ArgumentError, "request must be provided" if request.nil?
1458
+
1459
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::GetAwsServerConfigRequest
1460
+
1461
+ # Converts hash and nil to an options object
1462
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1463
+
1464
+ # Customize the options with defaults
1465
+ metadata = @config.rpcs.get_aws_server_config.metadata.to_h
1466
+
1467
+ # Set x-goog-api-client and x-goog-user-project headers
1468
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1469
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1470
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
1471
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1472
+
1473
+ header_params = {}
1474
+ if request.name
1475
+ header_params["name"] = request.name
1476
+ end
1477
+
1478
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1479
+ metadata[:"x-goog-request-params"] ||= request_params_header
1480
+
1481
+ options.apply_defaults timeout: @config.rpcs.get_aws_server_config.timeout,
1482
+ metadata: metadata,
1483
+ retry_policy: @config.rpcs.get_aws_server_config.retry_policy
1484
+
1485
+ options.apply_defaults timeout: @config.timeout,
1486
+ metadata: @config.metadata,
1487
+ retry_policy: @config.retry_policy
1488
+
1489
+ @aws_clusters_stub.call_rpc :get_aws_server_config, request, options: options do |response, operation|
1490
+ yield response, operation if block_given?
1491
+ return response
1492
+ end
1493
+ rescue ::GRPC::BadStatus => e
1494
+ raise ::Google::Cloud::Error.from_error(e)
1495
+ end
1496
+
1497
+ ##
1498
+ # Configuration class for the AwsClusters API.
1499
+ #
1500
+ # This class represents the configuration for AwsClusters,
1501
+ # providing control over timeouts, retry behavior, logging, transport
1502
+ # parameters, and other low-level controls. Certain parameters can also be
1503
+ # applied individually to specific RPCs. See
1504
+ # {::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client::Configuration::Rpcs}
1505
+ # for a list of RPCs that can be configured independently.
1506
+ #
1507
+ # Configuration can be applied globally to all clients, or to a single client
1508
+ # on construction.
1509
+ #
1510
+ # @example
1511
+ #
1512
+ # # Modify the global config, setting the timeout for
1513
+ # # create_aws_cluster to 20 seconds,
1514
+ # # and all remaining timeouts to 10 seconds.
1515
+ # ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.configure do |config|
1516
+ # config.timeout = 10.0
1517
+ # config.rpcs.create_aws_cluster.timeout = 20.0
1518
+ # end
1519
+ #
1520
+ # # Apply the above configuration only to a new client.
1521
+ # client = ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new do |config|
1522
+ # config.timeout = 10.0
1523
+ # config.rpcs.create_aws_cluster.timeout = 20.0
1524
+ # end
1525
+ #
1526
+ # @!attribute [rw] endpoint
1527
+ # The hostname or hostname:port of the service endpoint.
1528
+ # Defaults to `"gkemulticloud.googleapis.com"`.
1529
+ # @return [::String]
1530
+ # @!attribute [rw] credentials
1531
+ # Credentials to send with calls. You may provide any of the following types:
1532
+ # * (`String`) The path to a service account key file in JSON format
1533
+ # * (`Hash`) A service account key as a Hash
1534
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1535
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1536
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1537
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1538
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1539
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1540
+ # * (`nil`) indicating no credentials
1541
+ # @return [::Object]
1542
+ # @!attribute [rw] scope
1543
+ # The OAuth scopes
1544
+ # @return [::Array<::String>]
1545
+ # @!attribute [rw] lib_name
1546
+ # The library name as recorded in instrumentation and logging
1547
+ # @return [::String]
1548
+ # @!attribute [rw] lib_version
1549
+ # The library version as recorded in instrumentation and logging
1550
+ # @return [::String]
1551
+ # @!attribute [rw] channel_args
1552
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1553
+ # `GRPC::Core::Channel` object is provided as the credential.
1554
+ # @return [::Hash]
1555
+ # @!attribute [rw] interceptors
1556
+ # An array of interceptors that are run before calls are executed.
1557
+ # @return [::Array<::GRPC::ClientInterceptor>]
1558
+ # @!attribute [rw] timeout
1559
+ # The call timeout in seconds.
1560
+ # @return [::Numeric]
1561
+ # @!attribute [rw] metadata
1562
+ # Additional gRPC headers to be sent with the call.
1563
+ # @return [::Hash{::Symbol=>::String}]
1564
+ # @!attribute [rw] retry_policy
1565
+ # The retry policy. The value is a hash with the following keys:
1566
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1567
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1568
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1569
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1570
+ # trigger a retry.
1571
+ # @return [::Hash]
1572
+ # @!attribute [rw] quota_project
1573
+ # A separate project against which to charge quota.
1574
+ # @return [::String]
1575
+ #
1576
+ class Configuration
1577
+ extend ::Gapic::Config
1578
+
1579
+ config_attr :endpoint, "gkemulticloud.googleapis.com", ::String
1580
+ config_attr :credentials, nil do |value|
1581
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1582
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1583
+ allowed.any? { |klass| klass === value }
1584
+ end
1585
+ config_attr :scope, nil, ::String, ::Array, nil
1586
+ config_attr :lib_name, nil, ::String, nil
1587
+ config_attr :lib_version, nil, ::String, nil
1588
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1589
+ config_attr :interceptors, nil, ::Array, nil
1590
+ config_attr :timeout, nil, ::Numeric, nil
1591
+ config_attr :metadata, nil, ::Hash, nil
1592
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1593
+ config_attr :quota_project, nil, ::String, nil
1594
+
1595
+ # @private
1596
+ def initialize parent_config = nil
1597
+ @parent_config = parent_config unless parent_config.nil?
1598
+
1599
+ yield self if block_given?
1600
+ end
1601
+
1602
+ ##
1603
+ # Configurations for individual RPCs
1604
+ # @return [Rpcs]
1605
+ #
1606
+ def rpcs
1607
+ @rpcs ||= begin
1608
+ parent_rpcs = nil
1609
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1610
+ Rpcs.new parent_rpcs
1611
+ end
1612
+ end
1613
+
1614
+ ##
1615
+ # Configuration RPC class for the AwsClusters API.
1616
+ #
1617
+ # Includes fields providing the configuration for each RPC in this service.
1618
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1619
+ # the following configuration fields:
1620
+ #
1621
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1622
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1623
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1624
+ # include the following keys:
1625
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1626
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1627
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1628
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1629
+ # trigger a retry.
1630
+ #
1631
+ class Rpcs
1632
+ ##
1633
+ # RPC-specific configuration for `create_aws_cluster`
1634
+ # @return [::Gapic::Config::Method]
1635
+ #
1636
+ attr_reader :create_aws_cluster
1637
+ ##
1638
+ # RPC-specific configuration for `update_aws_cluster`
1639
+ # @return [::Gapic::Config::Method]
1640
+ #
1641
+ attr_reader :update_aws_cluster
1642
+ ##
1643
+ # RPC-specific configuration for `get_aws_cluster`
1644
+ # @return [::Gapic::Config::Method]
1645
+ #
1646
+ attr_reader :get_aws_cluster
1647
+ ##
1648
+ # RPC-specific configuration for `list_aws_clusters`
1649
+ # @return [::Gapic::Config::Method]
1650
+ #
1651
+ attr_reader :list_aws_clusters
1652
+ ##
1653
+ # RPC-specific configuration for `delete_aws_cluster`
1654
+ # @return [::Gapic::Config::Method]
1655
+ #
1656
+ attr_reader :delete_aws_cluster
1657
+ ##
1658
+ # RPC-specific configuration for `generate_aws_access_token`
1659
+ # @return [::Gapic::Config::Method]
1660
+ #
1661
+ attr_reader :generate_aws_access_token
1662
+ ##
1663
+ # RPC-specific configuration for `create_aws_node_pool`
1664
+ # @return [::Gapic::Config::Method]
1665
+ #
1666
+ attr_reader :create_aws_node_pool
1667
+ ##
1668
+ # RPC-specific configuration for `update_aws_node_pool`
1669
+ # @return [::Gapic::Config::Method]
1670
+ #
1671
+ attr_reader :update_aws_node_pool
1672
+ ##
1673
+ # RPC-specific configuration for `get_aws_node_pool`
1674
+ # @return [::Gapic::Config::Method]
1675
+ #
1676
+ attr_reader :get_aws_node_pool
1677
+ ##
1678
+ # RPC-specific configuration for `list_aws_node_pools`
1679
+ # @return [::Gapic::Config::Method]
1680
+ #
1681
+ attr_reader :list_aws_node_pools
1682
+ ##
1683
+ # RPC-specific configuration for `delete_aws_node_pool`
1684
+ # @return [::Gapic::Config::Method]
1685
+ #
1686
+ attr_reader :delete_aws_node_pool
1687
+ ##
1688
+ # RPC-specific configuration for `get_aws_server_config`
1689
+ # @return [::Gapic::Config::Method]
1690
+ #
1691
+ attr_reader :get_aws_server_config
1692
+
1693
+ # @private
1694
+ def initialize parent_rpcs = nil
1695
+ create_aws_cluster_config = parent_rpcs.create_aws_cluster if parent_rpcs.respond_to? :create_aws_cluster
1696
+ @create_aws_cluster = ::Gapic::Config::Method.new create_aws_cluster_config
1697
+ update_aws_cluster_config = parent_rpcs.update_aws_cluster if parent_rpcs.respond_to? :update_aws_cluster
1698
+ @update_aws_cluster = ::Gapic::Config::Method.new update_aws_cluster_config
1699
+ get_aws_cluster_config = parent_rpcs.get_aws_cluster if parent_rpcs.respond_to? :get_aws_cluster
1700
+ @get_aws_cluster = ::Gapic::Config::Method.new get_aws_cluster_config
1701
+ list_aws_clusters_config = parent_rpcs.list_aws_clusters if parent_rpcs.respond_to? :list_aws_clusters
1702
+ @list_aws_clusters = ::Gapic::Config::Method.new list_aws_clusters_config
1703
+ delete_aws_cluster_config = parent_rpcs.delete_aws_cluster if parent_rpcs.respond_to? :delete_aws_cluster
1704
+ @delete_aws_cluster = ::Gapic::Config::Method.new delete_aws_cluster_config
1705
+ generate_aws_access_token_config = parent_rpcs.generate_aws_access_token if parent_rpcs.respond_to? :generate_aws_access_token
1706
+ @generate_aws_access_token = ::Gapic::Config::Method.new generate_aws_access_token_config
1707
+ create_aws_node_pool_config = parent_rpcs.create_aws_node_pool if parent_rpcs.respond_to? :create_aws_node_pool
1708
+ @create_aws_node_pool = ::Gapic::Config::Method.new create_aws_node_pool_config
1709
+ update_aws_node_pool_config = parent_rpcs.update_aws_node_pool if parent_rpcs.respond_to? :update_aws_node_pool
1710
+ @update_aws_node_pool = ::Gapic::Config::Method.new update_aws_node_pool_config
1711
+ get_aws_node_pool_config = parent_rpcs.get_aws_node_pool if parent_rpcs.respond_to? :get_aws_node_pool
1712
+ @get_aws_node_pool = ::Gapic::Config::Method.new get_aws_node_pool_config
1713
+ list_aws_node_pools_config = parent_rpcs.list_aws_node_pools if parent_rpcs.respond_to? :list_aws_node_pools
1714
+ @list_aws_node_pools = ::Gapic::Config::Method.new list_aws_node_pools_config
1715
+ delete_aws_node_pool_config = parent_rpcs.delete_aws_node_pool if parent_rpcs.respond_to? :delete_aws_node_pool
1716
+ @delete_aws_node_pool = ::Gapic::Config::Method.new delete_aws_node_pool_config
1717
+ get_aws_server_config_config = parent_rpcs.get_aws_server_config if parent_rpcs.respond_to? :get_aws_server_config
1718
+ @get_aws_server_config = ::Gapic::Config::Method.new get_aws_server_config_config
1719
+
1720
+ yield self if block_given?
1721
+ end
1722
+ end
1723
+ end
1724
+ end
1725
+ end
1726
+ end
1727
+ end
1728
+ end
1729
+ end