google-cloud-gke_multi_cloud-v1 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +7 -7
  3. data/README.md +9 -9
  4. data/lib/google/cloud/gke_multi_cloud/v1/attached_clusters/client.rb +1289 -0
  5. data/lib/google/cloud/gke_multi_cloud/v1/attached_clusters/credentials.rb +47 -0
  6. data/lib/google/cloud/gke_multi_cloud/v1/attached_clusters/operations.rb +770 -0
  7. data/lib/google/cloud/gke_multi_cloud/v1/attached_clusters/paths.rb +86 -0
  8. data/lib/google/cloud/gke_multi_cloud/v1/attached_clusters.rb +52 -0
  9. data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/client.rb +93 -51
  10. data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/operations.rb +3 -0
  11. data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters.rb +1 -1
  12. data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/client.rb +126 -75
  13. data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/operations.rb +3 -0
  14. data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters.rb +1 -1
  15. data/lib/google/cloud/gke_multi_cloud/v1/version.rb +1 -1
  16. data/lib/google/cloud/gke_multi_cloud/v1.rb +4 -3
  17. data/lib/google/cloud/gkemulticloud/v1/attached_resources_pb.rb +82 -0
  18. data/lib/google/cloud/gkemulticloud/v1/attached_service_pb.rb +84 -0
  19. data/lib/google/cloud/gkemulticloud/v1/attached_service_services_pb.rb +85 -0
  20. data/lib/google/cloud/gkemulticloud/v1/aws_resources_pb.rb +17 -0
  21. data/lib/google/cloud/gkemulticloud/v1/aws_service_services_pb.rb +19 -11
  22. data/lib/google/cloud/gkemulticloud/v1/azure_resources_pb.rb +11 -0
  23. data/lib/google/cloud/gkemulticloud/v1/azure_service_services_pb.rb +28 -17
  24. data/lib/google/cloud/gkemulticloud/v1/common_resources_pb.rb +10 -0
  25. data/proto_docs/google/api/client.rb +318 -0
  26. data/proto_docs/google/api/launch_stage.rb +71 -0
  27. data/proto_docs/google/cloud/gkemulticloud/v1/attached_resources.rb +239 -0
  28. data/proto_docs/google/cloud/gkemulticloud/v1/attached_service.rb +294 -0
  29. data/proto_docs/google/cloud/gkemulticloud/v1/aws_resources.rb +86 -29
  30. data/proto_docs/google/cloud/gkemulticloud/v1/aws_service.rb +79 -44
  31. data/proto_docs/google/cloud/gkemulticloud/v1/azure_resources.rb +75 -37
  32. data/proto_docs/google/cloud/gkemulticloud/v1/azure_service.rb +105 -64
  33. data/proto_docs/google/cloud/gkemulticloud/v1/common_resources.rb +36 -3
  34. data/proto_docs/google/protobuf/empty.rb +0 -2
  35. data/proto_docs/google/rpc/status.rb +4 -2
  36. metadata +24 -12
