google-apis-gkehub_v1alpha2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,689 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module GkehubV1alpha2
23
+ # GKE Hub
24
+ #
25
+ #
26
+ #
27
+ # @example
28
+ # require 'google/apis/gkehub_v1alpha2'
29
+ #
30
+ # Gkehub = Google::Apis::GkehubV1alpha2 # Alias the module
31
+ # service = Gkehub::GKEHubService.new
32
+ #
33
+ # @see https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster
34
+ class GKEHubService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://gkehub.googleapis.com/', '',
47
+ client_name: 'google-apis-gkehub_v1alpha2',
48
+ client_version: Google::Apis::GkehubV1alpha2::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Gets information about a location.
53
+ # @param [String] name
54
+ # Resource name for the location.
55
+ # @param [String] fields
56
+ # Selector specifying which fields to include in a partial response.
57
+ # @param [String] quota_user
58
+ # Available to use for quota purposes for server-side applications. Can be any
59
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
60
+ # @param [Google::Apis::RequestOptions] options
61
+ # Request-specific options
62
+ #
63
+ # @yield [result, err] Result & error if block supplied
64
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::Location] parsed result object
65
+ # @yieldparam err [StandardError] error object if request failed
66
+ #
67
+ # @return [Google::Apis::GkehubV1alpha2::Location]
68
+ #
69
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
70
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
71
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
72
+ def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
73
+ command = make_simple_command(:get, 'v1alpha2/{+name}', options)
74
+ command.response_representation = Google::Apis::GkehubV1alpha2::Location::Representation
75
+ command.response_class = Google::Apis::GkehubV1alpha2::Location
76
+ command.params['name'] = name unless name.nil?
77
+ command.query['fields'] = fields unless fields.nil?
78
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
79
+ execute_or_queue_command(command, &block)
80
+ end
81
+
82
+ # Lists information about the supported locations for this service.
83
+ # @param [String] name
84
+ # The resource that owns the locations collection, if applicable.
85
+ # @param [String] filter
86
+ # A filter to narrow down results to a preferred subset. The filtering language
87
+ # accepts strings like "displayName=tokyo", and is documented in more detail in [
88
+ # AIP-160](https://google.aip.dev/160).
89
+ # @param [Fixnum] page_size
90
+ # The maximum number of results to return. If not set, the service will select a
91
+ # default.
92
+ # @param [String] page_token
93
+ # A page token received from the `next_page_token` field in the response. Send
94
+ # that page token to receive the subsequent page.
95
+ # @param [String] fields
96
+ # Selector specifying which fields to include in a partial response.
97
+ # @param [String] quota_user
98
+ # Available to use for quota purposes for server-side applications. Can be any
99
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
100
+ # @param [Google::Apis::RequestOptions] options
101
+ # Request-specific options
102
+ #
103
+ # @yield [result, err] Result & error if block supplied
104
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::ListLocationsResponse] parsed result object
105
+ # @yieldparam err [StandardError] error object if request failed
106
+ #
107
+ # @return [Google::Apis::GkehubV1alpha2::ListLocationsResponse]
108
+ #
109
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
110
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
111
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
112
+ def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
113
+ command = make_simple_command(:get, 'v1alpha2/{+name}/locations', options)
114
+ command.response_representation = Google::Apis::GkehubV1alpha2::ListLocationsResponse::Representation
115
+ command.response_class = Google::Apis::GkehubV1alpha2::ListLocationsResponse
116
+ command.params['name'] = name unless name.nil?
117
+ command.query['filter'] = filter unless filter.nil?
118
+ command.query['pageSize'] = page_size unless page_size.nil?
119
+ command.query['pageToken'] = page_token unless page_token.nil?
120
+ command.query['fields'] = fields unless fields.nil?
121
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
122
+ execute_or_queue_command(command, &block)
123
+ end
124
+
125
+ # Initializes the Hub in this project, which includes creating the default Hub
126
+ # Service Account and the Hub Workload Identity Pool. Initialization is optional,
127
+ # and happens automatically when the first Membership is created. InitializeHub
128
+ # should be called when the first Membership cannot be registered without these
129
+ # resources. A common example is granting the Hub Service Account access to
130
+ # another project, which requires the account to exist first.
131
+ # @param [String] project
132
+ # Required. The Hub to initialize, in the format `projects/*/locations/*/
133
+ # memberships/*`.
134
+ # @param [Google::Apis::GkehubV1alpha2::InitializeHubRequest] initialize_hub_request_object
135
+ # @param [String] fields
136
+ # Selector specifying which fields to include in a partial response.
137
+ # @param [String] quota_user
138
+ # Available to use for quota purposes for server-side applications. Can be any
139
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
140
+ # @param [Google::Apis::RequestOptions] options
141
+ # Request-specific options
142
+ #
143
+ # @yield [result, err] Result & error if block supplied
144
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::InitializeHubResponse] parsed result object
145
+ # @yieldparam err [StandardError] error object if request failed
146
+ #
147
+ # @return [Google::Apis::GkehubV1alpha2::InitializeHubResponse]
148
+ #
149
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
150
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
151
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
152
+ def initialize_membership_hub(project, initialize_hub_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
153
+ command = make_simple_command(:post, 'v1alpha2/{+project}:initializeHub', options)
154
+ command.request_representation = Google::Apis::GkehubV1alpha2::InitializeHubRequest::Representation
155
+ command.request_object = initialize_hub_request_object
156
+ command.response_representation = Google::Apis::GkehubV1alpha2::InitializeHubResponse::Representation
157
+ command.response_class = Google::Apis::GkehubV1alpha2::InitializeHubResponse
158
+ command.params['project'] = project unless project.nil?
159
+ command.query['fields'] = fields unless fields.nil?
160
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
161
+ execute_or_queue_command(command, &block)
162
+ end
163
+
164
+ # Adds a new Membership.
165
+ # @param [String] parent
166
+ # Required. The parent (project and location) where the Memberships will be
167
+ # created. Specified in the format `projects/*/locations/*`.
168
+ # @param [Google::Apis::GkehubV1alpha2::Membership] membership_object
169
+ # @param [String] membership_id
170
+ # Required. Client chosen ID for the membership. `membership_id` must be a valid
171
+ # RFC 1123 compliant DNS label: 1. At most 63 characters in length 2. It must
172
+ # consist of lower case alphanumeric characters or `-` 3. It must start and end
173
+ # with an alphanumeric character Which can be expressed as the regex: `[a-z0-9]([
174
+ # -a-z0-9]*[a-z0-9])?`, with a maximum length of 63 characters.
175
+ # @param [String] fields
176
+ # Selector specifying which fields to include in a partial response.
177
+ # @param [String] quota_user
178
+ # Available to use for quota purposes for server-side applications. Can be any
179
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
180
+ # @param [Google::Apis::RequestOptions] options
181
+ # Request-specific options
182
+ #
183
+ # @yield [result, err] Result & error if block supplied
184
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::Operation] parsed result object
185
+ # @yieldparam err [StandardError] error object if request failed
186
+ #
187
+ # @return [Google::Apis::GkehubV1alpha2::Operation]
188
+ #
189
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
190
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
191
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
192
+ def create_project_location_membership(parent, membership_object = nil, membership_id: nil, fields: nil, quota_user: nil, options: nil, &block)
193
+ command = make_simple_command(:post, 'v1alpha2/{+parent}/memberships', options)
194
+ command.request_representation = Google::Apis::GkehubV1alpha2::Membership::Representation
195
+ command.request_object = membership_object
196
+ command.response_representation = Google::Apis::GkehubV1alpha2::Operation::Representation
197
+ command.response_class = Google::Apis::GkehubV1alpha2::Operation
198
+ command.params['parent'] = parent unless parent.nil?
199
+ command.query['membershipId'] = membership_id unless membership_id.nil?
200
+ command.query['fields'] = fields unless fields.nil?
201
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
202
+ execute_or_queue_command(command, &block)
203
+ end
204
+
205
+ # Removes a Membership.
206
+ # @param [String] name
207
+ # Required. The Membership resource name in the format `projects/*/locations/*/
208
+ # memberships/*`.
209
+ # @param [String] fields
210
+ # Selector specifying which fields to include in a partial response.
211
+ # @param [String] quota_user
212
+ # Available to use for quota purposes for server-side applications. Can be any
213
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
214
+ # @param [Google::Apis::RequestOptions] options
215
+ # Request-specific options
216
+ #
217
+ # @yield [result, err] Result & error if block supplied
218
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::Operation] parsed result object
219
+ # @yieldparam err [StandardError] error object if request failed
220
+ #
221
+ # @return [Google::Apis::GkehubV1alpha2::Operation]
222
+ #
223
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
224
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
225
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
226
+ def delete_project_location_membership(name, fields: nil, quota_user: nil, options: nil, &block)
227
+ command = make_simple_command(:delete, 'v1alpha2/{+name}', options)
228
+ command.response_representation = Google::Apis::GkehubV1alpha2::Operation::Representation
229
+ command.response_class = Google::Apis::GkehubV1alpha2::Operation
230
+ command.params['name'] = name unless name.nil?
231
+ command.query['fields'] = fields unless fields.nil?
232
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
233
+ execute_or_queue_command(command, &block)
234
+ end
235
+
236
+ # Generates the manifest for deployment of the GKE connect agent.
237
+ # @param [String] name
238
+ # Required. The Membership resource name the Agent will associate with, in the
239
+ # format `projects/*/locations/*/memberships/*`.
240
+ # @param [String] image_pull_secret_content
241
+ # Optional. The image pull secret content for the registry, if not public.
242
+ # @param [Boolean] is_upgrade
243
+ # Optional. If true, generate the resources for upgrade only. Some resources
244
+ # generated only for installation (e.g. secrets) will be excluded.
245
+ # @param [String] namespace
246
+ # Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
247
+ # The Connect Agent is authorized automatically when run in the default
248
+ # namespace. Otherwise, explicit authorization must be granted with an
249
+ # additional IAM binding.
250
+ # @param [String] proxy
251
+ # Optional. URI of a proxy if connectivity from the agent to gkeconnect.
252
+ # googleapis.com requires the use of a proxy. Format must be in the form `http(s)
253
+ # ://`proxy_address``, depending on the HTTP/HTTPS protocol supported by the
254
+ # proxy. This will direct the connect agent's outbound traffic through a HTTP(S)
255
+ # proxy.
256
+ # @param [String] registry
257
+ # Optional. The registry to fetch the connect agent image from. Defaults to gcr.
258
+ # io/gkeconnect.
259
+ # @param [String] version
260
+ # Optional. The Connect agent version to use. Defaults to the most current
261
+ # version.
262
+ # @param [String] fields
263
+ # Selector specifying which fields to include in a partial response.
264
+ # @param [String] quota_user
265
+ # Available to use for quota purposes for server-side applications. Can be any
266
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
267
+ # @param [Google::Apis::RequestOptions] options
268
+ # Request-specific options
269
+ #
270
+ # @yield [result, err] Result & error if block supplied
271
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::GenerateConnectManifestResponse] parsed result object
272
+ # @yieldparam err [StandardError] error object if request failed
273
+ #
274
+ # @return [Google::Apis::GkehubV1alpha2::GenerateConnectManifestResponse]
275
+ #
276
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
277
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
278
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
279
+ def generate_project_location_membership_connect_manifest(name, image_pull_secret_content: nil, is_upgrade: nil, namespace: nil, proxy: nil, registry: nil, version: nil, fields: nil, quota_user: nil, options: nil, &block)
280
+ command = make_simple_command(:get, 'v1alpha2/{+name}:generateConnectManifest', options)
281
+ command.response_representation = Google::Apis::GkehubV1alpha2::GenerateConnectManifestResponse::Representation
282
+ command.response_class = Google::Apis::GkehubV1alpha2::GenerateConnectManifestResponse
283
+ command.params['name'] = name unless name.nil?
284
+ command.query['imagePullSecretContent'] = image_pull_secret_content unless image_pull_secret_content.nil?
285
+ command.query['isUpgrade'] = is_upgrade unless is_upgrade.nil?
286
+ command.query['namespace'] = namespace unless namespace.nil?
287
+ command.query['proxy'] = proxy unless proxy.nil?
288
+ command.query['registry'] = registry unless registry.nil?
289
+ command.query['version'] = version unless version.nil?
290
+ command.query['fields'] = fields unless fields.nil?
291
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
292
+ execute_or_queue_command(command, &block)
293
+ end
294
+
295
+ # Gets the details of a Membership.
296
+ # @param [String] name
297
+ # Required. The Membership resource name in the format `projects/*/locations/*/
298
+ # memberships/*`.
299
+ # @param [String] fields
300
+ # Selector specifying which fields to include in a partial response.
301
+ # @param [String] quota_user
302
+ # Available to use for quota purposes for server-side applications. Can be any
303
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
304
+ # @param [Google::Apis::RequestOptions] options
305
+ # Request-specific options
306
+ #
307
+ # @yield [result, err] Result & error if block supplied
308
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::Membership] parsed result object
309
+ # @yieldparam err [StandardError] error object if request failed
310
+ #
311
+ # @return [Google::Apis::GkehubV1alpha2::Membership]
312
+ #
313
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
314
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
315
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
316
+ def get_project_location_membership(name, fields: nil, quota_user: nil, options: nil, &block)
317
+ command = make_simple_command(:get, 'v1alpha2/{+name}', options)
318
+ command.response_representation = Google::Apis::GkehubV1alpha2::Membership::Representation
319
+ command.response_class = Google::Apis::GkehubV1alpha2::Membership
320
+ command.params['name'] = name unless name.nil?
321
+ command.query['fields'] = fields unless fields.nil?
322
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
323
+ execute_or_queue_command(command, &block)
324
+ end
325
+
326
+ # Gets the access control policy for a resource. Returns an empty policy if the
327
+ # resource exists and does not have a policy set.
328
+ # @param [String] resource
329
+ # REQUIRED: The resource for which the policy is being requested. See the
330
+ # operation documentation for the appropriate value for this field.
331
+ # @param [Fixnum] options_requested_policy_version
332
+ # Optional. The policy format version to be returned. Valid values are 0, 1, and
333
+ # 3. Requests specifying an invalid value will be rejected. Requests for
334
+ # policies with any conditional bindings must specify version 3. Policies
335
+ # without any conditional bindings may specify any valid value or leave the
336
+ # field unset. To learn which resources support conditions in their IAM policies,
337
+ # see the [IAM documentation](https://cloud.google.com/iam/help/conditions/
338
+ # resource-policies).
339
+ # @param [String] fields
340
+ # Selector specifying which fields to include in a partial response.
341
+ # @param [String] quota_user
342
+ # Available to use for quota purposes for server-side applications. Can be any
343
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
344
+ # @param [Google::Apis::RequestOptions] options
345
+ # Request-specific options
346
+ #
347
+ # @yield [result, err] Result & error if block supplied
348
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::Policy] parsed result object
349
+ # @yieldparam err [StandardError] error object if request failed
350
+ #
351
+ # @return [Google::Apis::GkehubV1alpha2::Policy]
352
+ #
353
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
354
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
355
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
356
+ def get_project_location_membership_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
357
+ command = make_simple_command(:get, 'v1alpha2/{+resource}:getIamPolicy', options)
358
+ command.response_representation = Google::Apis::GkehubV1alpha2::Policy::Representation
359
+ command.response_class = Google::Apis::GkehubV1alpha2::Policy
360
+ command.params['resource'] = resource unless resource.nil?
361
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
362
+ command.query['fields'] = fields unless fields.nil?
363
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
364
+ execute_or_queue_command(command, &block)
365
+ end
366
+
367
+ # Lists Memberships in a given project and location.
368
+ # @param [String] parent
369
+ # Required. The parent (project and location) where the Memberships will be
370
+ # listed. Specified in the format `projects/*/locations/*`.
371
+ # @param [String] filter
372
+ # Optional. Lists Memberships that match the filter expression, following the
373
+ # syntax outlined in https://google.aip.dev/160. Examples: - Name is `bar` in
374
+ # project `foo-proj` and location `global`: name = "projects/foo-proj/locations/
375
+ # global/membership/bar" - Memberships that have a label called `foo`: labels.
376
+ # foo:* - Memberships that have a label called `foo` whose value is `bar`:
377
+ # labels.foo = bar - Memberships in the CREATING state: state = CREATING
378
+ # @param [String] order_by
379
+ # Optional. One or more fields to compare and use to sort the output. See https:/
380
+ # /google.aip.dev/132#ordering.
381
+ # @param [Fixnum] page_size
382
+ # Optional. When requesting a 'page' of resources, `page_size` specifies number
383
+ # of resources to return. If unspecified or set to 0, all resources will be
384
+ # returned.
385
+ # @param [String] page_token
386
+ # Optional. Token returned by previous call to `ListMemberships` which specifies
387
+ # the position in the list from where to continue listing the resources.
388
+ # @param [String] fields
389
+ # Selector specifying which fields to include in a partial response.
390
+ # @param [String] quota_user
391
+ # Available to use for quota purposes for server-side applications. Can be any
392
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
393
+ # @param [Google::Apis::RequestOptions] options
394
+ # Request-specific options
395
+ #
396
+ # @yield [result, err] Result & error if block supplied
397
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::ListMembershipsResponse] parsed result object
398
+ # @yieldparam err [StandardError] error object if request failed
399
+ #
400
+ # @return [Google::Apis::GkehubV1alpha2::ListMembershipsResponse]
401
+ #
402
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
403
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
404
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
405
+ def list_project_location_memberships(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
406
+ command = make_simple_command(:get, 'v1alpha2/{+parent}/memberships', options)
407
+ command.response_representation = Google::Apis::GkehubV1alpha2::ListMembershipsResponse::Representation
408
+ command.response_class = Google::Apis::GkehubV1alpha2::ListMembershipsResponse
409
+ command.params['parent'] = parent unless parent.nil?
410
+ command.query['filter'] = filter unless filter.nil?
411
+ command.query['orderBy'] = order_by unless order_by.nil?
412
+ command.query['pageSize'] = page_size unless page_size.nil?
413
+ command.query['pageToken'] = page_token unless page_token.nil?
414
+ command.query['fields'] = fields unless fields.nil?
415
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
416
+ execute_or_queue_command(command, &block)
417
+ end
418
+
419
+ # Updates an existing Membership.
420
+ # @param [String] name
421
+ # Required. The Membership resource name in the format `projects/*/locations/*/
422
+ # memberships/*`.
423
+ # @param [Google::Apis::GkehubV1alpha2::Membership] membership_object
424
+ # @param [String] update_mask
425
+ # Required. Mask of fields to update.
426
+ # @param [String] fields
427
+ # Selector specifying which fields to include in a partial response.
428
+ # @param [String] quota_user
429
+ # Available to use for quota purposes for server-side applications. Can be any
430
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
431
+ # @param [Google::Apis::RequestOptions] options
432
+ # Request-specific options
433
+ #
434
+ # @yield [result, err] Result & error if block supplied
435
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::Operation] parsed result object
436
+ # @yieldparam err [StandardError] error object if request failed
437
+ #
438
+ # @return [Google::Apis::GkehubV1alpha2::Operation]
439
+ #
440
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
441
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
442
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
443
+ def patch_project_location_membership(name, membership_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
444
+ command = make_simple_command(:patch, 'v1alpha2/{+name}', options)
445
+ command.request_representation = Google::Apis::GkehubV1alpha2::Membership::Representation
446
+ command.request_object = membership_object
447
+ command.response_representation = Google::Apis::GkehubV1alpha2::Operation::Representation
448
+ command.response_class = Google::Apis::GkehubV1alpha2::Operation
449
+ command.params['name'] = name unless name.nil?
450
+ command.query['updateMask'] = update_mask unless update_mask.nil?
451
+ command.query['fields'] = fields unless fields.nil?
452
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
453
+ execute_or_queue_command(command, &block)
454
+ end
455
+
456
+ # Sets the access control policy on the specified resource. Replaces any
457
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
458
+ # PERMISSION_DENIED` errors.
459
+ # @param [String] resource
460
+ # REQUIRED: The resource for which the policy is being specified. See the
461
+ # operation documentation for the appropriate value for this field.
462
+ # @param [Google::Apis::GkehubV1alpha2::SetIamPolicyRequest] set_iam_policy_request_object
463
+ # @param [String] fields
464
+ # Selector specifying which fields to include in a partial response.
465
+ # @param [String] quota_user
466
+ # Available to use for quota purposes for server-side applications. Can be any
467
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
468
+ # @param [Google::Apis::RequestOptions] options
469
+ # Request-specific options
470
+ #
471
+ # @yield [result, err] Result & error if block supplied
472
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::Policy] parsed result object
473
+ # @yieldparam err [StandardError] error object if request failed
474
+ #
475
+ # @return [Google::Apis::GkehubV1alpha2::Policy]
476
+ #
477
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
478
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
479
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
480
+ def set_membership_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
481
+ command = make_simple_command(:post, 'v1alpha2/{+resource}:setIamPolicy', options)
482
+ command.request_representation = Google::Apis::GkehubV1alpha2::SetIamPolicyRequest::Representation
483
+ command.request_object = set_iam_policy_request_object
484
+ command.response_representation = Google::Apis::GkehubV1alpha2::Policy::Representation
485
+ command.response_class = Google::Apis::GkehubV1alpha2::Policy
486
+ command.params['resource'] = resource unless resource.nil?
487
+ command.query['fields'] = fields unless fields.nil?
488
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
489
+ execute_or_queue_command(command, &block)
490
+ end
491
+
492
+ # Returns permissions that a caller has on the specified resource. If the
493
+ # resource does not exist, this will return an empty set of permissions, not a `
494
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
495
+ # permission-aware UIs and command-line tools, not for authorization checking.
496
+ # This operation may "fail open" without warning.
497
+ # @param [String] resource
498
+ # REQUIRED: The resource for which the policy detail is being requested. See the
499
+ # operation documentation for the appropriate value for this field.
500
+ # @param [Google::Apis::GkehubV1alpha2::TestIamPermissionsRequest] test_iam_permissions_request_object
501
+ # @param [String] fields
502
+ # Selector specifying which fields to include in a partial response.
503
+ # @param [String] quota_user
504
+ # Available to use for quota purposes for server-side applications. Can be any
505
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
506
+ # @param [Google::Apis::RequestOptions] options
507
+ # Request-specific options
508
+ #
509
+ # @yield [result, err] Result & error if block supplied
510
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::TestIamPermissionsResponse] parsed result object
511
+ # @yieldparam err [StandardError] error object if request failed
512
+ #
513
+ # @return [Google::Apis::GkehubV1alpha2::TestIamPermissionsResponse]
514
+ #
515
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
516
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
517
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
518
+ def test_membership_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
519
+ command = make_simple_command(:post, 'v1alpha2/{+resource}:testIamPermissions', options)
520
+ command.request_representation = Google::Apis::GkehubV1alpha2::TestIamPermissionsRequest::Representation
521
+ command.request_object = test_iam_permissions_request_object
522
+ command.response_representation = Google::Apis::GkehubV1alpha2::TestIamPermissionsResponse::Representation
523
+ command.response_class = Google::Apis::GkehubV1alpha2::TestIamPermissionsResponse
524
+ command.params['resource'] = resource unless resource.nil?
525
+ command.query['fields'] = fields unless fields.nil?
526
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
527
+ execute_or_queue_command(command, &block)
528
+ end
529
+
530
+ # Starts asynchronous cancellation on a long-running operation. The server makes
531
+ # a best effort to cancel the operation, but success is not guaranteed. If the
532
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
533
+ # Clients can use Operations.GetOperation or other methods to check whether the
534
+ # cancellation succeeded or whether the operation completed despite cancellation.
535
+ # On successful cancellation, the operation is not deleted; instead, it becomes
536
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
537
+ # corresponding to `Code.CANCELLED`.
538
+ # @param [String] name
539
+ # The name of the operation resource to be cancelled.
540
+ # @param [Google::Apis::GkehubV1alpha2::CancelOperationRequest] cancel_operation_request_object
541
+ # @param [String] fields
542
+ # Selector specifying which fields to include in a partial response.
543
+ # @param [String] quota_user
544
+ # Available to use for quota purposes for server-side applications. Can be any
545
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
546
+ # @param [Google::Apis::RequestOptions] options
547
+ # Request-specific options
548
+ #
549
+ # @yield [result, err] Result & error if block supplied
550
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::Empty] parsed result object
551
+ # @yieldparam err [StandardError] error object if request failed
552
+ #
553
+ # @return [Google::Apis::GkehubV1alpha2::Empty]
554
+ #
555
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
556
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
557
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
558
+ def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
559
+ command = make_simple_command(:post, 'v1alpha2/{+name}:cancel', options)
560
+ command.request_representation = Google::Apis::GkehubV1alpha2::CancelOperationRequest::Representation
561
+ command.request_object = cancel_operation_request_object
562
+ command.response_representation = Google::Apis::GkehubV1alpha2::Empty::Representation
563
+ command.response_class = Google::Apis::GkehubV1alpha2::Empty
564
+ command.params['name'] = name unless name.nil?
565
+ command.query['fields'] = fields unless fields.nil?
566
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
567
+ execute_or_queue_command(command, &block)
568
+ end
569
+
570
+ # Deletes a long-running operation. This method indicates that the client is no
571
+ # longer interested in the operation result. It does not cancel the operation.
572
+ # If the server doesn't support this method, it returns `google.rpc.Code.
573
+ # UNIMPLEMENTED`.
574
+ # @param [String] name
575
+ # The name of the operation resource to be deleted.
576
+ # @param [String] fields
577
+ # Selector specifying which fields to include in a partial response.
578
+ # @param [String] quota_user
579
+ # Available to use for quota purposes for server-side applications. Can be any
580
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
581
+ # @param [Google::Apis::RequestOptions] options
582
+ # Request-specific options
583
+ #
584
+ # @yield [result, err] Result & error if block supplied
585
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::Empty] parsed result object
586
+ # @yieldparam err [StandardError] error object if request failed
587
+ #
588
+ # @return [Google::Apis::GkehubV1alpha2::Empty]
589
+ #
590
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
591
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
592
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
593
+ def delete_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
594
+ command = make_simple_command(:delete, 'v1alpha2/{+name}', options)
595
+ command.response_representation = Google::Apis::GkehubV1alpha2::Empty::Representation
596
+ command.response_class = Google::Apis::GkehubV1alpha2::Empty
597
+ command.params['name'] = name unless name.nil?
598
+ command.query['fields'] = fields unless fields.nil?
599
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
600
+ execute_or_queue_command(command, &block)
601
+ end
602
+
603
+ # Gets the latest state of a long-running operation. Clients can use this method
604
+ # to poll the operation result at intervals as recommended by the API service.
605
+ # @param [String] name
606
+ # The name of the operation resource.
607
+ # @param [String] fields
608
+ # Selector specifying which fields to include in a partial response.
609
+ # @param [String] quota_user
610
+ # Available to use for quota purposes for server-side applications. Can be any
611
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
612
+ # @param [Google::Apis::RequestOptions] options
613
+ # Request-specific options
614
+ #
615
+ # @yield [result, err] Result & error if block supplied
616
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::Operation] parsed result object
617
+ # @yieldparam err [StandardError] error object if request failed
618
+ #
619
+ # @return [Google::Apis::GkehubV1alpha2::Operation]
620
+ #
621
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
622
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
623
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
624
+ def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
625
+ command = make_simple_command(:get, 'v1alpha2/{+name}', options)
626
+ command.response_representation = Google::Apis::GkehubV1alpha2::Operation::Representation
627
+ command.response_class = Google::Apis::GkehubV1alpha2::Operation
628
+ command.params['name'] = name unless name.nil?
629
+ command.query['fields'] = fields unless fields.nil?
630
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
631
+ execute_or_queue_command(command, &block)
632
+ end
633
+
634
+ # Lists operations that match the specified filter in the request. If the server
635
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
636
+ # binding allows API services to override the binding to use different resource
637
+ # name schemes, such as `users/*/operations`. To override the binding, API
638
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
639
+ # service configuration. For backwards compatibility, the default name includes
640
+ # the operations collection id, however overriding users must ensure the name
641
+ # binding is the parent resource, without the operations collection id.
642
+ # @param [String] name
643
+ # The name of the operation's parent resource.
644
+ # @param [String] filter
645
+ # The standard list filter.
646
+ # @param [Fixnum] page_size
647
+ # The standard list page size.
648
+ # @param [String] page_token
649
+ # The standard list page token.
650
+ # @param [String] fields
651
+ # Selector specifying which fields to include in a partial response.
652
+ # @param [String] quota_user
653
+ # Available to use for quota purposes for server-side applications. Can be any
654
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
655
+ # @param [Google::Apis::RequestOptions] options
656
+ # Request-specific options
657
+ #
658
+ # @yield [result, err] Result & error if block supplied
659
+ # @yieldparam result [Google::Apis::GkehubV1alpha2::ListOperationsResponse] parsed result object
660
+ # @yieldparam err [StandardError] error object if request failed
661
+ #
662
+ # @return [Google::Apis::GkehubV1alpha2::ListOperationsResponse]
663
+ #
664
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
665
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
666
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
667
+ def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
668
+ command = make_simple_command(:get, 'v1alpha2/{+name}/operations', options)
669
+ command.response_representation = Google::Apis::GkehubV1alpha2::ListOperationsResponse::Representation
670
+ command.response_class = Google::Apis::GkehubV1alpha2::ListOperationsResponse
671
+ command.params['name'] = name unless name.nil?
672
+ command.query['filter'] = filter unless filter.nil?
673
+ command.query['pageSize'] = page_size unless page_size.nil?
674
+ command.query['pageToken'] = page_token unless page_token.nil?
675
+ command.query['fields'] = fields unless fields.nil?
676
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
677
+ execute_or_queue_command(command, &block)
678
+ end
679
+
680
+ protected
681
+
682
+ def apply_command_defaults(command)
683
+ command.query['key'] = key unless key.nil?
684
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
685
+ end
686
+ end
687
+ end
688
+ end
689
+ end