google-cloud-gke_hub-v1beta1 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +1 -1
- data/lib/google/cloud/gke_hub/v1beta1/bindings_override.rb +135 -0
- data/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/client.rb +17 -19
- data/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/operations.rb +12 -14
- data/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/rest/client.rb +1047 -0
- data/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/rest/operations.rb +793 -0
- data/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/rest/service_stub.rb +522 -0
- data/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/rest.rb +61 -0
- data/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service.rb +7 -1
- data/lib/google/cloud/gke_hub/v1beta1/rest.rb +38 -0
- data/lib/google/cloud/gke_hub/v1beta1/version.rb +1 -1
- data/lib/google/cloud/gke_hub/v1beta1.rb +7 -2
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/protobuf/empty.rb +0 -2
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +19 -14
- data/proto_docs/google/iam/v1/iam_policy.rb +0 -87
- data/proto_docs/google/iam/v1/options.rb +0 -50
- data/proto_docs/google/iam/v1/policy.rb +0 -418
@@ -0,0 +1,1047 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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/gkehub/v1beta1/membership_pb"
|
21
|
+
require "google/cloud/gke_hub/v1beta1/gke_hub_membership_service/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
23
|
+
require "google/iam/v1/rest"
|
24
|
+
|
25
|
+
module Google
|
26
|
+
module Cloud
|
27
|
+
module GkeHub
|
28
|
+
module V1beta1
|
29
|
+
module GkeHubMembershipService
|
30
|
+
module Rest
|
31
|
+
##
|
32
|
+
# REST client for the GkeHubMembershipService service.
|
33
|
+
#
|
34
|
+
# The GKE Hub MembershipService handles the registration of many Kubernetes
|
35
|
+
# clusters to Google Cloud, represented with the {::Google::Cloud::GkeHub::V1beta1::Membership Membership} resource.
|
36
|
+
#
|
37
|
+
# GKE Hub is currently only available in the global region.
|
38
|
+
#
|
39
|
+
# **Membership management may be non-trivial:** it is recommended to use one
|
40
|
+
# of the Google-provided client libraries or tools where possible when working
|
41
|
+
# with Membership resources.
|
42
|
+
#
|
43
|
+
class Client
|
44
|
+
include Paths
|
45
|
+
|
46
|
+
# @private
|
47
|
+
attr_reader :gke_hub_membership_service_stub
|
48
|
+
|
49
|
+
##
|
50
|
+
# Configure the GkeHubMembershipService Client class.
|
51
|
+
#
|
52
|
+
# See {::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Rest::Client::Configuration}
|
53
|
+
# for a description of the configuration fields.
|
54
|
+
#
|
55
|
+
# @example
|
56
|
+
#
|
57
|
+
# # Modify the configuration for all GkeHubMembershipService clients
|
58
|
+
# ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Rest::Client.configure do |config|
|
59
|
+
# config.timeout = 10.0
|
60
|
+
# end
|
61
|
+
#
|
62
|
+
# @yield [config] Configure the Client client.
|
63
|
+
# @yieldparam config [Client::Configuration]
|
64
|
+
#
|
65
|
+
# @return [Client::Configuration]
|
66
|
+
#
|
67
|
+
def self.configure
|
68
|
+
@configure ||= begin
|
69
|
+
namespace = ["Google", "Cloud", "GkeHub", "V1beta1"]
|
70
|
+
parent_config = while namespace.any?
|
71
|
+
parent_name = namespace.join "::"
|
72
|
+
parent_const = const_get parent_name
|
73
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
74
|
+
namespace.pop
|
75
|
+
end
|
76
|
+
default_config = Client::Configuration.new parent_config
|
77
|
+
|
78
|
+
default_config.timeout = 60.0
|
79
|
+
default_config.retry_policy = {
|
80
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
81
|
+
}
|
82
|
+
|
83
|
+
default_config
|
84
|
+
end
|
85
|
+
yield @configure if block_given?
|
86
|
+
@configure
|
87
|
+
end
|
88
|
+
|
89
|
+
##
|
90
|
+
# Configure the GkeHubMembershipService Client instance.
|
91
|
+
#
|
92
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
93
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
94
|
+
# should be made on {Client.configure}.
|
95
|
+
#
|
96
|
+
# See {::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Rest::Client::Configuration}
|
97
|
+
# for a description of the configuration fields.
|
98
|
+
#
|
99
|
+
# @yield [config] Configure the Client client.
|
100
|
+
# @yieldparam config [Client::Configuration]
|
101
|
+
#
|
102
|
+
# @return [Client::Configuration]
|
103
|
+
#
|
104
|
+
def configure
|
105
|
+
yield @config if block_given?
|
106
|
+
@config
|
107
|
+
end
|
108
|
+
|
109
|
+
##
|
110
|
+
# Create a new GkeHubMembershipService REST client object.
|
111
|
+
#
|
112
|
+
# @example
|
113
|
+
#
|
114
|
+
# # Create a client using the default configuration
|
115
|
+
# client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Rest::Client.new
|
116
|
+
#
|
117
|
+
# # Create a client using a custom configuration
|
118
|
+
# client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Rest::Client.new do |config|
|
119
|
+
# config.timeout = 10.0
|
120
|
+
# end
|
121
|
+
#
|
122
|
+
# @yield [config] Configure the GkeHubMembershipService client.
|
123
|
+
# @yieldparam config [Client::Configuration]
|
124
|
+
#
|
125
|
+
def initialize
|
126
|
+
# Create the configuration object
|
127
|
+
@config = Configuration.new Client.configure
|
128
|
+
|
129
|
+
# Yield the configuration if needed
|
130
|
+
yield @config if block_given?
|
131
|
+
|
132
|
+
# Create credentials
|
133
|
+
credentials = @config.credentials
|
134
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
135
|
+
# but only if the default endpoint does not have a region prefix.
|
136
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
137
|
+
!@config.endpoint.split(".").first.include?("-")
|
138
|
+
credentials ||= Credentials.default scope: @config.scope,
|
139
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
140
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
141
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
142
|
+
end
|
143
|
+
|
144
|
+
@quota_project_id = @config.quota_project
|
145
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
146
|
+
|
147
|
+
@operations_client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Rest::Operations.new do |config|
|
148
|
+
config.credentials = credentials
|
149
|
+
config.quota_project = @quota_project_id
|
150
|
+
config.endpoint = @config.endpoint
|
151
|
+
end
|
152
|
+
|
153
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
154
|
+
config.credentials = credentials
|
155
|
+
config.quota_project = @quota_project_id
|
156
|
+
config.endpoint = @config.endpoint
|
157
|
+
config.bindings_override = @config.bindings_override
|
158
|
+
end
|
159
|
+
|
160
|
+
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
161
|
+
config.credentials = credentials
|
162
|
+
config.quota_project = @quota_project_id
|
163
|
+
config.endpoint = @config.endpoint
|
164
|
+
config.bindings_override = @config.bindings_override
|
165
|
+
end
|
166
|
+
|
167
|
+
@gke_hub_membership_service_stub = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
168
|
+
end
|
169
|
+
|
170
|
+
##
|
171
|
+
# Get the associated client for long-running operations.
|
172
|
+
#
|
173
|
+
# @return [::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Rest::Operations]
|
174
|
+
#
|
175
|
+
attr_reader :operations_client
|
176
|
+
|
177
|
+
##
|
178
|
+
# Get the associated client for mix-in of the Locations.
|
179
|
+
#
|
180
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
181
|
+
#
|
182
|
+
attr_reader :location_client
|
183
|
+
|
184
|
+
##
|
185
|
+
# Get the associated client for mix-in of the IAMPolicy.
|
186
|
+
#
|
187
|
+
# @return [Google::Iam::V1::IAMPolicy::Rest::Client]
|
188
|
+
#
|
189
|
+
attr_reader :iam_policy_client
|
190
|
+
|
191
|
+
# Service calls
|
192
|
+
|
193
|
+
##
|
194
|
+
# Lists Memberships in a given project and location.
|
195
|
+
#
|
196
|
+
# @overload list_memberships(request, options = nil)
|
197
|
+
# Pass arguments to `list_memberships` via a request object, either of type
|
198
|
+
# {::Google::Cloud::GkeHub::V1beta1::ListMembershipsRequest} or an equivalent Hash.
|
199
|
+
#
|
200
|
+
# @param request [::Google::Cloud::GkeHub::V1beta1::ListMembershipsRequest, ::Hash]
|
201
|
+
# A request object representing the call parameters. Required. To specify no
|
202
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
203
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
204
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
205
|
+
#
|
206
|
+
# @overload list_memberships(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
207
|
+
# Pass arguments to `list_memberships` via keyword arguments. Note that at
|
208
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
209
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
210
|
+
#
|
211
|
+
# @param parent [::String]
|
212
|
+
# Required. The parent (project and location) where the Memberships will be listed.
|
213
|
+
# Specified in the format `projects/*/locations/*`.
|
214
|
+
# @param page_size [::Integer]
|
215
|
+
# Optional. When requesting a 'page' of resources, `page_size` specifies number of
|
216
|
+
# resources to return. If unspecified or set to 0, all resources will
|
217
|
+
# be returned.
|
218
|
+
# @param page_token [::String]
|
219
|
+
# Optional. Token returned by previous call to `ListMemberships` which
|
220
|
+
# specifies the position in the list from where to continue listing the
|
221
|
+
# resources.
|
222
|
+
# @param filter [::String]
|
223
|
+
# Optional. Lists Memberships that match the filter expression, following the syntax
|
224
|
+
# outlined in https://google.aip.dev/160.
|
225
|
+
#
|
226
|
+
# Examples:
|
227
|
+
#
|
228
|
+
# - Name is `bar` in project `foo-proj` and location `global`:
|
229
|
+
#
|
230
|
+
# name = "projects/foo-proj/locations/global/membership/bar"
|
231
|
+
#
|
232
|
+
# - Memberships that have a label called `foo`:
|
233
|
+
#
|
234
|
+
# labels.foo:*
|
235
|
+
#
|
236
|
+
# - Memberships that have a label called `foo` whose value is `bar`:
|
237
|
+
#
|
238
|
+
# labels.foo = bar
|
239
|
+
#
|
240
|
+
# - Memberships in the CREATING state:
|
241
|
+
#
|
242
|
+
# state = CREATING
|
243
|
+
# @param order_by [::String]
|
244
|
+
# Optional. One or more fields to compare and use to sort the output.
|
245
|
+
# See https://google.aip.dev/132#ordering.
|
246
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
247
|
+
# @yieldparam result [::Google::Cloud::GkeHub::V1beta1::ListMembershipsResponse]
|
248
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
249
|
+
#
|
250
|
+
# @return [::Google::Cloud::GkeHub::V1beta1::ListMembershipsResponse]
|
251
|
+
#
|
252
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
253
|
+
def list_memberships request, options = nil
|
254
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
255
|
+
|
256
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::ListMembershipsRequest
|
257
|
+
|
258
|
+
# Converts hash and nil to an options object
|
259
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
260
|
+
|
261
|
+
# Customize the options with defaults
|
262
|
+
call_metadata = @config.rpcs.list_memberships.metadata.to_h
|
263
|
+
|
264
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
265
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
266
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
267
|
+
gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION,
|
268
|
+
transports_version_send: [:rest]
|
269
|
+
|
270
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
271
|
+
|
272
|
+
options.apply_defaults timeout: @config.rpcs.list_memberships.timeout,
|
273
|
+
metadata: call_metadata,
|
274
|
+
retry_policy: @config.rpcs.list_memberships.retry_policy
|
275
|
+
|
276
|
+
options.apply_defaults timeout: @config.timeout,
|
277
|
+
metadata: @config.metadata,
|
278
|
+
retry_policy: @config.retry_policy
|
279
|
+
|
280
|
+
@gke_hub_membership_service_stub.list_memberships request, options do |result, operation|
|
281
|
+
yield result, operation if block_given?
|
282
|
+
return result
|
283
|
+
end
|
284
|
+
rescue ::Gapic::Rest::Error => e
|
285
|
+
raise ::Google::Cloud::Error.from_error(e)
|
286
|
+
end
|
287
|
+
|
288
|
+
##
|
289
|
+
# Gets the details of a Membership.
|
290
|
+
#
|
291
|
+
# @overload get_membership(request, options = nil)
|
292
|
+
# Pass arguments to `get_membership` via a request object, either of type
|
293
|
+
# {::Google::Cloud::GkeHub::V1beta1::GetMembershipRequest} or an equivalent Hash.
|
294
|
+
#
|
295
|
+
# @param request [::Google::Cloud::GkeHub::V1beta1::GetMembershipRequest, ::Hash]
|
296
|
+
# A request object representing the call parameters. Required. To specify no
|
297
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
298
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
299
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
300
|
+
#
|
301
|
+
# @overload get_membership(name: nil)
|
302
|
+
# Pass arguments to `get_membership` via keyword arguments. Note that at
|
303
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
304
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
305
|
+
#
|
306
|
+
# @param name [::String]
|
307
|
+
# Required. The Membership resource name in the format
|
308
|
+
# `projects/*/locations/*/memberships/*`.
|
309
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
310
|
+
# @yieldparam result [::Google::Cloud::GkeHub::V1beta1::Membership]
|
311
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
312
|
+
#
|
313
|
+
# @return [::Google::Cloud::GkeHub::V1beta1::Membership]
|
314
|
+
#
|
315
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
316
|
+
def get_membership request, options = nil
|
317
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
318
|
+
|
319
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::GetMembershipRequest
|
320
|
+
|
321
|
+
# Converts hash and nil to an options object
|
322
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
323
|
+
|
324
|
+
# Customize the options with defaults
|
325
|
+
call_metadata = @config.rpcs.get_membership.metadata.to_h
|
326
|
+
|
327
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
328
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
329
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
330
|
+
gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION,
|
331
|
+
transports_version_send: [:rest]
|
332
|
+
|
333
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
334
|
+
|
335
|
+
options.apply_defaults timeout: @config.rpcs.get_membership.timeout,
|
336
|
+
metadata: call_metadata,
|
337
|
+
retry_policy: @config.rpcs.get_membership.retry_policy
|
338
|
+
|
339
|
+
options.apply_defaults timeout: @config.timeout,
|
340
|
+
metadata: @config.metadata,
|
341
|
+
retry_policy: @config.retry_policy
|
342
|
+
|
343
|
+
@gke_hub_membership_service_stub.get_membership request, options do |result, operation|
|
344
|
+
yield result, operation if block_given?
|
345
|
+
return result
|
346
|
+
end
|
347
|
+
rescue ::Gapic::Rest::Error => e
|
348
|
+
raise ::Google::Cloud::Error.from_error(e)
|
349
|
+
end
|
350
|
+
|
351
|
+
##
|
352
|
+
# Creates a new Membership.
|
353
|
+
#
|
354
|
+
# **This is currently only supported for GKE clusters on Google Cloud**.
|
355
|
+
# To register other clusters, follow the instructions at
|
356
|
+
# https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster.
|
357
|
+
#
|
358
|
+
# @overload create_membership(request, options = nil)
|
359
|
+
# Pass arguments to `create_membership` via a request object, either of type
|
360
|
+
# {::Google::Cloud::GkeHub::V1beta1::CreateMembershipRequest} or an equivalent Hash.
|
361
|
+
#
|
362
|
+
# @param request [::Google::Cloud::GkeHub::V1beta1::CreateMembershipRequest, ::Hash]
|
363
|
+
# A request object representing the call parameters. Required. To specify no
|
364
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
365
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
366
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
367
|
+
#
|
368
|
+
# @overload create_membership(parent: nil, membership_id: nil, resource: nil, request_id: nil)
|
369
|
+
# Pass arguments to `create_membership` via keyword arguments. Note that at
|
370
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
371
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
372
|
+
#
|
373
|
+
# @param parent [::String]
|
374
|
+
# Required. The parent (project and location) where the Memberships will be created.
|
375
|
+
# Specified in the format `projects/*/locations/*`.
|
376
|
+
# @param membership_id [::String]
|
377
|
+
# Required. Client chosen ID for the membership. `membership_id` must be a valid RFC
|
378
|
+
# 1123 compliant DNS label:
|
379
|
+
#
|
380
|
+
# 1. At most 63 characters in length
|
381
|
+
# 2. It must consist of lower case alphanumeric characters or `-`
|
382
|
+
# 3. It must start and end with an alphanumeric character
|
383
|
+
#
|
384
|
+
# Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
|
385
|
+
# with a maximum length of 63 characters.
|
386
|
+
# @param resource [::Google::Cloud::GkeHub::V1beta1::Membership, ::Hash]
|
387
|
+
# Required. The membership to create.
|
388
|
+
# @param request_id [::String]
|
389
|
+
# Optional. A request ID to identify requests. Specify a unique request ID
|
390
|
+
# so that if you must retry your request, the server will know to ignore
|
391
|
+
# the request if it has already been completed. The server will guarantee
|
392
|
+
# that for at least 60 minutes after the first request.
|
393
|
+
#
|
394
|
+
# For example, consider a situation where you make an initial request and
|
395
|
+
# the request times out. If you make the request again with the same request
|
396
|
+
# ID, the server can check if original operation with the same request ID
|
397
|
+
# was received, and if so, will ignore the second request. This prevents
|
398
|
+
# clients from accidentally creating duplicate commitments.
|
399
|
+
#
|
400
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
401
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
402
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
403
|
+
# @yieldparam result [::Gapic::Operation]
|
404
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
405
|
+
#
|
406
|
+
# @return [::Gapic::Operation]
|
407
|
+
#
|
408
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
409
|
+
def create_membership request, options = nil
|
410
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
411
|
+
|
412
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::CreateMembershipRequest
|
413
|
+
|
414
|
+
# Converts hash and nil to an options object
|
415
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
416
|
+
|
417
|
+
# Customize the options with defaults
|
418
|
+
call_metadata = @config.rpcs.create_membership.metadata.to_h
|
419
|
+
|
420
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
421
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
422
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
423
|
+
gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION,
|
424
|
+
transports_version_send: [:rest]
|
425
|
+
|
426
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
427
|
+
|
428
|
+
options.apply_defaults timeout: @config.rpcs.create_membership.timeout,
|
429
|
+
metadata: call_metadata,
|
430
|
+
retry_policy: @config.rpcs.create_membership.retry_policy
|
431
|
+
|
432
|
+
options.apply_defaults timeout: @config.timeout,
|
433
|
+
metadata: @config.metadata,
|
434
|
+
retry_policy: @config.retry_policy
|
435
|
+
|
436
|
+
@gke_hub_membership_service_stub.create_membership request, options do |result, operation|
|
437
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
438
|
+
yield result, operation if block_given?
|
439
|
+
return result
|
440
|
+
end
|
441
|
+
rescue ::Gapic::Rest::Error => e
|
442
|
+
raise ::Google::Cloud::Error.from_error(e)
|
443
|
+
end
|
444
|
+
|
445
|
+
##
|
446
|
+
# Removes a Membership.
|
447
|
+
#
|
448
|
+
# **This is currently only supported for GKE clusters on Google Cloud**.
|
449
|
+
# To unregister other clusters, follow the instructions at
|
450
|
+
# https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster.
|
451
|
+
#
|
452
|
+
# @overload delete_membership(request, options = nil)
|
453
|
+
# Pass arguments to `delete_membership` via a request object, either of type
|
454
|
+
# {::Google::Cloud::GkeHub::V1beta1::DeleteMembershipRequest} or an equivalent Hash.
|
455
|
+
#
|
456
|
+
# @param request [::Google::Cloud::GkeHub::V1beta1::DeleteMembershipRequest, ::Hash]
|
457
|
+
# A request object representing the call parameters. Required. To specify no
|
458
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
459
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
460
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
461
|
+
#
|
462
|
+
# @overload delete_membership(name: nil, request_id: nil)
|
463
|
+
# Pass arguments to `delete_membership` via keyword arguments. Note that at
|
464
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
465
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
466
|
+
#
|
467
|
+
# @param name [::String]
|
468
|
+
# Required. The Membership resource name in the format
|
469
|
+
# `projects/*/locations/*/memberships/*`.
|
470
|
+
# @param request_id [::String]
|
471
|
+
# Optional. A request ID to identify requests. Specify a unique request ID
|
472
|
+
# so that if you must retry your request, the server will know to ignore
|
473
|
+
# the request if it has already been completed. The server will guarantee
|
474
|
+
# that for at least 60 minutes after the first request.
|
475
|
+
#
|
476
|
+
# For example, consider a situation where you make an initial request and
|
477
|
+
# the request times out. If you make the request again with the same request
|
478
|
+
# ID, the server can check if original operation with the same request ID
|
479
|
+
# was received, and if so, will ignore the second request. This prevents
|
480
|
+
# clients from accidentally creating duplicate commitments.
|
481
|
+
#
|
482
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
483
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
484
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
485
|
+
# @yieldparam result [::Gapic::Operation]
|
486
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
487
|
+
#
|
488
|
+
# @return [::Gapic::Operation]
|
489
|
+
#
|
490
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
491
|
+
def delete_membership request, options = nil
|
492
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
493
|
+
|
494
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::DeleteMembershipRequest
|
495
|
+
|
496
|
+
# Converts hash and nil to an options object
|
497
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
498
|
+
|
499
|
+
# Customize the options with defaults
|
500
|
+
call_metadata = @config.rpcs.delete_membership.metadata.to_h
|
501
|
+
|
502
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
503
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
504
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
505
|
+
gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION,
|
506
|
+
transports_version_send: [:rest]
|
507
|
+
|
508
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
509
|
+
|
510
|
+
options.apply_defaults timeout: @config.rpcs.delete_membership.timeout,
|
511
|
+
metadata: call_metadata,
|
512
|
+
retry_policy: @config.rpcs.delete_membership.retry_policy
|
513
|
+
|
514
|
+
options.apply_defaults timeout: @config.timeout,
|
515
|
+
metadata: @config.metadata,
|
516
|
+
retry_policy: @config.retry_policy
|
517
|
+
|
518
|
+
@gke_hub_membership_service_stub.delete_membership request, options do |result, operation|
|
519
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
520
|
+
yield result, operation if block_given?
|
521
|
+
return result
|
522
|
+
end
|
523
|
+
rescue ::Gapic::Rest::Error => e
|
524
|
+
raise ::Google::Cloud::Error.from_error(e)
|
525
|
+
end
|
526
|
+
|
527
|
+
##
|
528
|
+
# Updates an existing Membership.
|
529
|
+
#
|
530
|
+
# @overload update_membership(request, options = nil)
|
531
|
+
# Pass arguments to `update_membership` via a request object, either of type
|
532
|
+
# {::Google::Cloud::GkeHub::V1beta1::UpdateMembershipRequest} or an equivalent Hash.
|
533
|
+
#
|
534
|
+
# @param request [::Google::Cloud::GkeHub::V1beta1::UpdateMembershipRequest, ::Hash]
|
535
|
+
# A request object representing the call parameters. Required. To specify no
|
536
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
537
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
538
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
539
|
+
#
|
540
|
+
# @overload update_membership(name: nil, update_mask: nil, resource: nil, request_id: nil)
|
541
|
+
# Pass arguments to `update_membership` via keyword arguments. Note that at
|
542
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
543
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
544
|
+
#
|
545
|
+
# @param name [::String]
|
546
|
+
# Required. The membership resource name in the format:
|
547
|
+
# `projects/[project_id]/locations/global/memberships/[membership_id]`
|
548
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
549
|
+
# Required. Mask of fields to update. At least one field path must be specified in this
|
550
|
+
# mask.
|
551
|
+
# @param resource [::Google::Cloud::GkeHub::V1beta1::Membership, ::Hash]
|
552
|
+
# Required. Only fields specified in update_mask are updated.
|
553
|
+
# If you specify a field in the update_mask but don't specify its value here
|
554
|
+
# that field will be deleted.
|
555
|
+
# If you are updating a map field, set the value of a key to null or empty
|
556
|
+
# string to delete the key from the map. It's not possible to update a key's
|
557
|
+
# value to the empty string.
|
558
|
+
# If you specify the update_mask to be a special path "*", fully replaces all
|
559
|
+
# user-modifiable fields to match `resource`.
|
560
|
+
# @param request_id [::String]
|
561
|
+
# Optional. A request ID to identify requests. Specify a unique request ID
|
562
|
+
# so that if you must retry your request, the server will know to ignore
|
563
|
+
# the request if it has already been completed. The server will guarantee
|
564
|
+
# that for at least 60 minutes after the first request.
|
565
|
+
#
|
566
|
+
# For example, consider a situation where you make an initial request and
|
567
|
+
# the request times out. If you make the request again with the same request
|
568
|
+
# ID, the server can check if original operation with the same request ID
|
569
|
+
# was received, and if so, will ignore the second request. This prevents
|
570
|
+
# clients from accidentally creating duplicate commitments.
|
571
|
+
#
|
572
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
573
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
574
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
575
|
+
# @yieldparam result [::Gapic::Operation]
|
576
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
577
|
+
#
|
578
|
+
# @return [::Gapic::Operation]
|
579
|
+
#
|
580
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
581
|
+
def update_membership request, options = nil
|
582
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
583
|
+
|
584
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::UpdateMembershipRequest
|
585
|
+
|
586
|
+
# Converts hash and nil to an options object
|
587
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
588
|
+
|
589
|
+
# Customize the options with defaults
|
590
|
+
call_metadata = @config.rpcs.update_membership.metadata.to_h
|
591
|
+
|
592
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
593
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
594
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
595
|
+
gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION,
|
596
|
+
transports_version_send: [:rest]
|
597
|
+
|
598
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
599
|
+
|
600
|
+
options.apply_defaults timeout: @config.rpcs.update_membership.timeout,
|
601
|
+
metadata: call_metadata,
|
602
|
+
retry_policy: @config.rpcs.update_membership.retry_policy
|
603
|
+
|
604
|
+
options.apply_defaults timeout: @config.timeout,
|
605
|
+
metadata: @config.metadata,
|
606
|
+
retry_policy: @config.retry_policy
|
607
|
+
|
608
|
+
@gke_hub_membership_service_stub.update_membership request, options do |result, operation|
|
609
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
610
|
+
yield result, operation if block_given?
|
611
|
+
return result
|
612
|
+
end
|
613
|
+
rescue ::Gapic::Rest::Error => e
|
614
|
+
raise ::Google::Cloud::Error.from_error(e)
|
615
|
+
end
|
616
|
+
|
617
|
+
##
|
618
|
+
# Generates the manifest for deployment of the GKE connect agent.
|
619
|
+
#
|
620
|
+
# **This method is used internally by Google-provided libraries.**
|
621
|
+
# Most clients should not need to call this method directly.
|
622
|
+
#
|
623
|
+
# @overload generate_connect_manifest(request, options = nil)
|
624
|
+
# Pass arguments to `generate_connect_manifest` via a request object, either of type
|
625
|
+
# {::Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestRequest} or an equivalent Hash.
|
626
|
+
#
|
627
|
+
# @param request [::Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestRequest, ::Hash]
|
628
|
+
# A request object representing the call parameters. Required. To specify no
|
629
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
630
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
631
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
632
|
+
#
|
633
|
+
# @overload generate_connect_manifest(name: nil, connect_agent: nil, version: nil, is_upgrade: nil, registry: nil, image_pull_secret_content: nil)
|
634
|
+
# Pass arguments to `generate_connect_manifest` via keyword arguments. Note that at
|
635
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
636
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
637
|
+
#
|
638
|
+
# @param name [::String]
|
639
|
+
# Required. The Membership resource name the Agent will associate with, in the format
|
640
|
+
# `projects/*/locations/*/memberships/*`.
|
641
|
+
# @param connect_agent [::Google::Cloud::GkeHub::V1beta1::ConnectAgent, ::Hash]
|
642
|
+
# Optional. The connect agent to generate manifest for.
|
643
|
+
# @param version [::String]
|
644
|
+
# Optional. The Connect agent version to use. Defaults to the most current version.
|
645
|
+
# @param is_upgrade [::Boolean]
|
646
|
+
# Optional. If true, generate the resources for upgrade only. Some resources
|
647
|
+
# generated only for installation (e.g. secrets) will be excluded.
|
648
|
+
# @param registry [::String]
|
649
|
+
# Optional. The registry to fetch the connect agent image from. Defaults to
|
650
|
+
# gcr.io/gkeconnect.
|
651
|
+
# @param image_pull_secret_content [::String]
|
652
|
+
# Optional. The image pull secret content for the registry, if not public.
|
653
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
654
|
+
# @yieldparam result [::Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestResponse]
|
655
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
656
|
+
#
|
657
|
+
# @return [::Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestResponse]
|
658
|
+
#
|
659
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
660
|
+
def generate_connect_manifest request, options = nil
|
661
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
662
|
+
|
663
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestRequest
|
664
|
+
|
665
|
+
# Converts hash and nil to an options object
|
666
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
667
|
+
|
668
|
+
# Customize the options with defaults
|
669
|
+
call_metadata = @config.rpcs.generate_connect_manifest.metadata.to_h
|
670
|
+
|
671
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
672
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
673
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
674
|
+
gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION,
|
675
|
+
transports_version_send: [:rest]
|
676
|
+
|
677
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
678
|
+
|
679
|
+
options.apply_defaults timeout: @config.rpcs.generate_connect_manifest.timeout,
|
680
|
+
metadata: call_metadata,
|
681
|
+
retry_policy: @config.rpcs.generate_connect_manifest.retry_policy
|
682
|
+
|
683
|
+
options.apply_defaults timeout: @config.timeout,
|
684
|
+
metadata: @config.metadata,
|
685
|
+
retry_policy: @config.retry_policy
|
686
|
+
|
687
|
+
@gke_hub_membership_service_stub.generate_connect_manifest request, options do |result, operation|
|
688
|
+
yield result, operation if block_given?
|
689
|
+
return result
|
690
|
+
end
|
691
|
+
rescue ::Gapic::Rest::Error => e
|
692
|
+
raise ::Google::Cloud::Error.from_error(e)
|
693
|
+
end
|
694
|
+
|
695
|
+
##
|
696
|
+
# ValidateExclusivity validates the state of exclusivity in the cluster.
|
697
|
+
# The validation does not depend on an existing Hub membership resource.
|
698
|
+
#
|
699
|
+
# @overload validate_exclusivity(request, options = nil)
|
700
|
+
# Pass arguments to `validate_exclusivity` via a request object, either of type
|
701
|
+
# {::Google::Cloud::GkeHub::V1beta1::ValidateExclusivityRequest} or an equivalent Hash.
|
702
|
+
#
|
703
|
+
# @param request [::Google::Cloud::GkeHub::V1beta1::ValidateExclusivityRequest, ::Hash]
|
704
|
+
# A request object representing the call parameters. Required. To specify no
|
705
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
706
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
707
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
708
|
+
#
|
709
|
+
# @overload validate_exclusivity(parent: nil, cr_manifest: nil, intended_membership: nil)
|
710
|
+
# Pass arguments to `validate_exclusivity` via keyword arguments. Note that at
|
711
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
712
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
713
|
+
#
|
714
|
+
# @param parent [::String]
|
715
|
+
# Required. The parent (project and location) where the Memberships will be created.
|
716
|
+
# Specified in the format `projects/*/locations/*`.
|
717
|
+
# @param cr_manifest [::String]
|
718
|
+
# Optional. The YAML of the membership CR in the cluster. Empty if the membership
|
719
|
+
# CR does not exist.
|
720
|
+
# @param intended_membership [::String]
|
721
|
+
# Required. The intended membership name under the `parent`. This method only does
|
722
|
+
# validation in anticipation of a CreateMembership call with the same name.
|
723
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
724
|
+
# @yieldparam result [::Google::Cloud::GkeHub::V1beta1::ValidateExclusivityResponse]
|
725
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
726
|
+
#
|
727
|
+
# @return [::Google::Cloud::GkeHub::V1beta1::ValidateExclusivityResponse]
|
728
|
+
#
|
729
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
730
|
+
def validate_exclusivity request, options = nil
|
731
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
732
|
+
|
733
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::ValidateExclusivityRequest
|
734
|
+
|
735
|
+
# Converts hash and nil to an options object
|
736
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
737
|
+
|
738
|
+
# Customize the options with defaults
|
739
|
+
call_metadata = @config.rpcs.validate_exclusivity.metadata.to_h
|
740
|
+
|
741
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
742
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
743
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
744
|
+
gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION,
|
745
|
+
transports_version_send: [:rest]
|
746
|
+
|
747
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
748
|
+
|
749
|
+
options.apply_defaults timeout: @config.rpcs.validate_exclusivity.timeout,
|
750
|
+
metadata: call_metadata,
|
751
|
+
retry_policy: @config.rpcs.validate_exclusivity.retry_policy
|
752
|
+
|
753
|
+
options.apply_defaults timeout: @config.timeout,
|
754
|
+
metadata: @config.metadata,
|
755
|
+
retry_policy: @config.retry_policy
|
756
|
+
|
757
|
+
@gke_hub_membership_service_stub.validate_exclusivity request, options do |result, operation|
|
758
|
+
yield result, operation if block_given?
|
759
|
+
return result
|
760
|
+
end
|
761
|
+
rescue ::Gapic::Rest::Error => e
|
762
|
+
raise ::Google::Cloud::Error.from_error(e)
|
763
|
+
end
|
764
|
+
|
765
|
+
##
|
766
|
+
# GenerateExclusivityManifest generates the manifests to update the
|
767
|
+
# exclusivity artifacts in the cluster if needed.
|
768
|
+
#
|
769
|
+
# Exclusivity artifacts include the Membership custom resource definition
|
770
|
+
# (CRD) and the singleton Membership custom resource (CR). Combined with
|
771
|
+
# ValidateExclusivity, exclusivity artifacts guarantee that a Kubernetes
|
772
|
+
# cluster is only registered to a single GKE Hub.
|
773
|
+
#
|
774
|
+
# The Membership CRD is versioned, and may require conversion when the GKE
|
775
|
+
# Hub API server begins serving a newer version of the CRD and
|
776
|
+
# corresponding CR. The response will be the converted CRD and CR if there
|
777
|
+
# are any differences between the versions.
|
778
|
+
#
|
779
|
+
# @overload generate_exclusivity_manifest(request, options = nil)
|
780
|
+
# Pass arguments to `generate_exclusivity_manifest` via a request object, either of type
|
781
|
+
# {::Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestRequest} or an equivalent Hash.
|
782
|
+
#
|
783
|
+
# @param request [::Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestRequest, ::Hash]
|
784
|
+
# A request object representing the call parameters. Required. To specify no
|
785
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
786
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
787
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
788
|
+
#
|
789
|
+
# @overload generate_exclusivity_manifest(name: nil, crd_manifest: nil, cr_manifest: nil)
|
790
|
+
# Pass arguments to `generate_exclusivity_manifest` via keyword arguments. Note that at
|
791
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
792
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
793
|
+
#
|
794
|
+
# @param name [::String]
|
795
|
+
# Required. The Membership resource name in the format
|
796
|
+
# `projects/*/locations/*/memberships/*`.
|
797
|
+
# @param crd_manifest [::String]
|
798
|
+
# Optional. The YAML manifest of the membership CRD retrieved by
|
799
|
+
# `kubectl get customresourcedefinitions membership`.
|
800
|
+
# Leave empty if the resource does not exist.
|
801
|
+
# @param cr_manifest [::String]
|
802
|
+
# Optional. The YAML manifest of the membership CR retrieved by
|
803
|
+
# `kubectl get memberships membership`.
|
804
|
+
# Leave empty if the resource does not exist.
|
805
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
806
|
+
# @yieldparam result [::Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestResponse]
|
807
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
808
|
+
#
|
809
|
+
# @return [::Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestResponse]
|
810
|
+
#
|
811
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
812
|
+
def generate_exclusivity_manifest request, options = nil
|
813
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
814
|
+
|
815
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestRequest
|
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
|
+
call_metadata = @config.rpcs.generate_exclusivity_manifest.metadata.to_h
|
822
|
+
|
823
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
824
|
+
call_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::GkeHub::V1beta1::VERSION,
|
827
|
+
transports_version_send: [:rest]
|
828
|
+
|
829
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
830
|
+
|
831
|
+
options.apply_defaults timeout: @config.rpcs.generate_exclusivity_manifest.timeout,
|
832
|
+
metadata: call_metadata,
|
833
|
+
retry_policy: @config.rpcs.generate_exclusivity_manifest.retry_policy
|
834
|
+
|
835
|
+
options.apply_defaults timeout: @config.timeout,
|
836
|
+
metadata: @config.metadata,
|
837
|
+
retry_policy: @config.retry_policy
|
838
|
+
|
839
|
+
@gke_hub_membership_service_stub.generate_exclusivity_manifest request, options do |result, operation|
|
840
|
+
yield result, operation if block_given?
|
841
|
+
return result
|
842
|
+
end
|
843
|
+
rescue ::Gapic::Rest::Error => e
|
844
|
+
raise ::Google::Cloud::Error.from_error(e)
|
845
|
+
end
|
846
|
+
|
847
|
+
##
|
848
|
+
# Configuration class for the GkeHubMembershipService REST API.
|
849
|
+
#
|
850
|
+
# This class represents the configuration for GkeHubMembershipService REST,
|
851
|
+
# providing control over timeouts, retry behavior, logging, transport
|
852
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
853
|
+
# applied individually to specific RPCs. See
|
854
|
+
# {::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Rest::Client::Configuration::Rpcs}
|
855
|
+
# for a list of RPCs that can be configured independently.
|
856
|
+
#
|
857
|
+
# Configuration can be applied globally to all clients, or to a single client
|
858
|
+
# on construction.
|
859
|
+
#
|
860
|
+
# @example
|
861
|
+
#
|
862
|
+
# # Modify the global config, setting the timeout for
|
863
|
+
# # list_memberships to 20 seconds,
|
864
|
+
# # and all remaining timeouts to 10 seconds.
|
865
|
+
# ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Rest::Client.configure do |config|
|
866
|
+
# config.timeout = 10.0
|
867
|
+
# config.rpcs.list_memberships.timeout = 20.0
|
868
|
+
# end
|
869
|
+
#
|
870
|
+
# # Apply the above configuration only to a new client.
|
871
|
+
# client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Rest::Client.new do |config|
|
872
|
+
# config.timeout = 10.0
|
873
|
+
# config.rpcs.list_memberships.timeout = 20.0
|
874
|
+
# end
|
875
|
+
#
|
876
|
+
# @!attribute [rw] endpoint
|
877
|
+
# The hostname or hostname:port of the service endpoint.
|
878
|
+
# Defaults to `"gkehub.googleapis.com"`.
|
879
|
+
# @return [::String]
|
880
|
+
# @!attribute [rw] credentials
|
881
|
+
# Credentials to send with calls. You may provide any of the following types:
|
882
|
+
# * (`String`) The path to a service account key file in JSON format
|
883
|
+
# * (`Hash`) A service account key as a Hash
|
884
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
885
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
886
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
887
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
888
|
+
# * (`nil`) indicating no credentials
|
889
|
+
# @return [::Object]
|
890
|
+
# @!attribute [rw] scope
|
891
|
+
# The OAuth scopes
|
892
|
+
# @return [::Array<::String>]
|
893
|
+
# @!attribute [rw] lib_name
|
894
|
+
# The library name as recorded in instrumentation and logging
|
895
|
+
# @return [::String]
|
896
|
+
# @!attribute [rw] lib_version
|
897
|
+
# The library version as recorded in instrumentation and logging
|
898
|
+
# @return [::String]
|
899
|
+
# @!attribute [rw] timeout
|
900
|
+
# The call timeout in seconds.
|
901
|
+
# @return [::Numeric]
|
902
|
+
# @!attribute [rw] metadata
|
903
|
+
# Additional headers to be sent with the call.
|
904
|
+
# @return [::Hash{::Symbol=>::String}]
|
905
|
+
# @!attribute [rw] retry_policy
|
906
|
+
# The retry policy. The value is a hash with the following keys:
|
907
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
908
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
909
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
910
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
911
|
+
# trigger a retry.
|
912
|
+
# @return [::Hash]
|
913
|
+
# @!attribute [rw] quota_project
|
914
|
+
# A separate project against which to charge quota.
|
915
|
+
# @return [::String]
|
916
|
+
#
|
917
|
+
class Configuration
|
918
|
+
extend ::Gapic::Config
|
919
|
+
|
920
|
+
config_attr :endpoint, "gkehub.googleapis.com", ::String
|
921
|
+
config_attr :credentials, nil do |value|
|
922
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
923
|
+
allowed.any? { |klass| klass === value }
|
924
|
+
end
|
925
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
926
|
+
config_attr :lib_name, nil, ::String, nil
|
927
|
+
config_attr :lib_version, nil, ::String, nil
|
928
|
+
config_attr :timeout, nil, ::Numeric, nil
|
929
|
+
config_attr :metadata, nil, ::Hash, nil
|
930
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
931
|
+
config_attr :quota_project, nil, ::String, nil
|
932
|
+
|
933
|
+
# @private
|
934
|
+
# Overrides for http bindings for the RPCs of this service
|
935
|
+
# are only used when this service is used as mixin, and only
|
936
|
+
# by the host service.
|
937
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
938
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
939
|
+
|
940
|
+
# @private
|
941
|
+
def initialize parent_config = nil
|
942
|
+
@parent_config = parent_config unless parent_config.nil?
|
943
|
+
|
944
|
+
yield self if block_given?
|
945
|
+
end
|
946
|
+
|
947
|
+
##
|
948
|
+
# Configurations for individual RPCs
|
949
|
+
# @return [Rpcs]
|
950
|
+
#
|
951
|
+
def rpcs
|
952
|
+
@rpcs ||= begin
|
953
|
+
parent_rpcs = nil
|
954
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
955
|
+
Rpcs.new parent_rpcs
|
956
|
+
end
|
957
|
+
end
|
958
|
+
|
959
|
+
##
|
960
|
+
# Configuration RPC class for the GkeHubMembershipService API.
|
961
|
+
#
|
962
|
+
# Includes fields providing the configuration for each RPC in this service.
|
963
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
964
|
+
# the following configuration fields:
|
965
|
+
#
|
966
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
967
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
968
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
969
|
+
# include the following keys:
|
970
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
971
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
972
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
973
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
974
|
+
# trigger a retry.
|
975
|
+
#
|
976
|
+
class Rpcs
|
977
|
+
##
|
978
|
+
# RPC-specific configuration for `list_memberships`
|
979
|
+
# @return [::Gapic::Config::Method]
|
980
|
+
#
|
981
|
+
attr_reader :list_memberships
|
982
|
+
##
|
983
|
+
# RPC-specific configuration for `get_membership`
|
984
|
+
# @return [::Gapic::Config::Method]
|
985
|
+
#
|
986
|
+
attr_reader :get_membership
|
987
|
+
##
|
988
|
+
# RPC-specific configuration for `create_membership`
|
989
|
+
# @return [::Gapic::Config::Method]
|
990
|
+
#
|
991
|
+
attr_reader :create_membership
|
992
|
+
##
|
993
|
+
# RPC-specific configuration for `delete_membership`
|
994
|
+
# @return [::Gapic::Config::Method]
|
995
|
+
#
|
996
|
+
attr_reader :delete_membership
|
997
|
+
##
|
998
|
+
# RPC-specific configuration for `update_membership`
|
999
|
+
# @return [::Gapic::Config::Method]
|
1000
|
+
#
|
1001
|
+
attr_reader :update_membership
|
1002
|
+
##
|
1003
|
+
# RPC-specific configuration for `generate_connect_manifest`
|
1004
|
+
# @return [::Gapic::Config::Method]
|
1005
|
+
#
|
1006
|
+
attr_reader :generate_connect_manifest
|
1007
|
+
##
|
1008
|
+
# RPC-specific configuration for `validate_exclusivity`
|
1009
|
+
# @return [::Gapic::Config::Method]
|
1010
|
+
#
|
1011
|
+
attr_reader :validate_exclusivity
|
1012
|
+
##
|
1013
|
+
# RPC-specific configuration for `generate_exclusivity_manifest`
|
1014
|
+
# @return [::Gapic::Config::Method]
|
1015
|
+
#
|
1016
|
+
attr_reader :generate_exclusivity_manifest
|
1017
|
+
|
1018
|
+
# @private
|
1019
|
+
def initialize parent_rpcs = nil
|
1020
|
+
list_memberships_config = parent_rpcs.list_memberships if parent_rpcs.respond_to? :list_memberships
|
1021
|
+
@list_memberships = ::Gapic::Config::Method.new list_memberships_config
|
1022
|
+
get_membership_config = parent_rpcs.get_membership if parent_rpcs.respond_to? :get_membership
|
1023
|
+
@get_membership = ::Gapic::Config::Method.new get_membership_config
|
1024
|
+
create_membership_config = parent_rpcs.create_membership if parent_rpcs.respond_to? :create_membership
|
1025
|
+
@create_membership = ::Gapic::Config::Method.new create_membership_config
|
1026
|
+
delete_membership_config = parent_rpcs.delete_membership if parent_rpcs.respond_to? :delete_membership
|
1027
|
+
@delete_membership = ::Gapic::Config::Method.new delete_membership_config
|
1028
|
+
update_membership_config = parent_rpcs.update_membership if parent_rpcs.respond_to? :update_membership
|
1029
|
+
@update_membership = ::Gapic::Config::Method.new update_membership_config
|
1030
|
+
generate_connect_manifest_config = parent_rpcs.generate_connect_manifest if parent_rpcs.respond_to? :generate_connect_manifest
|
1031
|
+
@generate_connect_manifest = ::Gapic::Config::Method.new generate_connect_manifest_config
|
1032
|
+
validate_exclusivity_config = parent_rpcs.validate_exclusivity if parent_rpcs.respond_to? :validate_exclusivity
|
1033
|
+
@validate_exclusivity = ::Gapic::Config::Method.new validate_exclusivity_config
|
1034
|
+
generate_exclusivity_manifest_config = parent_rpcs.generate_exclusivity_manifest if parent_rpcs.respond_to? :generate_exclusivity_manifest
|
1035
|
+
@generate_exclusivity_manifest = ::Gapic::Config::Method.new generate_exclusivity_manifest_config
|
1036
|
+
|
1037
|
+
yield self if block_given?
|
1038
|
+
end
|
1039
|
+
end
|
1040
|
+
end
|
1041
|
+
end
|
1042
|
+
end
|
1043
|
+
end
|
1044
|
+
end
|
1045
|
+
end
|
1046
|
+
end
|
1047
|
+
end
|