@@ -0,0 +1,1289 @@
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/attached_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module GkeMultiCloud
25
+ module V1
26
+ module AttachedClusters
27
+ ##
28
+ # Client for the AttachedClusters service.
29
+ #
30
+ # The AttachedClusters API provides a single centrally managed service
31
+ # to register and manage Anthos attached clusters that run on customer's owned
32
+ # infrastructure.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :attached_clusters_stub
39
+
40
+ ##
41
+ # Configure the AttachedClusters Client class.
42
+ #
43
+ # See {::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all AttachedClusters clients
49
+ # ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "GkeMultiCloud", "V1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.rpcs.create_attached_cluster.timeout = 60.0
70
+
71
+ default_config.rpcs.update_attached_cluster.timeout = 60.0
72
+
73
+ default_config.rpcs.import_attached_cluster.timeout = 60.0
74
+
75
+ default_config.rpcs.get_attached_cluster.timeout = 60.0
76
+ default_config.rpcs.get_attached_cluster.retry_policy = {
77
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
78
+ }
79
+
80
+ default_config.rpcs.list_attached_clusters.timeout = 60.0
81
+ default_config.rpcs.list_attached_clusters.retry_policy = {
82
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
83
+ }
84
+
85
+ default_config.rpcs.delete_attached_cluster.timeout = 60.0
86
+
87
+ default_config.rpcs.get_attached_server_config.timeout = 60.0
88
+ default_config.rpcs.get_attached_server_config.retry_policy = {
89
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
90
+ }
91
+
92
+ default_config.rpcs.generate_attached_cluster_install_manifest.timeout = 60.0
93
+ default_config.rpcs.generate_attached_cluster_install_manifest.retry_policy = {
94
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
95
+ }
96
+
97
+ default_config
98
+ end
99
+ yield @configure if block_given?
100
+ @configure
101
+ end
102
+
103
+ ##
104
+ # Configure the AttachedClusters Client instance.
105
+ #
106
+ # The configuration is set to the derived mode, meaning that values can be changed,
107
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
108
+ # should be made on {Client.configure}.
109
+ #
110
+ # See {::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client::Configuration}
111
+ # for a description of the configuration fields.
112
+ #
113
+ # @yield [config] Configure the Client client.
114
+ # @yieldparam config [Client::Configuration]
115
+ #
116
+ # @return [Client::Configuration]
117
+ #
118
+ def configure
119
+ yield @config if block_given?
120
+ @config
121
+ end
122
+
123
+ ##
124
+ # Create a new AttachedClusters client object.
125
+ #
126
+ # @example
127
+ #
128
+ # # Create a client using the default configuration
129
+ # client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new
130
+ #
131
+ # # Create a client using a custom configuration
132
+ # client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new do |config|
133
+ # config.timeout = 10.0
134
+ # end
135
+ #
136
+ # @yield [config] Configure the AttachedClusters client.
137
+ # @yieldparam config [Client::Configuration]
138
+ #
139
+ def initialize
140
+ # These require statements are intentionally placed here to initialize
141
+ # the gRPC module only when it's required.
142
+ # See https://github.com/googleapis/toolkit/issues/446
143
+ require "gapic/grpc"
144
+ require "google/cloud/gkemulticloud/v1/attached_service_services_pb"
145
+
146
+ # Create the configuration object
147
+ @config = Configuration.new Client.configure
148
+
149
+ # Yield the configuration if needed
150
+ yield @config if block_given?
151
+
152
+ # Create credentials
153
+ credentials = @config.credentials
154
+ # Use self-signed JWT if the endpoint is unchanged from default,
155
+ # but only if the default endpoint does not have a region prefix.
156
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
157
+ !@config.endpoint.split(".").first.include?("-")
158
+ credentials ||= Credentials.default scope: @config.scope,
159
+ enable_self_signed_jwt: enable_self_signed_jwt
160
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
161
+ credentials = Credentials.new credentials, scope: @config.scope
162
+ end
163
+ @quota_project_id = @config.quota_project
164
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
165
+
166
+ @operations_client = Operations.new do |config|
167
+ config.credentials = credentials
168
+ config.quota_project = @quota_project_id
169
+ config.endpoint = @config.endpoint
170
+ end
171
+
172
+ @attached_clusters_stub = ::Gapic::ServiceStub.new(
173
+ ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Stub,
174
+ credentials: credentials,
175
+ endpoint: @config.endpoint,
176
+ channel_args: @config.channel_args,
177
+ interceptors: @config.interceptors
178
+ )
179
+ end
180
+
181
+ ##
182
+ # Get the associated client for long-running operations.
183
+ #
184
+ # @return [::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Operations]
185
+ #
186
+ attr_reader :operations_client
187
+
188
+ # Service calls
189
+
190
+ ##
191
+ # Creates a new
192
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} resource
193
+ # on a given GCP project and region.
194
+ #
195
+ # If successful, the response contains a newly created
196
+ # {::Google::Longrunning::Operation Operation} resource that can be
197
+ # described to track the status of the operation.
198
+ #
199
+ # @overload create_attached_cluster(request, options = nil)
200
+ # Pass arguments to `create_attached_cluster` via a request object, either of type
201
+ # {::Google::Cloud::GkeMultiCloud::V1::CreateAttachedClusterRequest} or an equivalent Hash.
202
+ #
203
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::CreateAttachedClusterRequest, ::Hash]
204
+ # A request object representing the call parameters. Required. To specify no
205
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
206
+ # @param options [::Gapic::CallOptions, ::Hash]
207
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
208
+ #
209
+ # @overload create_attached_cluster(parent: nil, attached_cluster: nil, attached_cluster_id: nil, validate_only: nil)
210
+ # Pass arguments to `create_attached_cluster` via keyword arguments. Note that at
211
+ # least one keyword argument is required. To specify no parameters, or to keep all
212
+ # the default parameter values, pass an empty Hash as a request object (see above).
213
+ #
214
+ # @param parent [::String]
215
+ # Required. The parent location where this
216
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} resource
217
+ # will be created.
218
+ #
219
+ # Location names are formatted as `projects/<project-id>/locations/<region>`.
220
+ #
221
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
222
+ # for more details on Google Cloud resource names.
223
+ # @param attached_cluster [::Google::Cloud::GkeMultiCloud::V1::AttachedCluster, ::Hash]
224
+ # Required. The specification of the
225
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} to create.
226
+ # @param attached_cluster_id [::String]
227
+ # Required. A client provided ID the resource. Must be unique within the
228
+ # parent resource.
229
+ #
230
+ # The provided ID will be part of the
231
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} resource
232
+ # name formatted as
233
+ # `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
234
+ #
235
+ # Valid characters are `/[a-z][0-9]-/`. Cannot be longer than 63 characters.
236
+ # @param validate_only [::Boolean]
237
+ # If set, only validate the request, but do not actually create the cluster.
238
+ #
239
+ # @yield [response, operation] Access the result along with the RPC operation
240
+ # @yieldparam response [::Gapic::Operation]
241
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
242
+ #
243
+ # @return [::Gapic::Operation]
244
+ #
245
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
246
+ #
247
+ # @example Basic example
248
+ # require "google/cloud/gke_multi_cloud/v1"
249
+ #
250
+ # # Create a client object. The client can be reused for multiple calls.
251
+ # client = Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new
252
+ #
253
+ # # Create a request. To set request fields, pass in keyword arguments.
254
+ # request = Google::Cloud::GkeMultiCloud::V1::CreateAttachedClusterRequest.new
255
+ #
256
+ # # Call the create_attached_cluster method.
257
+ # result = client.create_attached_cluster request
258
+ #
259
+ # # The returned object is of type Gapic::Operation. You can use this
260
+ # # object to check the status of an operation, cancel it, or wait
261
+ # # for results. Here is how to block until completion:
262
+ # result.wait_until_done! timeout: 60
263
+ # if result.response?
264
+ # p result.response
265
+ # else
266
+ # puts "Error!"
267
+ # end
268
+ #
269
+ def create_attached_cluster request, options = nil
270
+ raise ::ArgumentError, "request must be provided" if request.nil?
271
+
272
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::CreateAttachedClusterRequest
273
+
274
+ # Converts hash and nil to an options object
275
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
276
+
277
+ # Customize the options with defaults
278
+ metadata = @config.rpcs.create_attached_cluster.metadata.to_h
279
+
280
+ # Set x-goog-api-client and x-goog-user-project headers
281
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
282
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
283
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
284
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
285
+
286
+ header_params = {}
287
+ if request.parent
288
+ header_params["parent"] = request.parent
289
+ end
290
+
291
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
292
+ metadata[:"x-goog-request-params"] ||= request_params_header
293
+
294
+ options.apply_defaults timeout: @config.rpcs.create_attached_cluster.timeout,
295
+ metadata: metadata,
296
+ retry_policy: @config.rpcs.create_attached_cluster.retry_policy
297
+
298
+ options.apply_defaults timeout: @config.timeout,
299
+ metadata: @config.metadata,
300
+ retry_policy: @config.retry_policy
301
+
302
+ @attached_clusters_stub.call_rpc :create_attached_cluster, request, options: options do |response, operation|
303
+ response = ::Gapic::Operation.new response, @operations_client, options: options
304
+ yield response, operation if block_given?
305
+ return response
306
+ end
307
+ rescue ::GRPC::BadStatus => e
308
+ raise ::Google::Cloud::Error.from_error(e)
309
+ end
310
+
311
+ ##
312
+ # Updates an
313
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster}.
314
+ #
315
+ # @overload update_attached_cluster(request, options = nil)
316
+ # Pass arguments to `update_attached_cluster` via a request object, either of type
317
+ # {::Google::Cloud::GkeMultiCloud::V1::UpdateAttachedClusterRequest} or an equivalent Hash.
318
+ #
319
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::UpdateAttachedClusterRequest, ::Hash]
320
+ # A request object representing the call parameters. Required. To specify no
321
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
322
+ # @param options [::Gapic::CallOptions, ::Hash]
323
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
324
+ #
325
+ # @overload update_attached_cluster(attached_cluster: nil, validate_only: nil, update_mask: nil)
326
+ # Pass arguments to `update_attached_cluster` via keyword arguments. Note that at
327
+ # least one keyword argument is required. To specify no parameters, or to keep all
328
+ # the default parameter values, pass an empty Hash as a request object (see above).
329
+ #
330
+ # @param attached_cluster [::Google::Cloud::GkeMultiCloud::V1::AttachedCluster, ::Hash]
331
+ # Required. The
332
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} resource
333
+ # to update.
334
+ # @param validate_only [::Boolean]
335
+ # If set, only validate the request, but do not actually update the cluster.
336
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
337
+ # Required. Mask of fields to update. At least one path must be supplied in
338
+ # this field. The elements of the repeated paths field can only include these
339
+ # fields from
340
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster}:
341
+ #
342
+ # * `description`.
343
+ # * `annotations`.
344
+ # * `platform_version`.
345
+ # * `authorization.admin_users`.
346
+ # * `logging_config.component_config.enable_components`.
347
+ # * `monitoring_config.managed_prometheus_config.enabled`.
348
+ #
349
+ # @yield [response, operation] Access the result along with the RPC operation
350
+ # @yieldparam response [::Gapic::Operation]
351
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
352
+ #
353
+ # @return [::Gapic::Operation]
354
+ #
355
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
356
+ #
357
+ # @example Basic example
358
+ # require "google/cloud/gke_multi_cloud/v1"
359
+ #
360
+ # # Create a client object. The client can be reused for multiple calls.
361
+ # client = Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new
362
+ #
363
+ # # Create a request. To set request fields, pass in keyword arguments.
364
+ # request = Google::Cloud::GkeMultiCloud::V1::UpdateAttachedClusterRequest.new
365
+ #
366
+ # # Call the update_attached_cluster method.
367
+ # result = client.update_attached_cluster request
368
+ #
369
+ # # The returned object is of type Gapic::Operation. You can use this
370
+ # # object to check the status of an operation, cancel it, or wait
371
+ # # for results. Here is how to block until completion:
372
+ # result.wait_until_done! timeout: 60
373
+ # if result.response?
374
+ # p result.response
375
+ # else
376
+ # puts "Error!"
377
+ # end
378
+ #
379
+ def update_attached_cluster request, options = nil
380
+ raise ::ArgumentError, "request must be provided" if request.nil?
381
+
382
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::UpdateAttachedClusterRequest
383
+
384
+ # Converts hash and nil to an options object
385
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
386
+
387
+ # Customize the options with defaults
388
+ metadata = @config.rpcs.update_attached_cluster.metadata.to_h
389
+
390
+ # Set x-goog-api-client and x-goog-user-project headers
391
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
392
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
393
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
394
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
395
+
396
+ header_params = {}
397
+ if request.attached_cluster&.name
398
+ header_params["attached_cluster.name"] = request.attached_cluster.name
399
+ end
400
+
401
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
402
+ metadata[:"x-goog-request-params"] ||= request_params_header
403
+
404
+ options.apply_defaults timeout: @config.rpcs.update_attached_cluster.timeout,
405
+ metadata: metadata,
406
+ retry_policy: @config.rpcs.update_attached_cluster.retry_policy
407
+
408
+ options.apply_defaults timeout: @config.timeout,
409
+ metadata: @config.metadata,
410
+ retry_policy: @config.retry_policy
411
+
412
+ @attached_clusters_stub.call_rpc :update_attached_cluster, request, options: options do |response, operation|
413
+ response = ::Gapic::Operation.new response, @operations_client, options: options
414
+ yield response, operation if block_given?
415
+ return response
416
+ end
417
+ rescue ::GRPC::BadStatus => e
418
+ raise ::Google::Cloud::Error.from_error(e)
419
+ end
420
+
421
+ ##
422
+ # Imports creates a new
423
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} resource
424
+ # by importing an existing Fleet Membership resource.
425
+ #
426
+ # Attached Clusters created before the introduction of the Anthos Multi-Cloud
427
+ # API can be imported through this method.
428
+ #
429
+ # If successful, the response contains a newly created
430
+ # {::Google::Longrunning::Operation Operation} resource that can be
431
+ # described to track the status of the operation.
432
+ #
433
+ # @overload import_attached_cluster(request, options = nil)
434
+ # Pass arguments to `import_attached_cluster` via a request object, either of type
435
+ # {::Google::Cloud::GkeMultiCloud::V1::ImportAttachedClusterRequest} or an equivalent Hash.
436
+ #
437
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::ImportAttachedClusterRequest, ::Hash]
438
+ # A request object representing the call parameters. Required. To specify no
439
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
440
+ # @param options [::Gapic::CallOptions, ::Hash]
441
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
442
+ #
443
+ # @overload import_attached_cluster(parent: nil, validate_only: nil, fleet_membership: nil, platform_version: nil, distribution: nil)
444
+ # Pass arguments to `import_attached_cluster` via keyword arguments. Note that at
445
+ # least one keyword argument is required. To specify no parameters, or to keep all
446
+ # the default parameter values, pass an empty Hash as a request object (see above).
447
+ #
448
+ # @param parent [::String]
449
+ # Required. The parent location where this
450
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} resource
451
+ # will be created.
452
+ #
453
+ # Location names are formatted as `projects/<project-id>/locations/<region>`.
454
+ #
455
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
456
+ # for more details on Google Cloud resource names.
457
+ # @param validate_only [::Boolean]
458
+ # If set, only validate the request, but do not actually import the cluster.
459
+ # @param fleet_membership [::String]
460
+ # Required. The name of the fleet membership resource to import.
461
+ # @param platform_version [::String]
462
+ # Required. The platform version for the cluster (e.g. `1.19.0-gke.1000`).
463
+ #
464
+ # You can list all supported versions on a given Google Cloud region by
465
+ # calling
466
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client#get_attached_server_config GetAttachedServerConfig}.
467
+ # @param distribution [::String]
468
+ # Required. The Kubernetes distribution of the underlying attached cluster.
469
+ #
470
+ # Supported values: ["eks", "aks"].
471
+ #
472
+ # @yield [response, operation] Access the result along with the RPC operation
473
+ # @yieldparam response [::Gapic::Operation]
474
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
475
+ #
476
+ # @return [::Gapic::Operation]
477
+ #
478
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
479
+ #
480
+ # @example Basic example
481
+ # require "google/cloud/gke_multi_cloud/v1"
482
+ #
483
+ # # Create a client object. The client can be reused for multiple calls.
484
+ # client = Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new
485
+ #
486
+ # # Create a request. To set request fields, pass in keyword arguments.
487
+ # request = Google::Cloud::GkeMultiCloud::V1::ImportAttachedClusterRequest.new
488
+ #
489
+ # # Call the import_attached_cluster method.
490
+ # result = client.import_attached_cluster request
491
+ #
492
+ # # The returned object is of type Gapic::Operation. You can use this
493
+ # # object to check the status of an operation, cancel it, or wait
494
+ # # for results. Here is how to block until completion:
495
+ # result.wait_until_done! timeout: 60
496
+ # if result.response?
497
+ # p result.response
498
+ # else
499
+ # puts "Error!"
500
+ # end
501
+ #
502
+ def import_attached_cluster request, options = nil
503
+ raise ::ArgumentError, "request must be provided" if request.nil?
504
+
505
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::ImportAttachedClusterRequest
506
+
507
+ # Converts hash and nil to an options object
508
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
509
+
510
+ # Customize the options with defaults
511
+ metadata = @config.rpcs.import_attached_cluster.metadata.to_h
512
+
513
+ # Set x-goog-api-client and x-goog-user-project headers
514
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
515
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
516
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
517
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
518
+
519
+ header_params = {}
520
+ if request.parent
521
+ header_params["parent"] = request.parent
522
+ end
523
+
524
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
525
+ metadata[:"x-goog-request-params"] ||= request_params_header
526
+
527
+ options.apply_defaults timeout: @config.rpcs.import_attached_cluster.timeout,
528
+ metadata: metadata,
529
+ retry_policy: @config.rpcs.import_attached_cluster.retry_policy
530
+
531
+ options.apply_defaults timeout: @config.timeout,
532
+ metadata: @config.metadata,
533
+ retry_policy: @config.retry_policy
534
+
535
+ @attached_clusters_stub.call_rpc :import_attached_cluster, request, options: options do |response, operation|
536
+ response = ::Gapic::Operation.new response, @operations_client, options: options
537
+ yield response, operation if block_given?
538
+ return response
539
+ end
540
+ rescue ::GRPC::BadStatus => e
541
+ raise ::Google::Cloud::Error.from_error(e)
542
+ end
543
+
544
+ ##
545
+ # Describes a specific
546
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} resource.
547
+ #
548
+ # @overload get_attached_cluster(request, options = nil)
549
+ # Pass arguments to `get_attached_cluster` via a request object, either of type
550
+ # {::Google::Cloud::GkeMultiCloud::V1::GetAttachedClusterRequest} or an equivalent Hash.
551
+ #
552
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::GetAttachedClusterRequest, ::Hash]
553
+ # A request object representing the call parameters. Required. To specify no
554
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
555
+ # @param options [::Gapic::CallOptions, ::Hash]
556
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
557
+ #
558
+ # @overload get_attached_cluster(name: nil)
559
+ # Pass arguments to `get_attached_cluster` via keyword arguments. Note that at
560
+ # least one keyword argument is required. To specify no parameters, or to keep all
561
+ # the default parameter values, pass an empty Hash as a request object (see above).
562
+ #
563
+ # @param name [::String]
564
+ # Required. The name of the
565
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} resource
566
+ # to describe.
567
+ #
568
+ # `AttachedCluster` names are formatted as
569
+ # `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
570
+ #
571
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
572
+ # for more details on GCP resource names.
573
+ #
574
+ # @yield [response, operation] Access the result along with the RPC operation
575
+ # @yieldparam response [::Google::Cloud::GkeMultiCloud::V1::AttachedCluster]
576
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
577
+ #
578
+ # @return [::Google::Cloud::GkeMultiCloud::V1::AttachedCluster]
579
+ #
580
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
581
+ #
582
+ # @example Basic example
583
+ # require "google/cloud/gke_multi_cloud/v1"
584
+ #
585
+ # # Create a client object. The client can be reused for multiple calls.
586
+ # client = Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new
587
+ #
588
+ # # Create a request. To set request fields, pass in keyword arguments.
589
+ # request = Google::Cloud::GkeMultiCloud::V1::GetAttachedClusterRequest.new
590
+ #
591
+ # # Call the get_attached_cluster method.
592
+ # result = client.get_attached_cluster request
593
+ #
594
+ # # The returned object is of type Google::Cloud::GkeMultiCloud::V1::AttachedCluster.
595
+ # p result
596
+ #
597
+ def get_attached_cluster request, options = nil
598
+ raise ::ArgumentError, "request must be provided" if request.nil?
599
+
600
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::GetAttachedClusterRequest
601
+
602
+ # Converts hash and nil to an options object
603
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
604
+
605
+ # Customize the options with defaults
606
+ metadata = @config.rpcs.get_attached_cluster.metadata.to_h
607
+
608
+ # Set x-goog-api-client and x-goog-user-project headers
609
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
610
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
611
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
612
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
613
+
614
+ header_params = {}
615
+ if request.name
616
+ header_params["name"] = request.name
617
+ end
618
+
619
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
620
+ metadata[:"x-goog-request-params"] ||= request_params_header
621
+
622
+ options.apply_defaults timeout: @config.rpcs.get_attached_cluster.timeout,
623
+ metadata: metadata,
624
+ retry_policy: @config.rpcs.get_attached_cluster.retry_policy
625
+
626
+ options.apply_defaults timeout: @config.timeout,
627
+ metadata: @config.metadata,
628
+ retry_policy: @config.retry_policy
629
+
630
+ @attached_clusters_stub.call_rpc :get_attached_cluster, request, options: options do |response, operation|
631
+ yield response, operation if block_given?
632
+ return response
633
+ end
634
+ rescue ::GRPC::BadStatus => e
635
+ raise ::Google::Cloud::Error.from_error(e)
636
+ end
637
+
638
+ ##
639
+ # Lists all {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster}
640
+ # resources on a given Google Cloud project and region.
641
+ #
642
+ # @overload list_attached_clusters(request, options = nil)
643
+ # Pass arguments to `list_attached_clusters` via a request object, either of type
644
+ # {::Google::Cloud::GkeMultiCloud::V1::ListAttachedClustersRequest} or an equivalent Hash.
645
+ #
646
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::ListAttachedClustersRequest, ::Hash]
647
+ # A request object representing the call parameters. Required. To specify no
648
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
649
+ # @param options [::Gapic::CallOptions, ::Hash]
650
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
651
+ #
652
+ # @overload list_attached_clusters(parent: nil, page_size: nil, page_token: nil)
653
+ # Pass arguments to `list_attached_clusters` via keyword arguments. Note that at
654
+ # least one keyword argument is required. To specify no parameters, or to keep all
655
+ # the default parameter values, pass an empty Hash as a request object (see above).
656
+ #
657
+ # @param parent [::String]
658
+ # Required. The parent location which owns this collection of
659
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} resources.
660
+ #
661
+ # Location names are formatted as `projects/<project-id>/locations/<region>`.
662
+ #
663
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
664
+ # for more details on GCP resource names.
665
+ # @param page_size [::Integer]
666
+ # The maximum number of items to return.
667
+ #
668
+ # If not specified, a default value of 50 will be used by the service.
669
+ # Regardless of the pageSize value, the response can include a partial list
670
+ # and a caller should only rely on response's
671
+ # {::Google::Cloud::GkeMultiCloud::V1::ListAttachedClustersResponse#next_page_token nextPageToken}
672
+ # to determine if there are more instances left to be queried.
673
+ # @param page_token [::String]
674
+ # The `nextPageToken` value returned from a previous
675
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client#list_attached_clusters attachedClusters.list}
676
+ # request, if any.
677
+ #
678
+ # @yield [response, operation] Access the result along with the RPC operation
679
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AttachedCluster>]
680
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
681
+ #
682
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AttachedCluster>]
683
+ #
684
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
685
+ #
686
+ # @example Basic example
687
+ # require "google/cloud/gke_multi_cloud/v1"
688
+ #
689
+ # # Create a client object. The client can be reused for multiple calls.
690
+ # client = Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new
691
+ #
692
+ # # Create a request. To set request fields, pass in keyword arguments.
693
+ # request = Google::Cloud::GkeMultiCloud::V1::ListAttachedClustersRequest.new
694
+ #
695
+ # # Call the list_attached_clusters method.
696
+ # result = client.list_attached_clusters request
697
+ #
698
+ # # The returned object is of type Gapic::PagedEnumerable. You can
699
+ # # iterate over all elements by calling #each, and the enumerable
700
+ # # will lazily make API calls to fetch subsequent pages. Other
701
+ # # methods are also available for managing paging directly.
702
+ # result.each do |response|
703
+ # # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AttachedCluster.
704
+ # p response
705
+ # end
706
+ #
707
+ def list_attached_clusters request, options = nil
708
+ raise ::ArgumentError, "request must be provided" if request.nil?
709
+
710
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::ListAttachedClustersRequest
711
+
712
+ # Converts hash and nil to an options object
713
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
714
+
715
+ # Customize the options with defaults
716
+ metadata = @config.rpcs.list_attached_clusters.metadata.to_h
717
+
718
+ # Set x-goog-api-client and x-goog-user-project headers
719
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
720
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
721
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
722
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
723
+
724
+ header_params = {}
725
+ if request.parent
726
+ header_params["parent"] = request.parent
727
+ end
728
+
729
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
730
+ metadata[:"x-goog-request-params"] ||= request_params_header
731
+
732
+ options.apply_defaults timeout: @config.rpcs.list_attached_clusters.timeout,
733
+ metadata: metadata,
734
+ retry_policy: @config.rpcs.list_attached_clusters.retry_policy
735
+
736
+ options.apply_defaults timeout: @config.timeout,
737
+ metadata: @config.metadata,
738
+ retry_policy: @config.retry_policy
739
+
740
+ @attached_clusters_stub.call_rpc :list_attached_clusters, request, options: options do |response, operation|
741
+ response = ::Gapic::PagedEnumerable.new @attached_clusters_stub, :list_attached_clusters, request, response, operation, options
742
+ yield response, operation if block_given?
743
+ return response
744
+ end
745
+ rescue ::GRPC::BadStatus => e
746
+ raise ::Google::Cloud::Error.from_error(e)
747
+ end
748
+
749
+ ##
750
+ # Deletes a specific
751
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} resource.
752
+ #
753
+ # If successful, the response contains a newly created
754
+ # {::Google::Longrunning::Operation Operation} resource that can be
755
+ # described to track the status of the operation.
756
+ #
757
+ # @overload delete_attached_cluster(request, options = nil)
758
+ # Pass arguments to `delete_attached_cluster` via a request object, either of type
759
+ # {::Google::Cloud::GkeMultiCloud::V1::DeleteAttachedClusterRequest} or an equivalent Hash.
760
+ #
761
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::DeleteAttachedClusterRequest, ::Hash]
762
+ # A request object representing the call parameters. Required. To specify no
763
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
764
+ # @param options [::Gapic::CallOptions, ::Hash]
765
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
766
+ #
767
+ # @overload delete_attached_cluster(name: nil, validate_only: nil, allow_missing: nil, ignore_errors: nil, etag: nil)
768
+ # Pass arguments to `delete_attached_cluster` via keyword arguments. Note that at
769
+ # least one keyword argument is required. To specify no parameters, or to keep all
770
+ # the default parameter values, pass an empty Hash as a request object (see above).
771
+ #
772
+ # @param name [::String]
773
+ # Required. The resource name the
774
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} to delete.
775
+ #
776
+ # `AttachedCluster` names are formatted as
777
+ # `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
778
+ #
779
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
780
+ # for more details on GCP resource names.
781
+ # @param validate_only [::Boolean]
782
+ # If set, only validate the request, but do not actually delete the resource.
783
+ # @param allow_missing [::Boolean]
784
+ # If set to true, and the
785
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} resource
786
+ # is not found, the request will succeed but no action will be taken on the
787
+ # server and a completed {::Google::Longrunning::Operation Operation} will be
788
+ # returned.
789
+ #
790
+ # Useful for idempotent deletion.
791
+ # @param ignore_errors [::Boolean]
792
+ # If set to true, the deletion of
793
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} resource
794
+ # will succeed even if errors occur during deleting in cluster resources.
795
+ # Using this parameter may result in orphaned resources in the cluster.
796
+ # @param etag [::String]
797
+ # The current etag of the
798
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster}.
799
+ #
800
+ # Allows clients to perform deletions through optimistic concurrency control.
801
+ #
802
+ # If the provided etag does not match the current etag of the cluster,
803
+ # the request will fail and an ABORTED error will be returned.
804
+ #
805
+ # @yield [response, operation] Access the result along with the RPC operation
806
+ # @yieldparam response [::Gapic::Operation]
807
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
808
+ #
809
+ # @return [::Gapic::Operation]
810
+ #
811
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
812
+ #
813
+ # @example Basic example
814
+ # require "google/cloud/gke_multi_cloud/v1"
815
+ #
816
+ # # Create a client object. The client can be reused for multiple calls.
817
+ # client = Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new
818
+ #
819
+ # # Create a request. To set request fields, pass in keyword arguments.
820
+ # request = Google::Cloud::GkeMultiCloud::V1::DeleteAttachedClusterRequest.new
821
+ #
822
+ # # Call the delete_attached_cluster method.
823
+ # result = client.delete_attached_cluster request
824
+ #
825
+ # # The returned object is of type Gapic::Operation. You can use this
826
+ # # object to check the status of an operation, cancel it, or wait
827
+ # # for results. Here is how to block until completion:
828
+ # result.wait_until_done! timeout: 60
829
+ # if result.response?
830
+ # p result.response
831
+ # else
832
+ # puts "Error!"
833
+ # end
834
+ #
835
+ def delete_attached_cluster request, options = nil
836
+ raise ::ArgumentError, "request must be provided" if request.nil?
837
+
838
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::DeleteAttachedClusterRequest
839
+
840
+ # Converts hash and nil to an options object
841
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
842
+
843
+ # Customize the options with defaults
844
+ metadata = @config.rpcs.delete_attached_cluster.metadata.to_h
845
+
846
+ # Set x-goog-api-client and x-goog-user-project headers
847
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
848
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
849
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
850
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
851
+
852
+ header_params = {}
853
+ if request.name
854
+ header_params["name"] = request.name
855
+ end
856
+
857
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
858
+ metadata[:"x-goog-request-params"] ||= request_params_header
859
+
860
+ options.apply_defaults timeout: @config.rpcs.delete_attached_cluster.timeout,
861
+ metadata: metadata,
862
+ retry_policy: @config.rpcs.delete_attached_cluster.retry_policy
863
+
864
+ options.apply_defaults timeout: @config.timeout,
865
+ metadata: @config.metadata,
866
+ retry_policy: @config.retry_policy
867
+
868
+ @attached_clusters_stub.call_rpc :delete_attached_cluster, request, options: options do |response, operation|
869
+ response = ::Gapic::Operation.new response, @operations_client, options: options
870
+ yield response, operation if block_given?
871
+ return response
872
+ end
873
+ rescue ::GRPC::BadStatus => e
874
+ raise ::Google::Cloud::Error.from_error(e)
875
+ end
876
+
877
+ ##
878
+ # Returns information, such as supported Kubernetes versions, on a given
879
+ # Google Cloud location.
880
+ #
881
+ # @overload get_attached_server_config(request, options = nil)
882
+ # Pass arguments to `get_attached_server_config` via a request object, either of type
883
+ # {::Google::Cloud::GkeMultiCloud::V1::GetAttachedServerConfigRequest} or an equivalent Hash.
884
+ #
885
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::GetAttachedServerConfigRequest, ::Hash]
886
+ # A request object representing the call parameters. Required. To specify no
887
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
888
+ # @param options [::Gapic::CallOptions, ::Hash]
889
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
890
+ #
891
+ # @overload get_attached_server_config(name: nil)
892
+ # Pass arguments to `get_attached_server_config` via keyword arguments. Note that at
893
+ # least one keyword argument is required. To specify no parameters, or to keep all
894
+ # the default parameter values, pass an empty Hash as a request object (see above).
895
+ #
896
+ # @param name [::String]
897
+ # Required. The name of the
898
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedServerConfig AttachedServerConfig}
899
+ # resource to describe.
900
+ #
901
+ # `AttachedServerConfig` names are formatted as
902
+ # `projects/<project-id>/locations/<region>/attachedServerConfig`.
903
+ #
904
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
905
+ # for more details on Google Cloud resource names.
906
+ #
907
+ # @yield [response, operation] Access the result along with the RPC operation
908
+ # @yieldparam response [::Google::Cloud::GkeMultiCloud::V1::AttachedServerConfig]
909
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
910
+ #
911
+ # @return [::Google::Cloud::GkeMultiCloud::V1::AttachedServerConfig]
912
+ #
913
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
914
+ #
915
+ # @example Basic example
916
+ # require "google/cloud/gke_multi_cloud/v1"
917
+ #
918
+ # # Create a client object. The client can be reused for multiple calls.
919
+ # client = Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new
920
+ #
921
+ # # Create a request. To set request fields, pass in keyword arguments.
922
+ # request = Google::Cloud::GkeMultiCloud::V1::GetAttachedServerConfigRequest.new
923
+ #
924
+ # # Call the get_attached_server_config method.
925
+ # result = client.get_attached_server_config request
926
+ #
927
+ # # The returned object is of type Google::Cloud::GkeMultiCloud::V1::AttachedServerConfig.
928
+ # p result
929
+ #
930
+ def get_attached_server_config request, options = nil
931
+ raise ::ArgumentError, "request must be provided" if request.nil?
932
+
933
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::GetAttachedServerConfigRequest
934
+
935
+ # Converts hash and nil to an options object
936
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
937
+
938
+ # Customize the options with defaults
939
+ metadata = @config.rpcs.get_attached_server_config.metadata.to_h
940
+
941
+ # Set x-goog-api-client and x-goog-user-project headers
942
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
943
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
944
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
945
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
946
+
947
+ header_params = {}
948
+ if request.name
949
+ header_params["name"] = request.name
950
+ end
951
+
952
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
953
+ metadata[:"x-goog-request-params"] ||= request_params_header
954
+
955
+ options.apply_defaults timeout: @config.rpcs.get_attached_server_config.timeout,
956
+ metadata: metadata,
957
+ retry_policy: @config.rpcs.get_attached_server_config.retry_policy
958
+
959
+ options.apply_defaults timeout: @config.timeout,
960
+ metadata: @config.metadata,
961
+ retry_policy: @config.retry_policy
962
+
963
+ @attached_clusters_stub.call_rpc :get_attached_server_config, request, options: options do |response, operation|
964
+ yield response, operation if block_given?
965
+ return response
966
+ end
967
+ rescue ::GRPC::BadStatus => e
968
+ raise ::Google::Cloud::Error.from_error(e)
969
+ end
970
+
971
+ ##
972
+ # Generates the install manifest to be installed on the target cluster.
973
+ #
974
+ # @overload generate_attached_cluster_install_manifest(request, options = nil)
975
+ # Pass arguments to `generate_attached_cluster_install_manifest` via a request object, either of type
976
+ # {::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestRequest} or an equivalent Hash.
977
+ #
978
+ # @param request [::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestRequest, ::Hash]
979
+ # A request object representing the call parameters. Required. To specify no
980
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
981
+ # @param options [::Gapic::CallOptions, ::Hash]
982
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
983
+ #
984
+ # @overload generate_attached_cluster_install_manifest(parent: nil, attached_cluster_id: nil, platform_version: nil)
985
+ # Pass arguments to `generate_attached_cluster_install_manifest` via keyword arguments. Note that at
986
+ # least one keyword argument is required. To specify no parameters, or to keep all
987
+ # the default parameter values, pass an empty Hash as a request object (see above).
988
+ #
989
+ # @param parent [::String]
990
+ # Required. The parent location where this
991
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} resource
992
+ # will be created.
993
+ #
994
+ # Location names are formatted as `projects/<project-id>/locations/<region>`.
995
+ #
996
+ # See [Resource Names](https://cloud.google.com/apis/design/resource_names)
997
+ # for more details on Google Cloud resource names.
998
+ # @param attached_cluster_id [::String]
999
+ # Required. A client provided ID the resource. Must be unique within the
1000
+ # parent resource.
1001
+ #
1002
+ # The provided ID will be part of the
1003
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster} resource
1004
+ # name formatted as
1005
+ # `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
1006
+ #
1007
+ # Valid characters are `/[a-z][0-9]-/`. Cannot be longer than 63 characters.
1008
+ #
1009
+ # When generating an install manifest for importing an existing Membership
1010
+ # resource, the attached_cluster_id field must be the Membership id.
1011
+ #
1012
+ # Membership names are formatted as `resource name formatted as
1013
+ # `projects/<project-id>/locations/<region>/memberships/<membership-id>`.
1014
+ # @param platform_version [::String]
1015
+ # Required. The platform version for the cluster (e.g. `1.19.0-gke.1000`).
1016
+ #
1017
+ # You can list all supported versions on a given Google Cloud region by
1018
+ # calling
1019
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client#get_attached_server_config GetAttachedServerConfig}.
1020
+ #
1021
+ # @yield [response, operation] Access the result along with the RPC operation
1022
+ # @yieldparam response [::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestResponse]
1023
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1024
+ #
1025
+ # @return [::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestResponse]
1026
+ #
1027
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1028
+ #
1029
+ # @example Basic example
1030
+ # require "google/cloud/gke_multi_cloud/v1"
1031
+ #
1032
+ # # Create a client object. The client can be reused for multiple calls.
1033
+ # client = Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new
1034
+ #
1035
+ # # Create a request. To set request fields, pass in keyword arguments.
1036
+ # request = Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestRequest.new
1037
+ #
1038
+ # # Call the generate_attached_cluster_install_manifest method.
1039
+ # result = client.generate_attached_cluster_install_manifest request
1040
+ #
1041
+ # # The returned object is of type Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestResponse.
1042
+ # p result
1043
+ #
1044
+ def generate_attached_cluster_install_manifest request, options = nil
1045
+ raise ::ArgumentError, "request must be provided" if request.nil?
1046
+
1047
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestRequest
1048
+
1049
+ # Converts hash and nil to an options object
1050
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1051
+
1052
+ # Customize the options with defaults
1053
+ metadata = @config.rpcs.generate_attached_cluster_install_manifest.metadata.to_h
1054
+
1055
+ # Set x-goog-api-client and x-goog-user-project headers
1056
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1057
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1058
+ gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
1059
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1060
+
1061
+ header_params = {}
1062
+ if request.parent
1063
+ header_params["parent"] = request.parent
1064
+ end
1065
+
1066
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1067
+ metadata[:"x-goog-request-params"] ||= request_params_header
1068
+
1069
+ options.apply_defaults timeout: @config.rpcs.generate_attached_cluster_install_manifest.timeout,
1070
+ metadata: metadata,
1071
+ retry_policy: @config.rpcs.generate_attached_cluster_install_manifest.retry_policy
1072
+
1073
+ options.apply_defaults timeout: @config.timeout,
1074
+ metadata: @config.metadata,
1075
+ retry_policy: @config.retry_policy
1076
+
1077
+ @attached_clusters_stub.call_rpc :generate_attached_cluster_install_manifest, request, options: options do |response, operation|
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
+ # Configuration class for the AttachedClusters API.
1087
+ #
1088
+ # This class represents the configuration for AttachedClusters,
1089
+ # providing control over timeouts, retry behavior, logging, transport
1090
+ # parameters, and other low-level controls. Certain parameters can also be
1091
+ # applied individually to specific RPCs. See
1092
+ # {::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client::Configuration::Rpcs}
1093
+ # for a list of RPCs that can be configured independently.
1094
+ #
1095
+ # Configuration can be applied globally to all clients, or to a single client
1096
+ # on construction.
1097
+ #
1098
+ # @example
1099
+ #
1100
+ # # Modify the global config, setting the timeout for
1101
+ # # create_attached_cluster to 20 seconds,
1102
+ # # and all remaining timeouts to 10 seconds.
1103
+ # ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.configure do |config|
1104
+ # config.timeout = 10.0
1105
+ # config.rpcs.create_attached_cluster.timeout = 20.0
1106
+ # end
1107
+ #
1108
+ # # Apply the above configuration only to a new client.
1109
+ # client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new do |config|
1110
+ # config.timeout = 10.0
1111
+ # config.rpcs.create_attached_cluster.timeout = 20.0
1112
+ # end
1113
+ #
1114
+ # @!attribute [rw] endpoint
1115
+ # The hostname or hostname:port of the service endpoint.
1116
+ # Defaults to `"gkemulticloud.googleapis.com"`.
1117
+ # @return [::String]
1118
+ # @!attribute [rw] credentials
1119
+ # Credentials to send with calls. You may provide any of the following types:
1120
+ # * (`String`) The path to a service account key file in JSON format
1121
+ # * (`Hash`) A service account key as a Hash
1122
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1123
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1124
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1125
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1126
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1127
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1128
+ # * (`nil`) indicating no credentials
1129
+ # @return [::Object]
1130
+ # @!attribute [rw] scope
1131
+ # The OAuth scopes
1132
+ # @return [::Array<::String>]
1133
+ # @!attribute [rw] lib_name
1134
+ # The library name as recorded in instrumentation and logging
1135
+ # @return [::String]
1136
+ # @!attribute [rw] lib_version
1137
+ # The library version as recorded in instrumentation and logging
1138
+ # @return [::String]
1139
+ # @!attribute [rw] channel_args
1140
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1141
+ # `GRPC::Core::Channel` object is provided as the credential.
1142
+ # @return [::Hash]
1143
+ # @!attribute [rw] interceptors
1144
+ # An array of interceptors that are run before calls are executed.
1145
+ # @return [::Array<::GRPC::ClientInterceptor>]
1146
+ # @!attribute [rw] timeout
1147
+ # The call timeout in seconds.
1148
+ # @return [::Numeric]
1149
+ # @!attribute [rw] metadata
1150
+ # Additional gRPC headers to be sent with the call.
1151
+ # @return [::Hash{::Symbol=>::String}]
1152
+ # @!attribute [rw] retry_policy
1153
+ # The retry policy. The value is a hash with the following keys:
1154
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1155
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1156
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1157
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1158
+ # trigger a retry.
1159
+ # @return [::Hash]
1160
+ # @!attribute [rw] quota_project
1161
+ # A separate project against which to charge quota.
1162
+ # @return [::String]
1163
+ #
1164
+ class Configuration
1165
+ extend ::Gapic::Config
1166
+
1167
+ config_attr :endpoint, "gkemulticloud.googleapis.com", ::String
1168
+ config_attr :credentials, nil do |value|
1169
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1170
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1171
+ allowed.any? { |klass| klass === value }
1172
+ end
1173
+ config_attr :scope, nil, ::String, ::Array, nil
1174
+ config_attr :lib_name, nil, ::String, nil
1175
+ config_attr :lib_version, nil, ::String, nil
1176
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1177
+ config_attr :interceptors, nil, ::Array, nil
1178
+ config_attr :timeout, nil, ::Numeric, nil
1179
+ config_attr :metadata, nil, ::Hash, nil
1180
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1181
+ config_attr :quota_project, nil, ::String, nil
1182
+
1183
+ # @private
1184
+ def initialize parent_config = nil
1185
+ @parent_config = parent_config unless parent_config.nil?
1186
+
1187
+ yield self if block_given?
1188
+ end
1189
+
1190
+ ##
1191
+ # Configurations for individual RPCs
1192
+ # @return [Rpcs]
1193
+ #
1194
+ def rpcs
1195
+ @rpcs ||= begin
1196
+ parent_rpcs = nil
1197
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1198
+ Rpcs.new parent_rpcs
1199
+ end
1200
+ end
1201
+
1202
+ ##
1203
+ # Configuration RPC class for the AttachedClusters API.
1204
+ #
1205
+ # Includes fields providing the configuration for each RPC in this service.
1206
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1207
+ # the following configuration fields:
1208
+ #
1209
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1210
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1211
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1212
+ # include the following keys:
1213
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1214
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1215
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1216
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1217
+ # trigger a retry.
1218
+ #
1219
+ class Rpcs
1220
+ ##
1221
+ # RPC-specific configuration for `create_attached_cluster`
1222
+ # @return [::Gapic::Config::Method]
1223
+ #
1224
+ attr_reader :create_attached_cluster
1225
+ ##
1226
+ # RPC-specific configuration for `update_attached_cluster`
1227
+ # @return [::Gapic::Config::Method]
1228
+ #
1229
+ attr_reader :update_attached_cluster
1230
+ ##
1231
+ # RPC-specific configuration for `import_attached_cluster`
1232
+ # @return [::Gapic::Config::Method]
1233
+ #
1234
+ attr_reader :import_attached_cluster
1235
+ ##
1236
+ # RPC-specific configuration for `get_attached_cluster`
1237
+ # @return [::Gapic::Config::Method]
1238
+ #
1239
+ attr_reader :get_attached_cluster
1240
+ ##
1241
+ # RPC-specific configuration for `list_attached_clusters`
1242
+ # @return [::Gapic::Config::Method]
1243
+ #
1244
+ attr_reader :list_attached_clusters
1245
+ ##
1246
+ # RPC-specific configuration for `delete_attached_cluster`
1247
+ # @return [::Gapic::Config::Method]
1248
+ #
1249
+ attr_reader :delete_attached_cluster
1250
+ ##
1251
+ # RPC-specific configuration for `get_attached_server_config`
1252
+ # @return [::Gapic::Config::Method]
1253
+ #
1254
+ attr_reader :get_attached_server_config
1255
+ ##
1256
+ # RPC-specific configuration for `generate_attached_cluster_install_manifest`
1257
+ # @return [::Gapic::Config::Method]
1258
+ #
1259
+ attr_reader :generate_attached_cluster_install_manifest
1260
+
1261
+ # @private
1262
+ def initialize parent_rpcs = nil
1263
+ create_attached_cluster_config = parent_rpcs.create_attached_cluster if parent_rpcs.respond_to? :create_attached_cluster
1264
+ @create_attached_cluster = ::Gapic::Config::Method.new create_attached_cluster_config
1265
+ update_attached_cluster_config = parent_rpcs.update_attached_cluster if parent_rpcs.respond_to? :update_attached_cluster
1266
+ @update_attached_cluster = ::Gapic::Config::Method.new update_attached_cluster_config
1267
+ import_attached_cluster_config = parent_rpcs.import_attached_cluster if parent_rpcs.respond_to? :import_attached_cluster
1268
+ @import_attached_cluster = ::Gapic::Config::Method.new import_attached_cluster_config
1269
+ get_attached_cluster_config = parent_rpcs.get_attached_cluster if parent_rpcs.respond_to? :get_attached_cluster
1270
+ @get_attached_cluster = ::Gapic::Config::Method.new get_attached_cluster_config
1271
+ list_attached_clusters_config = parent_rpcs.list_attached_clusters if parent_rpcs.respond_to? :list_attached_clusters
1272
+ @list_attached_clusters = ::Gapic::Config::Method.new list_attached_clusters_config
1273
+ delete_attached_cluster_config = parent_rpcs.delete_attached_cluster if parent_rpcs.respond_to? :delete_attached_cluster
1274
+ @delete_attached_cluster = ::Gapic::Config::Method.new delete_attached_cluster_config
1275
+ get_attached_server_config_config = parent_rpcs.get_attached_server_config if parent_rpcs.respond_to? :get_attached_server_config
1276
+ @get_attached_server_config = ::Gapic::Config::Method.new get_attached_server_config_config
1277
+ generate_attached_cluster_install_manifest_config = parent_rpcs.generate_attached_cluster_install_manifest if parent_rpcs.respond_to? :generate_attached_cluster_install_manifest
1278
+ @generate_attached_cluster_install_manifest = ::Gapic::Config::Method.new generate_attached_cluster_install_manifest_config
1279
+
1280
+ yield self if block_given?
1281
+ end
1282
+ end
1283
+ end
1284
+ end
1285
+ end
1286
+ end
1287
+ end
1288
+ end
1289
+ end