google-cloud-vmware_engine-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +144 -0
  6. data/lib/google/cloud/vmware_engine/v1/version.rb +28 -0
  7. data/lib/google/cloud/vmware_engine/v1/vmware_engine/client.rb +4129 -0
  8. data/lib/google/cloud/vmware_engine/v1/vmware_engine/credentials.rb +47 -0
  9. data/lib/google/cloud/vmware_engine/v1/vmware_engine/operations.rb +770 -0
  10. data/lib/google/cloud/vmware_engine/v1/vmware_engine/paths.rb +185 -0
  11. data/lib/google/cloud/vmware_engine/v1/vmware_engine.rb +50 -0
  12. data/lib/google/cloud/vmware_engine/v1.rb +40 -0
  13. data/lib/google/cloud/vmwareengine/v1/vmwareengine_pb.rb +470 -0
  14. data/lib/google/cloud/vmwareengine/v1/vmwareengine_services_pb.rb +171 -0
  15. data/lib/google-cloud-vmware_engine-v1.rb +21 -0
  16. data/proto_docs/README.md +4 -0
  17. data/proto_docs/google/api/client.rb +318 -0
  18. data/proto_docs/google/api/field_behavior.rb +71 -0
  19. data/proto_docs/google/api/launch_stage.rb +71 -0
  20. data/proto_docs/google/api/resource.rb +222 -0
  21. data/proto_docs/google/cloud/vmwareengine/v1/vmwareengine.rb +1774 -0
  22. data/proto_docs/google/longrunning/operations.rb +164 -0
  23. data/proto_docs/google/protobuf/any.rb +141 -0
  24. data/proto_docs/google/protobuf/duration.rb +98 -0
  25. data/proto_docs/google/protobuf/empty.rb +34 -0
  26. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  27. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  28. data/proto_docs/google/rpc/status.rb +46 -0
  29. data/proto_docs/google/type/expr.rb +75 -0
  30. metadata +262 -0
@@ -0,0 +1,4129 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/vmwareengine/v1/vmwareengine_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
23
+
24
+ module Google
25
+ module Cloud
26
+ module VmwareEngine
27
+ module V1
28
+ module VmwareEngine
29
+ ##
30
+ # Client for the VmwareEngine service.
31
+ #
32
+ # VMwareEngine manages VMware's private clusters in the Cloud.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :vmware_engine_stub
39
+
40
+ ##
41
+ # Configure the VmwareEngine Client class.
42
+ #
43
+ # See {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all VmwareEngine clients
49
+ # ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "VmwareEngine", "V1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.timeout = 120.0
70
+
71
+ default_config.rpcs.list_private_clouds.timeout = 120.0
72
+ default_config.rpcs.list_private_clouds.retry_policy = {
73
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
74
+ }
75
+
76
+ default_config.rpcs.get_private_cloud.timeout = 120.0
77
+ default_config.rpcs.get_private_cloud.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
79
+ }
80
+
81
+ default_config.rpcs.list_clusters.timeout = 120.0
82
+ default_config.rpcs.list_clusters.retry_policy = {
83
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
84
+ }
85
+
86
+ default_config.rpcs.get_cluster.timeout = 120.0
87
+ default_config.rpcs.get_cluster.retry_policy = {
88
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
89
+ }
90
+
91
+ default_config.rpcs.list_subnets.timeout = 120.0
92
+ default_config.rpcs.list_subnets.retry_policy = {
93
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
94
+ }
95
+
96
+ default_config.rpcs.list_node_types.timeout = 120.0
97
+ default_config.rpcs.list_node_types.retry_policy = {
98
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
99
+ }
100
+
101
+ default_config.rpcs.get_node_type.timeout = 120.0
102
+ default_config.rpcs.get_node_type.retry_policy = {
103
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
104
+ }
105
+
106
+ default_config.rpcs.show_nsx_credentials.timeout = 120.0
107
+ default_config.rpcs.show_nsx_credentials.retry_policy = {
108
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
109
+ }
110
+
111
+ default_config.rpcs.show_vcenter_credentials.timeout = 120.0
112
+ default_config.rpcs.show_vcenter_credentials.retry_policy = {
113
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
114
+ }
115
+
116
+ default_config.rpcs.list_hcx_activation_keys.timeout = 120.0
117
+ default_config.rpcs.list_hcx_activation_keys.retry_policy = {
118
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
119
+ }
120
+
121
+ default_config.rpcs.get_hcx_activation_key.timeout = 120.0
122
+ default_config.rpcs.get_hcx_activation_key.retry_policy = {
123
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
124
+ }
125
+
126
+ default_config.rpcs.get_network_policy.timeout = 120.0
127
+ default_config.rpcs.get_network_policy.retry_policy = {
128
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
129
+ }
130
+
131
+ default_config.rpcs.list_network_policies.timeout = 120.0
132
+ default_config.rpcs.list_network_policies.retry_policy = {
133
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
134
+ }
135
+
136
+ default_config.rpcs.get_vmware_engine_network.timeout = 120.0
137
+ default_config.rpcs.get_vmware_engine_network.retry_policy = {
138
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
139
+ }
140
+
141
+ default_config.rpcs.list_vmware_engine_networks.timeout = 120.0
142
+ default_config.rpcs.list_vmware_engine_networks.retry_policy = {
143
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
144
+ }
145
+
146
+ default_config
147
+ end
148
+ yield @configure if block_given?
149
+ @configure
150
+ end
151
+
152
+ ##
153
+ # Configure the VmwareEngine Client instance.
154
+ #
155
+ # The configuration is set to the derived mode, meaning that values can be changed,
156
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
157
+ # should be made on {Client.configure}.
158
+ #
159
+ # See {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client::Configuration}
160
+ # for a description of the configuration fields.
161
+ #
162
+ # @yield [config] Configure the Client client.
163
+ # @yieldparam config [Client::Configuration]
164
+ #
165
+ # @return [Client::Configuration]
166
+ #
167
+ def configure
168
+ yield @config if block_given?
169
+ @config
170
+ end
171
+
172
+ ##
173
+ # Create a new VmwareEngine client object.
174
+ #
175
+ # @example
176
+ #
177
+ # # Create a client using the default configuration
178
+ # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
179
+ #
180
+ # # Create a client using a custom configuration
181
+ # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config|
182
+ # config.timeout = 10.0
183
+ # end
184
+ #
185
+ # @yield [config] Configure the VmwareEngine client.
186
+ # @yieldparam config [Client::Configuration]
187
+ #
188
+ def initialize
189
+ # These require statements are intentionally placed here to initialize
190
+ # the gRPC module only when it's required.
191
+ # See https://github.com/googleapis/toolkit/issues/446
192
+ require "gapic/grpc"
193
+ require "google/cloud/vmwareengine/v1/vmwareengine_services_pb"
194
+
195
+ # Create the configuration object
196
+ @config = Configuration.new Client.configure
197
+
198
+ # Yield the configuration if needed
199
+ yield @config if block_given?
200
+
201
+ # Create credentials
202
+ credentials = @config.credentials
203
+ # Use self-signed JWT if the endpoint is unchanged from default,
204
+ # but only if the default endpoint does not have a region prefix.
205
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
206
+ !@config.endpoint.split(".").first.include?("-")
207
+ credentials ||= Credentials.default scope: @config.scope,
208
+ enable_self_signed_jwt: enable_self_signed_jwt
209
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
210
+ credentials = Credentials.new credentials, scope: @config.scope
211
+ end
212
+ @quota_project_id = @config.quota_project
213
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
214
+
215
+ @operations_client = Operations.new do |config|
216
+ config.credentials = credentials
217
+ config.quota_project = @quota_project_id
218
+ config.endpoint = @config.endpoint
219
+ end
220
+
221
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
222
+ config.credentials = credentials
223
+ config.quota_project = @quota_project_id
224
+ config.endpoint = @config.endpoint
225
+ end
226
+
227
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
228
+ config.credentials = credentials
229
+ config.quota_project = @quota_project_id
230
+ config.endpoint = @config.endpoint
231
+ end
232
+
233
+ @vmware_engine_stub = ::Gapic::ServiceStub.new(
234
+ ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Stub,
235
+ credentials: credentials,
236
+ endpoint: @config.endpoint,
237
+ channel_args: @config.channel_args,
238
+ interceptors: @config.interceptors
239
+ )
240
+ end
241
+
242
+ ##
243
+ # Get the associated client for long-running operations.
244
+ #
245
+ # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngine::Operations]
246
+ #
247
+ attr_reader :operations_client
248
+
249
+ ##
250
+ # Get the associated client for mix-in of the Locations.
251
+ #
252
+ # @return [Google::Cloud::Location::Locations::Client]
253
+ #
254
+ attr_reader :location_client
255
+
256
+ ##
257
+ # Get the associated client for mix-in of the IAMPolicy.
258
+ #
259
+ # @return [Google::Iam::V1::IAMPolicy::Client]
260
+ #
261
+ attr_reader :iam_policy_client
262
+
263
+ # Service calls
264
+
265
+ ##
266
+ # Lists `PrivateCloud` resources in a given project and location.
267
+ #
268
+ # @overload list_private_clouds(request, options = nil)
269
+ # Pass arguments to `list_private_clouds` via a request object, either of type
270
+ # {::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest} or an equivalent Hash.
271
+ #
272
+ # @param request [::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest, ::Hash]
273
+ # A request object representing the call parameters. Required. To specify no
274
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
275
+ # @param options [::Gapic::CallOptions, ::Hash]
276
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
277
+ #
278
+ # @overload list_private_clouds(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
279
+ # Pass arguments to `list_private_clouds` via keyword arguments. Note that at
280
+ # least one keyword argument is required. To specify no parameters, or to keep all
281
+ # the default parameter values, pass an empty Hash as a request object (see above).
282
+ #
283
+ # @param parent [::String]
284
+ # Required. The resource name of the private cloud to be queried for
285
+ # clusters. Resource names are schemeless URIs that follow the conventions in
286
+ # https://cloud.google.com/apis/design/resource_names.
287
+ # For example:
288
+ # `projects/my-project/locations/us-west1-a`
289
+ # @param page_size [::Integer]
290
+ # The maximum number of private clouds to return in one page.
291
+ # The service may return fewer than this value.
292
+ # The maximum value is coerced to 1000.
293
+ # The default value of this field is 500.
294
+ # @param page_token [::String]
295
+ # A page token, received from a previous `ListPrivateClouds` call.
296
+ # Provide this to retrieve the subsequent page.
297
+ #
298
+ # When paginating, all other parameters provided to `ListPrivateClouds` must
299
+ # match the call that provided the page token.
300
+ # @param filter [::String]
301
+ # A filter expression that matches resources returned in the response.
302
+ # The expression must specify the field name, a comparison operator, and the
303
+ # value that you want to use for filtering. The value must be a string, a
304
+ # number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or
305
+ # `<`.
306
+ #
307
+ # For example, if you are filtering a list of private clouds, you can exclude
308
+ # the ones named `example-pc` by specifying `name != "example-pc"`.
309
+ #
310
+ # You can also filter nested fields. For example, you could specify
311
+ # `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds
312
+ # only if they have a matching address in their network configuration.
313
+ #
314
+ # To filter on multiple expressions, provide each separate expression within
315
+ # parentheses. For example:
316
+ # ```
317
+ # (name = "example-pc")
318
+ # (createTime > "2021-04-12T08:15:10.40Z")
319
+ # ```
320
+ #
321
+ # By default, each expression is an `AND` expression. However, you can
322
+ # include `AND` and `OR` expressions explicitly. For example:
323
+ # ```
324
+ # (name = "private-cloud-1") AND
325
+ # (createTime > "2021-04-12T08:15:10.40Z") OR
326
+ # (name = "private-cloud-2")
327
+ # ```
328
+ # @param order_by [::String]
329
+ # Sorts list results by a certain order. By default, returned results are
330
+ # ordered by `name` in ascending order. You can also sort results in
331
+ # descending order based on the `name` value using `orderBy="name desc"`.
332
+ # Currently, only ordering by `name` is supported.
333
+ #
334
+ # @yield [response, operation] Access the result along with the RPC operation
335
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateCloud>]
336
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
337
+ #
338
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateCloud>]
339
+ #
340
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
341
+ #
342
+ # @example Basic example
343
+ # require "google/cloud/vmware_engine/v1"
344
+ #
345
+ # # Create a client object. The client can be reused for multiple calls.
346
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
347
+ #
348
+ # # Create a request. To set request fields, pass in keyword arguments.
349
+ # request = Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.new
350
+ #
351
+ # # Call the list_private_clouds method.
352
+ # result = client.list_private_clouds request
353
+ #
354
+ # # The returned object is of type Gapic::PagedEnumerable. You can
355
+ # # iterate over all elements by calling #each, and the enumerable
356
+ # # will lazily make API calls to fetch subsequent pages. Other
357
+ # # methods are also available for managing paging directly.
358
+ # result.each do |response|
359
+ # # Each element is of type ::Google::Cloud::VmwareEngine::V1::PrivateCloud.
360
+ # p response
361
+ # end
362
+ #
363
+ def list_private_clouds request, options = nil
364
+ raise ::ArgumentError, "request must be provided" if request.nil?
365
+
366
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest
367
+
368
+ # Converts hash and nil to an options object
369
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
370
+
371
+ # Customize the options with defaults
372
+ metadata = @config.rpcs.list_private_clouds.metadata.to_h
373
+
374
+ # Set x-goog-api-client and x-goog-user-project headers
375
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
376
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
377
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
378
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
379
+
380
+ header_params = {}
381
+ if request.parent
382
+ header_params["parent"] = request.parent
383
+ end
384
+
385
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
386
+ metadata[:"x-goog-request-params"] ||= request_params_header
387
+
388
+ options.apply_defaults timeout: @config.rpcs.list_private_clouds.timeout,
389
+ metadata: metadata,
390
+ retry_policy: @config.rpcs.list_private_clouds.retry_policy
391
+
392
+ options.apply_defaults timeout: @config.timeout,
393
+ metadata: @config.metadata,
394
+ retry_policy: @config.retry_policy
395
+
396
+ @vmware_engine_stub.call_rpc :list_private_clouds, request, options: options do |response, operation|
397
+ response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_private_clouds, request, response, operation, options
398
+ yield response, operation if block_given?
399
+ return response
400
+ end
401
+ rescue ::GRPC::BadStatus => e
402
+ raise ::Google::Cloud::Error.from_error(e)
403
+ end
404
+
405
+ ##
406
+ # Retrieves a `PrivateCloud` resource by its resource name.
407
+ #
408
+ # @overload get_private_cloud(request, options = nil)
409
+ # Pass arguments to `get_private_cloud` via a request object, either of type
410
+ # {::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest} or an equivalent Hash.
411
+ #
412
+ # @param request [::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest, ::Hash]
413
+ # A request object representing the call parameters. Required. To specify no
414
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
415
+ # @param options [::Gapic::CallOptions, ::Hash]
416
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
417
+ #
418
+ # @overload get_private_cloud(name: nil)
419
+ # Pass arguments to `get_private_cloud` via keyword arguments. Note that at
420
+ # least one keyword argument is required. To specify no parameters, or to keep all
421
+ # the default parameter values, pass an empty Hash as a request object (see above).
422
+ #
423
+ # @param name [::String]
424
+ # Required. The resource name of the private cloud to retrieve.
425
+ # Resource names are schemeless URIs that follow the conventions in
426
+ # https://cloud.google.com/apis/design/resource_names.
427
+ # For example:
428
+ # `projects/my-project/locations/us-west1-a/privateClouds/my-cloud`
429
+ #
430
+ # @yield [response, operation] Access the result along with the RPC operation
431
+ # @yieldparam response [::Google::Cloud::VmwareEngine::V1::PrivateCloud]
432
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
433
+ #
434
+ # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud]
435
+ #
436
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
437
+ #
438
+ # @example Basic example
439
+ # require "google/cloud/vmware_engine/v1"
440
+ #
441
+ # # Create a client object. The client can be reused for multiple calls.
442
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
443
+ #
444
+ # # Create a request. To set request fields, pass in keyword arguments.
445
+ # request = Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.new
446
+ #
447
+ # # Call the get_private_cloud method.
448
+ # result = client.get_private_cloud request
449
+ #
450
+ # # The returned object is of type Google::Cloud::VmwareEngine::V1::PrivateCloud.
451
+ # p result
452
+ #
453
+ def get_private_cloud request, options = nil
454
+ raise ::ArgumentError, "request must be provided" if request.nil?
455
+
456
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest
457
+
458
+ # Converts hash and nil to an options object
459
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
460
+
461
+ # Customize the options with defaults
462
+ metadata = @config.rpcs.get_private_cloud.metadata.to_h
463
+
464
+ # Set x-goog-api-client and x-goog-user-project headers
465
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
466
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
467
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
468
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
469
+
470
+ header_params = {}
471
+ if request.name
472
+ header_params["name"] = request.name
473
+ end
474
+
475
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
476
+ metadata[:"x-goog-request-params"] ||= request_params_header
477
+
478
+ options.apply_defaults timeout: @config.rpcs.get_private_cloud.timeout,
479
+ metadata: metadata,
480
+ retry_policy: @config.rpcs.get_private_cloud.retry_policy
481
+
482
+ options.apply_defaults timeout: @config.timeout,
483
+ metadata: @config.metadata,
484
+ retry_policy: @config.retry_policy
485
+
486
+ @vmware_engine_stub.call_rpc :get_private_cloud, request, options: options do |response, operation|
487
+ yield response, operation if block_given?
488
+ return response
489
+ end
490
+ rescue ::GRPC::BadStatus => e
491
+ raise ::Google::Cloud::Error.from_error(e)
492
+ end
493
+
494
+ ##
495
+ # Creates a new `PrivateCloud` resource in a given project and location.
496
+ # Private clouds can only be created in zones, regional private clouds are
497
+ # not supported.
498
+ #
499
+ # Creating a private cloud also creates a [management
500
+ # cluster](https://cloud.google.com/vmware-engine/docs/concepts-vmware-components)
501
+ # for that private cloud.
502
+ #
503
+ # @overload create_private_cloud(request, options = nil)
504
+ # Pass arguments to `create_private_cloud` via a request object, either of type
505
+ # {::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest} or an equivalent Hash.
506
+ #
507
+ # @param request [::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest, ::Hash]
508
+ # A request object representing the call parameters. Required. To specify no
509
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
510
+ # @param options [::Gapic::CallOptions, ::Hash]
511
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
512
+ #
513
+ # @overload create_private_cloud(parent: nil, private_cloud_id: nil, private_cloud: nil, request_id: nil, validate_only: nil)
514
+ # Pass arguments to `create_private_cloud` via keyword arguments. Note that at
515
+ # least one keyword argument is required. To specify no parameters, or to keep all
516
+ # the default parameter values, pass an empty Hash as a request object (see above).
517
+ #
518
+ # @param parent [::String]
519
+ # Required. The resource name of the location to create the new
520
+ # private cloud in. Resource names are schemeless URIs that follow the
521
+ # conventions in https://cloud.google.com/apis/design/resource_names.
522
+ # For example:
523
+ # `projects/my-project/locations/us-west1-a`
524
+ # @param private_cloud_id [::String]
525
+ # Required. The user-provided identifier of the private cloud to be created.
526
+ # This identifier must be unique among each `PrivateCloud` within the parent
527
+ # and becomes the final token in the name URI.
528
+ # The identifier must meet the following requirements:
529
+ #
530
+ # * Only contains 1-63 alphanumeric characters and hyphens
531
+ # * Begins with an alphabetical character
532
+ # * Ends with a non-hyphen character
533
+ # * Not formatted as a UUID
534
+ # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
535
+ # (section 3.5)
536
+ # @param private_cloud [::Google::Cloud::VmwareEngine::V1::PrivateCloud, ::Hash]
537
+ # Required. The initial description of the new private cloud.
538
+ # @param request_id [::String]
539
+ # Optional. The request ID must be a valid UUID with the exception that zero UUID is
540
+ # not supported (00000000-0000-0000-0000-000000000000).
541
+ # @param validate_only [::Boolean]
542
+ # Optional. True if you want the request to be validated and not executed; false
543
+ # otherwise.
544
+ #
545
+ # @yield [response, operation] Access the result along with the RPC operation
546
+ # @yieldparam response [::Gapic::Operation]
547
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
548
+ #
549
+ # @return [::Gapic::Operation]
550
+ #
551
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
552
+ #
553
+ # @example Basic example
554
+ # require "google/cloud/vmware_engine/v1"
555
+ #
556
+ # # Create a client object. The client can be reused for multiple calls.
557
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
558
+ #
559
+ # # Create a request. To set request fields, pass in keyword arguments.
560
+ # request = Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new
561
+ #
562
+ # # Call the create_private_cloud method.
563
+ # result = client.create_private_cloud request
564
+ #
565
+ # # The returned object is of type Gapic::Operation. You can use this
566
+ # # object to check the status of an operation, cancel it, or wait
567
+ # # for results. Here is how to block until completion:
568
+ # result.wait_until_done! timeout: 60
569
+ # if result.response?
570
+ # p result.response
571
+ # else
572
+ # puts "Error!"
573
+ # end
574
+ #
575
+ def create_private_cloud request, options = nil
576
+ raise ::ArgumentError, "request must be provided" if request.nil?
577
+
578
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest
579
+
580
+ # Converts hash and nil to an options object
581
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
582
+
583
+ # Customize the options with defaults
584
+ metadata = @config.rpcs.create_private_cloud.metadata.to_h
585
+
586
+ # Set x-goog-api-client and x-goog-user-project headers
587
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
588
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
589
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
590
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
591
+
592
+ header_params = {}
593
+ if request.parent
594
+ header_params["parent"] = request.parent
595
+ end
596
+
597
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
598
+ metadata[:"x-goog-request-params"] ||= request_params_header
599
+
600
+ options.apply_defaults timeout: @config.rpcs.create_private_cloud.timeout,
601
+ metadata: metadata,
602
+ retry_policy: @config.rpcs.create_private_cloud.retry_policy
603
+
604
+ options.apply_defaults timeout: @config.timeout,
605
+ metadata: @config.metadata,
606
+ retry_policy: @config.retry_policy
607
+
608
+ @vmware_engine_stub.call_rpc :create_private_cloud, request, options: options do |response, operation|
609
+ response = ::Gapic::Operation.new response, @operations_client, options: options
610
+ yield response, operation if block_given?
611
+ return response
612
+ end
613
+ rescue ::GRPC::BadStatus => e
614
+ raise ::Google::Cloud::Error.from_error(e)
615
+ end
616
+
617
+ ##
618
+ # Modifies a `PrivateCloud` resource. Only the following fields can be
619
+ # updated: `description`.
620
+ # Only fields specified in `updateMask` are applied.
621
+ #
622
+ # During operation processing, the resource is temporarily in the `ACTIVE`
623
+ # state before the operation fully completes. For that period of time, you
624
+ # can't update the resource. Use the operation status to determine when the
625
+ # processing fully completes.
626
+ #
627
+ # @overload update_private_cloud(request, options = nil)
628
+ # Pass arguments to `update_private_cloud` via a request object, either of type
629
+ # {::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest} or an equivalent Hash.
630
+ #
631
+ # @param request [::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest, ::Hash]
632
+ # A request object representing the call parameters. Required. To specify no
633
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
634
+ # @param options [::Gapic::CallOptions, ::Hash]
635
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
636
+ #
637
+ # @overload update_private_cloud(private_cloud: nil, update_mask: nil, request_id: nil)
638
+ # Pass arguments to `update_private_cloud` via keyword arguments. Note that at
639
+ # least one keyword argument is required. To specify no parameters, or to keep all
640
+ # the default parameter values, pass an empty Hash as a request object (see above).
641
+ #
642
+ # @param private_cloud [::Google::Cloud::VmwareEngine::V1::PrivateCloud, ::Hash]
643
+ # Required. Private cloud description.
644
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
645
+ # Required. Field mask is used to specify the fields to be overwritten in the
646
+ # `PrivateCloud` resource by the update. The fields specified in `updateMask`
647
+ # are relative to the resource, not the full request. A field will be
648
+ # overwritten if it is in the mask. If the user does not provide a mask then
649
+ # all fields will be overwritten.
650
+ # @param request_id [::String]
651
+ # Optional. The request ID must be a valid UUID with the exception that zero UUID is
652
+ # not supported (00000000-0000-0000-0000-000000000000).
653
+ #
654
+ # @yield [response, operation] Access the result along with the RPC operation
655
+ # @yieldparam response [::Gapic::Operation]
656
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
657
+ #
658
+ # @return [::Gapic::Operation]
659
+ #
660
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
661
+ #
662
+ # @example Basic example
663
+ # require "google/cloud/vmware_engine/v1"
664
+ #
665
+ # # Create a client object. The client can be reused for multiple calls.
666
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
667
+ #
668
+ # # Create a request. To set request fields, pass in keyword arguments.
669
+ # request = Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new
670
+ #
671
+ # # Call the update_private_cloud method.
672
+ # result = client.update_private_cloud request
673
+ #
674
+ # # The returned object is of type Gapic::Operation. You can use this
675
+ # # object to check the status of an operation, cancel it, or wait
676
+ # # for results. Here is how to block until completion:
677
+ # result.wait_until_done! timeout: 60
678
+ # if result.response?
679
+ # p result.response
680
+ # else
681
+ # puts "Error!"
682
+ # end
683
+ #
684
+ def update_private_cloud request, options = nil
685
+ raise ::ArgumentError, "request must be provided" if request.nil?
686
+
687
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest
688
+
689
+ # Converts hash and nil to an options object
690
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
691
+
692
+ # Customize the options with defaults
693
+ metadata = @config.rpcs.update_private_cloud.metadata.to_h
694
+
695
+ # Set x-goog-api-client and x-goog-user-project headers
696
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
697
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
698
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
699
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
700
+
701
+ header_params = {}
702
+ if request.private_cloud&.name
703
+ header_params["private_cloud.name"] = request.private_cloud.name
704
+ end
705
+
706
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
707
+ metadata[:"x-goog-request-params"] ||= request_params_header
708
+
709
+ options.apply_defaults timeout: @config.rpcs.update_private_cloud.timeout,
710
+ metadata: metadata,
711
+ retry_policy: @config.rpcs.update_private_cloud.retry_policy
712
+
713
+ options.apply_defaults timeout: @config.timeout,
714
+ metadata: @config.metadata,
715
+ retry_policy: @config.retry_policy
716
+
717
+ @vmware_engine_stub.call_rpc :update_private_cloud, request, options: options do |response, operation|
718
+ response = ::Gapic::Operation.new response, @operations_client, options: options
719
+ yield response, operation if block_given?
720
+ return response
721
+ end
722
+ rescue ::GRPC::BadStatus => e
723
+ raise ::Google::Cloud::Error.from_error(e)
724
+ end
725
+
726
+ ##
727
+ # Schedules a `PrivateCloud` resource for deletion.
728
+ #
729
+ # A `PrivateCloud` resource scheduled for deletion has `PrivateCloud.state`
730
+ # set to `DELETED` and `expireTime` set to the time when deletion is final
731
+ # and can no longer be reversed. The delete operation is marked as done
732
+ # as soon as the `PrivateCloud` is successfully scheduled for deletion
733
+ # (this also applies when `delayHours` is set to zero), and the operation is
734
+ # not kept in pending state until `PrivateCloud` is purged.
735
+ # `PrivateCloud` can be restored using `UndeletePrivateCloud` method before
736
+ # the `expireTime` elapses. When `expireTime` is reached, deletion is final
737
+ # and all private cloud resources are irreversibly removed and billing stops.
738
+ # During the final removal process, `PrivateCloud.state` is set to `PURGING`.
739
+ # `PrivateCloud` can be polled using standard `GET` method for the whole
740
+ # period of deletion and purging. It will not be returned only
741
+ # when it is completely purged.
742
+ #
743
+ # @overload delete_private_cloud(request, options = nil)
744
+ # Pass arguments to `delete_private_cloud` via a request object, either of type
745
+ # {::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest} or an equivalent Hash.
746
+ #
747
+ # @param request [::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest, ::Hash]
748
+ # A request object representing the call parameters. Required. To specify no
749
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
750
+ # @param options [::Gapic::CallOptions, ::Hash]
751
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
752
+ #
753
+ # @overload delete_private_cloud(name: nil, request_id: nil, force: nil, delay_hours: nil)
754
+ # Pass arguments to `delete_private_cloud` via keyword arguments. Note that at
755
+ # least one keyword argument is required. To specify no parameters, or to keep all
756
+ # the default parameter values, pass an empty Hash as a request object (see above).
757
+ #
758
+ # @param name [::String]
759
+ # Required. The resource name of the private cloud to delete.
760
+ # Resource names are schemeless URIs that follow the conventions in
761
+ # https://cloud.google.com/apis/design/resource_names.
762
+ # For example:
763
+ # `projects/my-project/locations/us-west1-a/privateClouds/my-cloud`
764
+ # @param request_id [::String]
765
+ # Optional. The request ID must be a valid UUID with the exception that zero UUID is
766
+ # not supported (00000000-0000-0000-0000-000000000000).
767
+ # @param force [::Boolean]
768
+ # Optional. If set to true, cascade delete is enabled and all children of this private
769
+ # cloud resource are also deleted. When this flag is set to false, the
770
+ # private cloud will not be deleted if there are any children other than the
771
+ # management cluster. The management cluster is always deleted.
772
+ # @param delay_hours [::Integer]
773
+ # Optional. Time delay of the deletion specified in hours. The default value
774
+ # is `3`. Specifying a non-zero value for this field changes the value of
775
+ # `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned
776
+ # deletion time. Deletion can be cancelled before `expire_time` elapses using
777
+ # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#undelete_private_cloud VmwareEngine.UndeletePrivateCloud}. Specifying a value of `0` for
778
+ # this field instead begins the deletion process and ceases billing
779
+ # immediately. During the final deletion process, the value of
780
+ # `PrivateCloud.state` becomes `PURGING`.
781
+ #
782
+ # @yield [response, operation] Access the result along with the RPC operation
783
+ # @yieldparam response [::Gapic::Operation]
784
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
785
+ #
786
+ # @return [::Gapic::Operation]
787
+ #
788
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
789
+ #
790
+ # @example Basic example
791
+ # require "google/cloud/vmware_engine/v1"
792
+ #
793
+ # # Create a client object. The client can be reused for multiple calls.
794
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
795
+ #
796
+ # # Create a request. To set request fields, pass in keyword arguments.
797
+ # request = Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new
798
+ #
799
+ # # Call the delete_private_cloud method.
800
+ # result = client.delete_private_cloud request
801
+ #
802
+ # # The returned object is of type Gapic::Operation. You can use this
803
+ # # object to check the status of an operation, cancel it, or wait
804
+ # # for results. Here is how to block until completion:
805
+ # result.wait_until_done! timeout: 60
806
+ # if result.response?
807
+ # p result.response
808
+ # else
809
+ # puts "Error!"
810
+ # end
811
+ #
812
+ def delete_private_cloud request, options = nil
813
+ raise ::ArgumentError, "request must be provided" if request.nil?
814
+
815
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest
816
+
817
+ # Converts hash and nil to an options object
818
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
819
+
820
+ # Customize the options with defaults
821
+ metadata = @config.rpcs.delete_private_cloud.metadata.to_h
822
+
823
+ # Set x-goog-api-client and x-goog-user-project headers
824
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
825
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
826
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
827
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
828
+
829
+ header_params = {}
830
+ if request.name
831
+ header_params["name"] = request.name
832
+ end
833
+
834
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
835
+ metadata[:"x-goog-request-params"] ||= request_params_header
836
+
837
+ options.apply_defaults timeout: @config.rpcs.delete_private_cloud.timeout,
838
+ metadata: metadata,
839
+ retry_policy: @config.rpcs.delete_private_cloud.retry_policy
840
+
841
+ options.apply_defaults timeout: @config.timeout,
842
+ metadata: @config.metadata,
843
+ retry_policy: @config.retry_policy
844
+
845
+ @vmware_engine_stub.call_rpc :delete_private_cloud, request, options: options do |response, operation|
846
+ response = ::Gapic::Operation.new response, @operations_client, options: options
847
+ yield response, operation if block_given?
848
+ return response
849
+ end
850
+ rescue ::GRPC::BadStatus => e
851
+ raise ::Google::Cloud::Error.from_error(e)
852
+ end
853
+
854
+ ##
855
+ # Restores a private cloud that was previously scheduled for deletion by
856
+ # `DeletePrivateCloud`. A `PrivateCloud` resource scheduled for deletion has
857
+ # `PrivateCloud.state` set to `DELETED` and `PrivateCloud.expireTime` set to
858
+ # the time when deletion can no longer be reversed.
859
+ #
860
+ # @overload undelete_private_cloud(request, options = nil)
861
+ # Pass arguments to `undelete_private_cloud` via a request object, either of type
862
+ # {::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest} or an equivalent Hash.
863
+ #
864
+ # @param request [::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest, ::Hash]
865
+ # A request object representing the call parameters. Required. To specify no
866
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
867
+ # @param options [::Gapic::CallOptions, ::Hash]
868
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
869
+ #
870
+ # @overload undelete_private_cloud(name: nil, request_id: nil)
871
+ # Pass arguments to `undelete_private_cloud` via keyword arguments. Note that at
872
+ # least one keyword argument is required. To specify no parameters, or to keep all
873
+ # the default parameter values, pass an empty Hash as a request object (see above).
874
+ #
875
+ # @param name [::String]
876
+ # Required. The resource name of the private cloud scheduled for deletion.
877
+ # Resource names are schemeless URIs that follow the conventions in
878
+ # https://cloud.google.com/apis/design/resource_names.
879
+ # For example:
880
+ # `projects/my-project/locations/us-west1-a/privateClouds/my-cloud`
881
+ # @param request_id [::String]
882
+ # Optional. The request ID must be a valid UUID with the exception that zero UUID is
883
+ # not supported (00000000-0000-0000-0000-000000000000).
884
+ #
885
+ # @yield [response, operation] Access the result along with the RPC operation
886
+ # @yieldparam response [::Gapic::Operation]
887
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
888
+ #
889
+ # @return [::Gapic::Operation]
890
+ #
891
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
892
+ #
893
+ # @example Basic example
894
+ # require "google/cloud/vmware_engine/v1"
895
+ #
896
+ # # Create a client object. The client can be reused for multiple calls.
897
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
898
+ #
899
+ # # Create a request. To set request fields, pass in keyword arguments.
900
+ # request = Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new
901
+ #
902
+ # # Call the undelete_private_cloud method.
903
+ # result = client.undelete_private_cloud request
904
+ #
905
+ # # The returned object is of type Gapic::Operation. You can use this
906
+ # # object to check the status of an operation, cancel it, or wait
907
+ # # for results. Here is how to block until completion:
908
+ # result.wait_until_done! timeout: 60
909
+ # if result.response?
910
+ # p result.response
911
+ # else
912
+ # puts "Error!"
913
+ # end
914
+ #
915
+ def undelete_private_cloud request, options = nil
916
+ raise ::ArgumentError, "request must be provided" if request.nil?
917
+
918
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest
919
+
920
+ # Converts hash and nil to an options object
921
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
922
+
923
+ # Customize the options with defaults
924
+ metadata = @config.rpcs.undelete_private_cloud.metadata.to_h
925
+
926
+ # Set x-goog-api-client and x-goog-user-project headers
927
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
928
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
929
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
930
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
931
+
932
+ header_params = {}
933
+ if request.name
934
+ header_params["name"] = request.name
935
+ end
936
+
937
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
938
+ metadata[:"x-goog-request-params"] ||= request_params_header
939
+
940
+ options.apply_defaults timeout: @config.rpcs.undelete_private_cloud.timeout,
941
+ metadata: metadata,
942
+ retry_policy: @config.rpcs.undelete_private_cloud.retry_policy
943
+
944
+ options.apply_defaults timeout: @config.timeout,
945
+ metadata: @config.metadata,
946
+ retry_policy: @config.retry_policy
947
+
948
+ @vmware_engine_stub.call_rpc :undelete_private_cloud, request, options: options do |response, operation|
949
+ response = ::Gapic::Operation.new response, @operations_client, options: options
950
+ yield response, operation if block_given?
951
+ return response
952
+ end
953
+ rescue ::GRPC::BadStatus => e
954
+ raise ::Google::Cloud::Error.from_error(e)
955
+ end
956
+
957
+ ##
958
+ # Lists `Cluster` resources in a given private cloud.
959
+ #
960
+ # @overload list_clusters(request, options = nil)
961
+ # Pass arguments to `list_clusters` via a request object, either of type
962
+ # {::Google::Cloud::VmwareEngine::V1::ListClustersRequest} or an equivalent Hash.
963
+ #
964
+ # @param request [::Google::Cloud::VmwareEngine::V1::ListClustersRequest, ::Hash]
965
+ # A request object representing the call parameters. Required. To specify no
966
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
967
+ # @param options [::Gapic::CallOptions, ::Hash]
968
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
969
+ #
970
+ # @overload list_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
971
+ # Pass arguments to `list_clusters` via keyword arguments. Note that at
972
+ # least one keyword argument is required. To specify no parameters, or to keep all
973
+ # the default parameter values, pass an empty Hash as a request object (see above).
974
+ #
975
+ # @param parent [::String]
976
+ # Required. The resource name of the private cloud to query for clusters.
977
+ # Resource names are schemeless URIs that follow the conventions in
978
+ # https://cloud.google.com/apis/design/resource_names.
979
+ # For example:
980
+ # `projects/my-project/locations/us-west1-a/privateClouds/my-cloud`
981
+ # @param page_size [::Integer]
982
+ # The maximum number of clusters to return in one page.
983
+ # The service may return fewer than this value.
984
+ # The maximum value is coerced to 1000.
985
+ # The default value of this field is 500.
986
+ # @param page_token [::String]
987
+ # A page token, received from a previous `ListClusters` call.
988
+ # Provide this to retrieve the subsequent page.
989
+ #
990
+ # When paginating, all other parameters provided to `ListClusters`
991
+ # must match the call that provided the page token.
992
+ # @param filter [::String]
993
+ # To filter on multiple expressions, provide each separate expression within
994
+ # parentheses. For example:
995
+ # ```
996
+ # (name = "example-cluster")
997
+ # (nodeCount = "3")
998
+ # ```
999
+ #
1000
+ # By default, each expression is an `AND` expression. However, you can
1001
+ # include `AND` and `OR` expressions explicitly. For example:
1002
+ # ```
1003
+ # (name = "example-cluster-1") AND
1004
+ # (createTime > "2021-04-12T08:15:10.40Z") OR
1005
+ # (name = "example-cluster-2")
1006
+ # ```
1007
+ # @param order_by [::String]
1008
+ # Sorts list results by a certain order. By default, returned results are
1009
+ # ordered by `name` in ascending order. You can also sort results in
1010
+ # descending order based on the `name` value using `orderBy="name desc"`.
1011
+ # Currently, only ordering by `name` is supported.
1012
+ #
1013
+ # @yield [response, operation] Access the result along with the RPC operation
1014
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Cluster>]
1015
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1016
+ #
1017
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Cluster>]
1018
+ #
1019
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1020
+ #
1021
+ # @example Basic example
1022
+ # require "google/cloud/vmware_engine/v1"
1023
+ #
1024
+ # # Create a client object. The client can be reused for multiple calls.
1025
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
1026
+ #
1027
+ # # Create a request. To set request fields, pass in keyword arguments.
1028
+ # request = Google::Cloud::VmwareEngine::V1::ListClustersRequest.new
1029
+ #
1030
+ # # Call the list_clusters method.
1031
+ # result = client.list_clusters request
1032
+ #
1033
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1034
+ # # iterate over all elements by calling #each, and the enumerable
1035
+ # # will lazily make API calls to fetch subsequent pages. Other
1036
+ # # methods are also available for managing paging directly.
1037
+ # result.each do |response|
1038
+ # # Each element is of type ::Google::Cloud::VmwareEngine::V1::Cluster.
1039
+ # p response
1040
+ # end
1041
+ #
1042
+ def list_clusters request, options = nil
1043
+ raise ::ArgumentError, "request must be provided" if request.nil?
1044
+
1045
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListClustersRequest
1046
+
1047
+ # Converts hash and nil to an options object
1048
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1049
+
1050
+ # Customize the options with defaults
1051
+ metadata = @config.rpcs.list_clusters.metadata.to_h
1052
+
1053
+ # Set x-goog-api-client and x-goog-user-project headers
1054
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1055
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1056
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
1057
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1058
+
1059
+ header_params = {}
1060
+ if request.parent
1061
+ header_params["parent"] = request.parent
1062
+ end
1063
+
1064
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1065
+ metadata[:"x-goog-request-params"] ||= request_params_header
1066
+
1067
+ options.apply_defaults timeout: @config.rpcs.list_clusters.timeout,
1068
+ metadata: metadata,
1069
+ retry_policy: @config.rpcs.list_clusters.retry_policy
1070
+
1071
+ options.apply_defaults timeout: @config.timeout,
1072
+ metadata: @config.metadata,
1073
+ retry_policy: @config.retry_policy
1074
+
1075
+ @vmware_engine_stub.call_rpc :list_clusters, request, options: options do |response, operation|
1076
+ response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_clusters, request, response, operation, options
1077
+ yield response, operation if block_given?
1078
+ return response
1079
+ end
1080
+ rescue ::GRPC::BadStatus => e
1081
+ raise ::Google::Cloud::Error.from_error(e)
1082
+ end
1083
+
1084
+ ##
1085
+ # Retrieves a `Cluster` resource by its resource name.
1086
+ #
1087
+ # @overload get_cluster(request, options = nil)
1088
+ # Pass arguments to `get_cluster` via a request object, either of type
1089
+ # {::Google::Cloud::VmwareEngine::V1::GetClusterRequest} or an equivalent Hash.
1090
+ #
1091
+ # @param request [::Google::Cloud::VmwareEngine::V1::GetClusterRequest, ::Hash]
1092
+ # A request object representing the call parameters. Required. To specify no
1093
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1094
+ # @param options [::Gapic::CallOptions, ::Hash]
1095
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1096
+ #
1097
+ # @overload get_cluster(name: nil)
1098
+ # Pass arguments to `get_cluster` via keyword arguments. Note that at
1099
+ # least one keyword argument is required. To specify no parameters, or to keep all
1100
+ # the default parameter values, pass an empty Hash as a request object (see above).
1101
+ #
1102
+ # @param name [::String]
1103
+ # Required. The cluster resource name to retrieve.
1104
+ # Resource names are schemeless URIs that follow the conventions in
1105
+ # https://cloud.google.com/apis/design/resource_names.
1106
+ # For example:
1107
+ # `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/clusters/my-cluster`
1108
+ #
1109
+ # @yield [response, operation] Access the result along with the RPC operation
1110
+ # @yieldparam response [::Google::Cloud::VmwareEngine::V1::Cluster]
1111
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1112
+ #
1113
+ # @return [::Google::Cloud::VmwareEngine::V1::Cluster]
1114
+ #
1115
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1116
+ #
1117
+ # @example Basic example
1118
+ # require "google/cloud/vmware_engine/v1"
1119
+ #
1120
+ # # Create a client object. The client can be reused for multiple calls.
1121
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
1122
+ #
1123
+ # # Create a request. To set request fields, pass in keyword arguments.
1124
+ # request = Google::Cloud::VmwareEngine::V1::GetClusterRequest.new
1125
+ #
1126
+ # # Call the get_cluster method.
1127
+ # result = client.get_cluster request
1128
+ #
1129
+ # # The returned object is of type Google::Cloud::VmwareEngine::V1::Cluster.
1130
+ # p result
1131
+ #
1132
+ def get_cluster request, options = nil
1133
+ raise ::ArgumentError, "request must be provided" if request.nil?
1134
+
1135
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetClusterRequest
1136
+
1137
+ # Converts hash and nil to an options object
1138
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1139
+
1140
+ # Customize the options with defaults
1141
+ metadata = @config.rpcs.get_cluster.metadata.to_h
1142
+
1143
+ # Set x-goog-api-client and x-goog-user-project headers
1144
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1145
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1146
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
1147
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1148
+
1149
+ header_params = {}
1150
+ if request.name
1151
+ header_params["name"] = request.name
1152
+ end
1153
+
1154
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1155
+ metadata[:"x-goog-request-params"] ||= request_params_header
1156
+
1157
+ options.apply_defaults timeout: @config.rpcs.get_cluster.timeout,
1158
+ metadata: metadata,
1159
+ retry_policy: @config.rpcs.get_cluster.retry_policy
1160
+
1161
+ options.apply_defaults timeout: @config.timeout,
1162
+ metadata: @config.metadata,
1163
+ retry_policy: @config.retry_policy
1164
+
1165
+ @vmware_engine_stub.call_rpc :get_cluster, request, options: options do |response, operation|
1166
+ yield response, operation if block_given?
1167
+ return response
1168
+ end
1169
+ rescue ::GRPC::BadStatus => e
1170
+ raise ::Google::Cloud::Error.from_error(e)
1171
+ end
1172
+
1173
+ ##
1174
+ # Creates a new cluster in a given private cloud.
1175
+ # Creating a new cluster provides additional nodes for
1176
+ # use in the parent private cloud and requires sufficient [node
1177
+ # quota](https://cloud.google.com/vmware-engine/quotas).
1178
+ #
1179
+ # @overload create_cluster(request, options = nil)
1180
+ # Pass arguments to `create_cluster` via a request object, either of type
1181
+ # {::Google::Cloud::VmwareEngine::V1::CreateClusterRequest} or an equivalent Hash.
1182
+ #
1183
+ # @param request [::Google::Cloud::VmwareEngine::V1::CreateClusterRequest, ::Hash]
1184
+ # A request object representing the call parameters. Required. To specify no
1185
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1186
+ # @param options [::Gapic::CallOptions, ::Hash]
1187
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1188
+ #
1189
+ # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
1190
+ # Pass arguments to `create_cluster` via keyword arguments. Note that at
1191
+ # least one keyword argument is required. To specify no parameters, or to keep all
1192
+ # the default parameter values, pass an empty Hash as a request object (see above).
1193
+ #
1194
+ # @param parent [::String]
1195
+ # Required. The resource name of the private cloud to create a new cluster
1196
+ # in. Resource names are schemeless URIs that follow the conventions in
1197
+ # https://cloud.google.com/apis/design/resource_names.
1198
+ # For example:
1199
+ # `projects/my-project/locations/us-west1-a/privateClouds/my-cloud`
1200
+ # @param cluster_id [::String]
1201
+ # Required. The user-provided identifier of the new `Cluster`.
1202
+ # This identifier must be unique among clusters within the parent and becomes
1203
+ # the final token in the name URI.
1204
+ # The identifier must meet the following requirements:
1205
+ #
1206
+ # * Only contains 1-63 alphanumeric characters and hyphens
1207
+ # * Begins with an alphabetical character
1208
+ # * Ends with a non-hyphen character
1209
+ # * Not formatted as a UUID
1210
+ # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
1211
+ # (section 3.5)
1212
+ # @param cluster [::Google::Cloud::VmwareEngine::V1::Cluster, ::Hash]
1213
+ # Required. The initial description of the new cluster.
1214
+ # @param request_id [::String]
1215
+ # Optional. The request ID must be a valid UUID with the exception that zero UUID is
1216
+ # not supported (00000000-0000-0000-0000-000000000000).
1217
+ # @param validate_only [::Boolean]
1218
+ # Optional. True if you want the request to be validated and not executed; false
1219
+ # otherwise.
1220
+ #
1221
+ # @yield [response, operation] Access the result along with the RPC operation
1222
+ # @yieldparam response [::Gapic::Operation]
1223
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1224
+ #
1225
+ # @return [::Gapic::Operation]
1226
+ #
1227
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1228
+ #
1229
+ # @example Basic example
1230
+ # require "google/cloud/vmware_engine/v1"
1231
+ #
1232
+ # # Create a client object. The client can be reused for multiple calls.
1233
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
1234
+ #
1235
+ # # Create a request. To set request fields, pass in keyword arguments.
1236
+ # request = Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new
1237
+ #
1238
+ # # Call the create_cluster method.
1239
+ # result = client.create_cluster request
1240
+ #
1241
+ # # The returned object is of type Gapic::Operation. You can use this
1242
+ # # object to check the status of an operation, cancel it, or wait
1243
+ # # for results. Here is how to block until completion:
1244
+ # result.wait_until_done! timeout: 60
1245
+ # if result.response?
1246
+ # p result.response
1247
+ # else
1248
+ # puts "Error!"
1249
+ # end
1250
+ #
1251
+ def create_cluster request, options = nil
1252
+ raise ::ArgumentError, "request must be provided" if request.nil?
1253
+
1254
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateClusterRequest
1255
+
1256
+ # Converts hash and nil to an options object
1257
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1258
+
1259
+ # Customize the options with defaults
1260
+ metadata = @config.rpcs.create_cluster.metadata.to_h
1261
+
1262
+ # Set x-goog-api-client and x-goog-user-project headers
1263
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1264
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1265
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
1266
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1267
+
1268
+ header_params = {}
1269
+ if request.parent
1270
+ header_params["parent"] = request.parent
1271
+ end
1272
+
1273
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1274
+ metadata[:"x-goog-request-params"] ||= request_params_header
1275
+
1276
+ options.apply_defaults timeout: @config.rpcs.create_cluster.timeout,
1277
+ metadata: metadata,
1278
+ retry_policy: @config.rpcs.create_cluster.retry_policy
1279
+
1280
+ options.apply_defaults timeout: @config.timeout,
1281
+ metadata: @config.metadata,
1282
+ retry_policy: @config.retry_policy
1283
+
1284
+ @vmware_engine_stub.call_rpc :create_cluster, request, options: options do |response, operation|
1285
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1286
+ yield response, operation if block_given?
1287
+ return response
1288
+ end
1289
+ rescue ::GRPC::BadStatus => e
1290
+ raise ::Google::Cloud::Error.from_error(e)
1291
+ end
1292
+
1293
+ ##
1294
+ # Modifies a `Cluster` resource. Only the following fields can be updated:
1295
+ # `node_type_configs.*.node_count`. Only fields specified in `updateMask` are
1296
+ # applied.
1297
+ #
1298
+ # During operation processing, the resource is temporarily in the `ACTIVE`
1299
+ # state before the operation fully completes. For that period of time, you
1300
+ # can't update the resource. Use the operation status to determine when the
1301
+ # processing fully completes.
1302
+ #
1303
+ # @overload update_cluster(request, options = nil)
1304
+ # Pass arguments to `update_cluster` via a request object, either of type
1305
+ # {::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest} or an equivalent Hash.
1306
+ #
1307
+ # @param request [::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest, ::Hash]
1308
+ # A request object representing the call parameters. Required. To specify no
1309
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1310
+ # @param options [::Gapic::CallOptions, ::Hash]
1311
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1312
+ #
1313
+ # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil, validate_only: nil)
1314
+ # Pass arguments to `update_cluster` via keyword arguments. Note that at
1315
+ # least one keyword argument is required. To specify no parameters, or to keep all
1316
+ # the default parameter values, pass an empty Hash as a request object (see above).
1317
+ #
1318
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1319
+ # Required. Field mask is used to specify the fields to be overwritten in the
1320
+ # `Cluster` resource by the update. The fields specified in the `updateMask`
1321
+ # are relative to the resource, not the full request. A field will be
1322
+ # overwritten if it is in the mask. If the user does not provide a mask then
1323
+ # all fields will be overwritten.
1324
+ # @param cluster [::Google::Cloud::VmwareEngine::V1::Cluster, ::Hash]
1325
+ # Required. The description of the cluster.
1326
+ # @param request_id [::String]
1327
+ # Optional. The request ID must be a valid UUID with the exception that
1328
+ # zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1329
+ # @param validate_only [::Boolean]
1330
+ # Optional. True if you want the request to be validated and not executed; false
1331
+ # otherwise.
1332
+ #
1333
+ # @yield [response, operation] Access the result along with the RPC operation
1334
+ # @yieldparam response [::Gapic::Operation]
1335
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1336
+ #
1337
+ # @return [::Gapic::Operation]
1338
+ #
1339
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1340
+ #
1341
+ # @example Basic example
1342
+ # require "google/cloud/vmware_engine/v1"
1343
+ #
1344
+ # # Create a client object. The client can be reused for multiple calls.
1345
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
1346
+ #
1347
+ # # Create a request. To set request fields, pass in keyword arguments.
1348
+ # request = Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new
1349
+ #
1350
+ # # Call the update_cluster method.
1351
+ # result = client.update_cluster request
1352
+ #
1353
+ # # The returned object is of type Gapic::Operation. You can use this
1354
+ # # object to check the status of an operation, cancel it, or wait
1355
+ # # for results. Here is how to block until completion:
1356
+ # result.wait_until_done! timeout: 60
1357
+ # if result.response?
1358
+ # p result.response
1359
+ # else
1360
+ # puts "Error!"
1361
+ # end
1362
+ #
1363
+ def update_cluster request, options = nil
1364
+ raise ::ArgumentError, "request must be provided" if request.nil?
1365
+
1366
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest
1367
+
1368
+ # Converts hash and nil to an options object
1369
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1370
+
1371
+ # Customize the options with defaults
1372
+ metadata = @config.rpcs.update_cluster.metadata.to_h
1373
+
1374
+ # Set x-goog-api-client and x-goog-user-project headers
1375
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1376
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1377
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
1378
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1379
+
1380
+ header_params = {}
1381
+ if request.cluster&.name
1382
+ header_params["cluster.name"] = request.cluster.name
1383
+ end
1384
+
1385
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1386
+ metadata[:"x-goog-request-params"] ||= request_params_header
1387
+
1388
+ options.apply_defaults timeout: @config.rpcs.update_cluster.timeout,
1389
+ metadata: metadata,
1390
+ retry_policy: @config.rpcs.update_cluster.retry_policy
1391
+
1392
+ options.apply_defaults timeout: @config.timeout,
1393
+ metadata: @config.metadata,
1394
+ retry_policy: @config.retry_policy
1395
+
1396
+ @vmware_engine_stub.call_rpc :update_cluster, request, options: options do |response, operation|
1397
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1398
+ yield response, operation if block_given?
1399
+ return response
1400
+ end
1401
+ rescue ::GRPC::BadStatus => e
1402
+ raise ::Google::Cloud::Error.from_error(e)
1403
+ end
1404
+
1405
+ ##
1406
+ # Deletes a `Cluster` resource. To avoid unintended data loss, migrate or
1407
+ # gracefully shut down any workloads running on the cluster before deletion.
1408
+ # You cannot delete the management cluster of a private cloud using this
1409
+ # method.
1410
+ #
1411
+ # @overload delete_cluster(request, options = nil)
1412
+ # Pass arguments to `delete_cluster` via a request object, either of type
1413
+ # {::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest} or an equivalent Hash.
1414
+ #
1415
+ # @param request [::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest, ::Hash]
1416
+ # A request object representing the call parameters. Required. To specify no
1417
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1418
+ # @param options [::Gapic::CallOptions, ::Hash]
1419
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1420
+ #
1421
+ # @overload delete_cluster(name: nil, request_id: nil)
1422
+ # Pass arguments to `delete_cluster` via keyword arguments. Note that at
1423
+ # least one keyword argument is required. To specify no parameters, or to keep all
1424
+ # the default parameter values, pass an empty Hash as a request object (see above).
1425
+ #
1426
+ # @param name [::String]
1427
+ # Required. The resource name of the cluster to delete.
1428
+ # Resource names are schemeless URIs that follow the conventions in
1429
+ # https://cloud.google.com/apis/design/resource_names.
1430
+ # For example:
1431
+ # `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/clusters/my-cluster`
1432
+ # @param request_id [::String]
1433
+ # Optional. The request ID must be a valid UUID with the exception that zero UUID is
1434
+ # not supported (00000000-0000-0000-0000-000000000000).
1435
+ #
1436
+ # @yield [response, operation] Access the result along with the RPC operation
1437
+ # @yieldparam response [::Gapic::Operation]
1438
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1439
+ #
1440
+ # @return [::Gapic::Operation]
1441
+ #
1442
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1443
+ #
1444
+ # @example Basic example
1445
+ # require "google/cloud/vmware_engine/v1"
1446
+ #
1447
+ # # Create a client object. The client can be reused for multiple calls.
1448
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
1449
+ #
1450
+ # # Create a request. To set request fields, pass in keyword arguments.
1451
+ # request = Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new
1452
+ #
1453
+ # # Call the delete_cluster method.
1454
+ # result = client.delete_cluster request
1455
+ #
1456
+ # # The returned object is of type Gapic::Operation. You can use this
1457
+ # # object to check the status of an operation, cancel it, or wait
1458
+ # # for results. Here is how to block until completion:
1459
+ # result.wait_until_done! timeout: 60
1460
+ # if result.response?
1461
+ # p result.response
1462
+ # else
1463
+ # puts "Error!"
1464
+ # end
1465
+ #
1466
+ def delete_cluster request, options = nil
1467
+ raise ::ArgumentError, "request must be provided" if request.nil?
1468
+
1469
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest
1470
+
1471
+ # Converts hash and nil to an options object
1472
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1473
+
1474
+ # Customize the options with defaults
1475
+ metadata = @config.rpcs.delete_cluster.metadata.to_h
1476
+
1477
+ # Set x-goog-api-client and x-goog-user-project headers
1478
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1479
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1480
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
1481
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1482
+
1483
+ header_params = {}
1484
+ if request.name
1485
+ header_params["name"] = request.name
1486
+ end
1487
+
1488
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1489
+ metadata[:"x-goog-request-params"] ||= request_params_header
1490
+
1491
+ options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout,
1492
+ metadata: metadata,
1493
+ retry_policy: @config.rpcs.delete_cluster.retry_policy
1494
+
1495
+ options.apply_defaults timeout: @config.timeout,
1496
+ metadata: @config.metadata,
1497
+ retry_policy: @config.retry_policy
1498
+
1499
+ @vmware_engine_stub.call_rpc :delete_cluster, request, options: options do |response, operation|
1500
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1501
+ yield response, operation if block_given?
1502
+ return response
1503
+ end
1504
+ rescue ::GRPC::BadStatus => e
1505
+ raise ::Google::Cloud::Error.from_error(e)
1506
+ end
1507
+
1508
+ ##
1509
+ # Lists subnets in a given private cloud.
1510
+ #
1511
+ # @overload list_subnets(request, options = nil)
1512
+ # Pass arguments to `list_subnets` via a request object, either of type
1513
+ # {::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest} or an equivalent Hash.
1514
+ #
1515
+ # @param request [::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest, ::Hash]
1516
+ # A request object representing the call parameters. Required. To specify no
1517
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1518
+ # @param options [::Gapic::CallOptions, ::Hash]
1519
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1520
+ #
1521
+ # @overload list_subnets(parent: nil, page_size: nil, page_token: nil)
1522
+ # Pass arguments to `list_subnets` via keyword arguments. Note that at
1523
+ # least one keyword argument is required. To specify no parameters, or to keep all
1524
+ # the default parameter values, pass an empty Hash as a request object (see above).
1525
+ #
1526
+ # @param parent [::String]
1527
+ # Required. The resource name of the private cloud to be queried for
1528
+ # subnets.
1529
+ # Resource names are schemeless URIs that follow the conventions in
1530
+ # https://cloud.google.com/apis/design/resource_names.
1531
+ # For example:
1532
+ # `projects/my-project/locations/us-west1-a/privateClouds/my-cloud`
1533
+ # @param page_size [::Integer]
1534
+ # The maximum number of subnets to return in one page.
1535
+ # The service may return fewer than this value.
1536
+ # The maximum value is coerced to 1000.
1537
+ # The default value of this field is 500.
1538
+ # @param page_token [::String]
1539
+ # A page token, received from a previous `ListSubnetsRequest` call.
1540
+ # Provide this to retrieve the subsequent page.
1541
+ #
1542
+ # When paginating, all other parameters provided to
1543
+ # `ListSubnetsRequest` must match the call that provided the page token.
1544
+ #
1545
+ # @yield [response, operation] Access the result along with the RPC operation
1546
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Subnet>]
1547
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1548
+ #
1549
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Subnet>]
1550
+ #
1551
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1552
+ #
1553
+ # @example Basic example
1554
+ # require "google/cloud/vmware_engine/v1"
1555
+ #
1556
+ # # Create a client object. The client can be reused for multiple calls.
1557
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
1558
+ #
1559
+ # # Create a request. To set request fields, pass in keyword arguments.
1560
+ # request = Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.new
1561
+ #
1562
+ # # Call the list_subnets method.
1563
+ # result = client.list_subnets request
1564
+ #
1565
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1566
+ # # iterate over all elements by calling #each, and the enumerable
1567
+ # # will lazily make API calls to fetch subsequent pages. Other
1568
+ # # methods are also available for managing paging directly.
1569
+ # result.each do |response|
1570
+ # # Each element is of type ::Google::Cloud::VmwareEngine::V1::Subnet.
1571
+ # p response
1572
+ # end
1573
+ #
1574
+ def list_subnets request, options = nil
1575
+ raise ::ArgumentError, "request must be provided" if request.nil?
1576
+
1577
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest
1578
+
1579
+ # Converts hash and nil to an options object
1580
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1581
+
1582
+ # Customize the options with defaults
1583
+ metadata = @config.rpcs.list_subnets.metadata.to_h
1584
+
1585
+ # Set x-goog-api-client and x-goog-user-project headers
1586
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1587
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1588
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
1589
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1590
+
1591
+ header_params = {}
1592
+ if request.parent
1593
+ header_params["parent"] = request.parent
1594
+ end
1595
+
1596
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1597
+ metadata[:"x-goog-request-params"] ||= request_params_header
1598
+
1599
+ options.apply_defaults timeout: @config.rpcs.list_subnets.timeout,
1600
+ metadata: metadata,
1601
+ retry_policy: @config.rpcs.list_subnets.retry_policy
1602
+
1603
+ options.apply_defaults timeout: @config.timeout,
1604
+ metadata: @config.metadata,
1605
+ retry_policy: @config.retry_policy
1606
+
1607
+ @vmware_engine_stub.call_rpc :list_subnets, request, options: options do |response, operation|
1608
+ response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_subnets, request, response, operation, options
1609
+ yield response, operation if block_given?
1610
+ return response
1611
+ end
1612
+ rescue ::GRPC::BadStatus => e
1613
+ raise ::Google::Cloud::Error.from_error(e)
1614
+ end
1615
+
1616
+ ##
1617
+ # Lists node types
1618
+ #
1619
+ # @overload list_node_types(request, options = nil)
1620
+ # Pass arguments to `list_node_types` via a request object, either of type
1621
+ # {::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest} or an equivalent Hash.
1622
+ #
1623
+ # @param request [::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest, ::Hash]
1624
+ # A request object representing the call parameters. Required. To specify no
1625
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1626
+ # @param options [::Gapic::CallOptions, ::Hash]
1627
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1628
+ #
1629
+ # @overload list_node_types(parent: nil, page_size: nil, page_token: nil, filter: nil)
1630
+ # Pass arguments to `list_node_types` via keyword arguments. Note that at
1631
+ # least one keyword argument is required. To specify no parameters, or to keep all
1632
+ # the default parameter values, pass an empty Hash as a request object (see above).
1633
+ #
1634
+ # @param parent [::String]
1635
+ # Required. The resource name of the location to be queried for node types.
1636
+ # Resource names are schemeless URIs that follow the conventions in
1637
+ # https://cloud.google.com/apis/design/resource_names.
1638
+ # For example:
1639
+ # `projects/my-project/locations/us-west1-a`
1640
+ # @param page_size [::Integer]
1641
+ # The maximum number of node types to return in one page.
1642
+ # The service may return fewer than this value.
1643
+ # The maximum value is coerced to 1000.
1644
+ # The default value of this field is 500.
1645
+ # @param page_token [::String]
1646
+ # A page token, received from a previous `ListNodeTypes` call.
1647
+ # Provide this to retrieve the subsequent page.
1648
+ #
1649
+ # When paginating, all other parameters provided to
1650
+ # `ListNodeTypes` must match the call that provided the page token.
1651
+ # @param filter [::String]
1652
+ # A filter expression that matches resources returned in the response.
1653
+ # The expression must specify the field name, a comparison
1654
+ # operator, and the value that you want to use for filtering. The value
1655
+ # must be a string, a number, or a boolean. The comparison operator
1656
+ # must be `=`, `!=`, `>`, or `<`.
1657
+ #
1658
+ # For example, if you are filtering a list of node types, you can
1659
+ # exclude the ones named `standard-72` by specifying
1660
+ # `name != "standard-72"`.
1661
+ #
1662
+ # To filter on multiple expressions, provide each separate expression within
1663
+ # parentheses. For example:
1664
+ # ```
1665
+ # (name = "standard-72")
1666
+ # (virtual_cpu_count > 2)
1667
+ # ```
1668
+ #
1669
+ # By default, each expression is an `AND` expression. However, you
1670
+ # can include `AND` and `OR` expressions explicitly.
1671
+ # For example:
1672
+ # ```
1673
+ # (name = "standard-96") AND
1674
+ # (virtual_cpu_count > 2) OR
1675
+ # (name = "standard-72")
1676
+ # ```
1677
+ #
1678
+ # @yield [response, operation] Access the result along with the RPC operation
1679
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NodeType>]
1680
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1681
+ #
1682
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NodeType>]
1683
+ #
1684
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1685
+ #
1686
+ # @example Basic example
1687
+ # require "google/cloud/vmware_engine/v1"
1688
+ #
1689
+ # # Create a client object. The client can be reused for multiple calls.
1690
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
1691
+ #
1692
+ # # Create a request. To set request fields, pass in keyword arguments.
1693
+ # request = Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.new
1694
+ #
1695
+ # # Call the list_node_types method.
1696
+ # result = client.list_node_types request
1697
+ #
1698
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1699
+ # # iterate over all elements by calling #each, and the enumerable
1700
+ # # will lazily make API calls to fetch subsequent pages. Other
1701
+ # # methods are also available for managing paging directly.
1702
+ # result.each do |response|
1703
+ # # Each element is of type ::Google::Cloud::VmwareEngine::V1::NodeType.
1704
+ # p response
1705
+ # end
1706
+ #
1707
+ def list_node_types request, options = nil
1708
+ raise ::ArgumentError, "request must be provided" if request.nil?
1709
+
1710
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest
1711
+
1712
+ # Converts hash and nil to an options object
1713
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1714
+
1715
+ # Customize the options with defaults
1716
+ metadata = @config.rpcs.list_node_types.metadata.to_h
1717
+
1718
+ # Set x-goog-api-client and x-goog-user-project headers
1719
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1720
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1721
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
1722
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1723
+
1724
+ header_params = {}
1725
+ if request.parent
1726
+ header_params["parent"] = request.parent
1727
+ end
1728
+
1729
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1730
+ metadata[:"x-goog-request-params"] ||= request_params_header
1731
+
1732
+ options.apply_defaults timeout: @config.rpcs.list_node_types.timeout,
1733
+ metadata: metadata,
1734
+ retry_policy: @config.rpcs.list_node_types.retry_policy
1735
+
1736
+ options.apply_defaults timeout: @config.timeout,
1737
+ metadata: @config.metadata,
1738
+ retry_policy: @config.retry_policy
1739
+
1740
+ @vmware_engine_stub.call_rpc :list_node_types, request, options: options do |response, operation|
1741
+ response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_node_types, request, response, operation, options
1742
+ yield response, operation if block_given?
1743
+ return response
1744
+ end
1745
+ rescue ::GRPC::BadStatus => e
1746
+ raise ::Google::Cloud::Error.from_error(e)
1747
+ end
1748
+
1749
+ ##
1750
+ # Gets details of a single `NodeType`.
1751
+ #
1752
+ # @overload get_node_type(request, options = nil)
1753
+ # Pass arguments to `get_node_type` via a request object, either of type
1754
+ # {::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest} or an equivalent Hash.
1755
+ #
1756
+ # @param request [::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest, ::Hash]
1757
+ # A request object representing the call parameters. Required. To specify no
1758
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1759
+ # @param options [::Gapic::CallOptions, ::Hash]
1760
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1761
+ #
1762
+ # @overload get_node_type(name: nil)
1763
+ # Pass arguments to `get_node_type` via keyword arguments. Note that at
1764
+ # least one keyword argument is required. To specify no parameters, or to keep all
1765
+ # the default parameter values, pass an empty Hash as a request object (see above).
1766
+ #
1767
+ # @param name [::String]
1768
+ # Required. The resource name of the node type to retrieve.
1769
+ # Resource names are schemeless URIs that follow the conventions in
1770
+ # https://cloud.google.com/apis/design/resource_names.
1771
+ # For example:
1772
+ # `projects/my-proj/locations/us-west1-a/nodeTypes/standard-72`
1773
+ #
1774
+ # @yield [response, operation] Access the result along with the RPC operation
1775
+ # @yieldparam response [::Google::Cloud::VmwareEngine::V1::NodeType]
1776
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1777
+ #
1778
+ # @return [::Google::Cloud::VmwareEngine::V1::NodeType]
1779
+ #
1780
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1781
+ #
1782
+ # @example Basic example
1783
+ # require "google/cloud/vmware_engine/v1"
1784
+ #
1785
+ # # Create a client object. The client can be reused for multiple calls.
1786
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
1787
+ #
1788
+ # # Create a request. To set request fields, pass in keyword arguments.
1789
+ # request = Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.new
1790
+ #
1791
+ # # Call the get_node_type method.
1792
+ # result = client.get_node_type request
1793
+ #
1794
+ # # The returned object is of type Google::Cloud::VmwareEngine::V1::NodeType.
1795
+ # p result
1796
+ #
1797
+ def get_node_type request, options = nil
1798
+ raise ::ArgumentError, "request must be provided" if request.nil?
1799
+
1800
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest
1801
+
1802
+ # Converts hash and nil to an options object
1803
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1804
+
1805
+ # Customize the options with defaults
1806
+ metadata = @config.rpcs.get_node_type.metadata.to_h
1807
+
1808
+ # Set x-goog-api-client and x-goog-user-project headers
1809
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1810
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1811
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
1812
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1813
+
1814
+ header_params = {}
1815
+ if request.name
1816
+ header_params["name"] = request.name
1817
+ end
1818
+
1819
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1820
+ metadata[:"x-goog-request-params"] ||= request_params_header
1821
+
1822
+ options.apply_defaults timeout: @config.rpcs.get_node_type.timeout,
1823
+ metadata: metadata,
1824
+ retry_policy: @config.rpcs.get_node_type.retry_policy
1825
+
1826
+ options.apply_defaults timeout: @config.timeout,
1827
+ metadata: @config.metadata,
1828
+ retry_policy: @config.retry_policy
1829
+
1830
+ @vmware_engine_stub.call_rpc :get_node_type, request, options: options do |response, operation|
1831
+ yield response, operation if block_given?
1832
+ return response
1833
+ end
1834
+ rescue ::GRPC::BadStatus => e
1835
+ raise ::Google::Cloud::Error.from_error(e)
1836
+ end
1837
+
1838
+ ##
1839
+ # Gets details of credentials for NSX appliance.
1840
+ #
1841
+ # @overload show_nsx_credentials(request, options = nil)
1842
+ # Pass arguments to `show_nsx_credentials` via a request object, either of type
1843
+ # {::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest} or an equivalent Hash.
1844
+ #
1845
+ # @param request [::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest, ::Hash]
1846
+ # A request object representing the call parameters. Required. To specify no
1847
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1848
+ # @param options [::Gapic::CallOptions, ::Hash]
1849
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1850
+ #
1851
+ # @overload show_nsx_credentials(private_cloud: nil)
1852
+ # Pass arguments to `show_nsx_credentials` via keyword arguments. Note that at
1853
+ # least one keyword argument is required. To specify no parameters, or to keep all
1854
+ # the default parameter values, pass an empty Hash as a request object (see above).
1855
+ #
1856
+ # @param private_cloud [::String]
1857
+ # Required. The resource name of the private cloud
1858
+ # to be queried for credentials.
1859
+ # Resource names are schemeless URIs that follow the conventions in
1860
+ # https://cloud.google.com/apis/design/resource_names.
1861
+ # For example:
1862
+ # `projects/my-project/locations/us-west1-a/privateClouds/my-cloud`
1863
+ #
1864
+ # @yield [response, operation] Access the result along with the RPC operation
1865
+ # @yieldparam response [::Google::Cloud::VmwareEngine::V1::Credentials]
1866
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1867
+ #
1868
+ # @return [::Google::Cloud::VmwareEngine::V1::Credentials]
1869
+ #
1870
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1871
+ #
1872
+ # @example Basic example
1873
+ # require "google/cloud/vmware_engine/v1"
1874
+ #
1875
+ # # Create a client object. The client can be reused for multiple calls.
1876
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
1877
+ #
1878
+ # # Create a request. To set request fields, pass in keyword arguments.
1879
+ # request = Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new
1880
+ #
1881
+ # # Call the show_nsx_credentials method.
1882
+ # result = client.show_nsx_credentials request
1883
+ #
1884
+ # # The returned object is of type Google::Cloud::VmwareEngine::V1::Credentials.
1885
+ # p result
1886
+ #
1887
+ def show_nsx_credentials request, options = nil
1888
+ raise ::ArgumentError, "request must be provided" if request.nil?
1889
+
1890
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest
1891
+
1892
+ # Converts hash and nil to an options object
1893
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1894
+
1895
+ # Customize the options with defaults
1896
+ metadata = @config.rpcs.show_nsx_credentials.metadata.to_h
1897
+
1898
+ # Set x-goog-api-client and x-goog-user-project headers
1899
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1900
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1901
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
1902
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1903
+
1904
+ header_params = {}
1905
+ if request.private_cloud
1906
+ header_params["private_cloud"] = request.private_cloud
1907
+ end
1908
+
1909
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1910
+ metadata[:"x-goog-request-params"] ||= request_params_header
1911
+
1912
+ options.apply_defaults timeout: @config.rpcs.show_nsx_credentials.timeout,
1913
+ metadata: metadata,
1914
+ retry_policy: @config.rpcs.show_nsx_credentials.retry_policy
1915
+
1916
+ options.apply_defaults timeout: @config.timeout,
1917
+ metadata: @config.metadata,
1918
+ retry_policy: @config.retry_policy
1919
+
1920
+ @vmware_engine_stub.call_rpc :show_nsx_credentials, request, options: options do |response, operation|
1921
+ yield response, operation if block_given?
1922
+ return response
1923
+ end
1924
+ rescue ::GRPC::BadStatus => e
1925
+ raise ::Google::Cloud::Error.from_error(e)
1926
+ end
1927
+
1928
+ ##
1929
+ # Gets details of credentials for Vcenter appliance.
1930
+ #
1931
+ # @overload show_vcenter_credentials(request, options = nil)
1932
+ # Pass arguments to `show_vcenter_credentials` via a request object, either of type
1933
+ # {::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest} or an equivalent Hash.
1934
+ #
1935
+ # @param request [::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest, ::Hash]
1936
+ # A request object representing the call parameters. Required. To specify no
1937
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1938
+ # @param options [::Gapic::CallOptions, ::Hash]
1939
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1940
+ #
1941
+ # @overload show_vcenter_credentials(private_cloud: nil)
1942
+ # Pass arguments to `show_vcenter_credentials` via keyword arguments. Note that at
1943
+ # least one keyword argument is required. To specify no parameters, or to keep all
1944
+ # the default parameter values, pass an empty Hash as a request object (see above).
1945
+ #
1946
+ # @param private_cloud [::String]
1947
+ # Required. The resource name of the private cloud
1948
+ # to be queried for credentials.
1949
+ # Resource names are schemeless URIs that follow the conventions in
1950
+ # https://cloud.google.com/apis/design/resource_names.
1951
+ # For example:
1952
+ # `projects/my-project/locations/us-west1-a/privateClouds/my-cloud`
1953
+ #
1954
+ # @yield [response, operation] Access the result along with the RPC operation
1955
+ # @yieldparam response [::Google::Cloud::VmwareEngine::V1::Credentials]
1956
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1957
+ #
1958
+ # @return [::Google::Cloud::VmwareEngine::V1::Credentials]
1959
+ #
1960
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1961
+ #
1962
+ # @example Basic example
1963
+ # require "google/cloud/vmware_engine/v1"
1964
+ #
1965
+ # # Create a client object. The client can be reused for multiple calls.
1966
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
1967
+ #
1968
+ # # Create a request. To set request fields, pass in keyword arguments.
1969
+ # request = Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new
1970
+ #
1971
+ # # Call the show_vcenter_credentials method.
1972
+ # result = client.show_vcenter_credentials request
1973
+ #
1974
+ # # The returned object is of type Google::Cloud::VmwareEngine::V1::Credentials.
1975
+ # p result
1976
+ #
1977
+ def show_vcenter_credentials request, options = nil
1978
+ raise ::ArgumentError, "request must be provided" if request.nil?
1979
+
1980
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest
1981
+
1982
+ # Converts hash and nil to an options object
1983
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1984
+
1985
+ # Customize the options with defaults
1986
+ metadata = @config.rpcs.show_vcenter_credentials.metadata.to_h
1987
+
1988
+ # Set x-goog-api-client and x-goog-user-project headers
1989
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1990
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1991
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
1992
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1993
+
1994
+ header_params = {}
1995
+ if request.private_cloud
1996
+ header_params["private_cloud"] = request.private_cloud
1997
+ end
1998
+
1999
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2000
+ metadata[:"x-goog-request-params"] ||= request_params_header
2001
+
2002
+ options.apply_defaults timeout: @config.rpcs.show_vcenter_credentials.timeout,
2003
+ metadata: metadata,
2004
+ retry_policy: @config.rpcs.show_vcenter_credentials.retry_policy
2005
+
2006
+ options.apply_defaults timeout: @config.timeout,
2007
+ metadata: @config.metadata,
2008
+ retry_policy: @config.retry_policy
2009
+
2010
+ @vmware_engine_stub.call_rpc :show_vcenter_credentials, request, options: options do |response, operation|
2011
+ yield response, operation if block_given?
2012
+ return response
2013
+ end
2014
+ rescue ::GRPC::BadStatus => e
2015
+ raise ::Google::Cloud::Error.from_error(e)
2016
+ end
2017
+
2018
+ ##
2019
+ # Resets credentials of the NSX appliance.
2020
+ #
2021
+ # @overload reset_nsx_credentials(request, options = nil)
2022
+ # Pass arguments to `reset_nsx_credentials` via a request object, either of type
2023
+ # {::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest} or an equivalent Hash.
2024
+ #
2025
+ # @param request [::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest, ::Hash]
2026
+ # A request object representing the call parameters. Required. To specify no
2027
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2028
+ # @param options [::Gapic::CallOptions, ::Hash]
2029
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2030
+ #
2031
+ # @overload reset_nsx_credentials(private_cloud: nil, request_id: nil)
2032
+ # Pass arguments to `reset_nsx_credentials` via keyword arguments. Note that at
2033
+ # least one keyword argument is required. To specify no parameters, or to keep all
2034
+ # the default parameter values, pass an empty Hash as a request object (see above).
2035
+ #
2036
+ # @param private_cloud [::String]
2037
+ # Required. The resource name of the private cloud
2038
+ # to reset credentials for.
2039
+ # Resource names are schemeless URIs that follow the conventions in
2040
+ # https://cloud.google.com/apis/design/resource_names.
2041
+ # For example:
2042
+ # `projects/my-project/locations/us-west1-a/privateClouds/my-cloud`
2043
+ # @param request_id [::String]
2044
+ # Optional. A request ID to identify requests. Specify a unique request ID
2045
+ # so that if you must retry your request, the server will know to ignore
2046
+ # the request if it has already been completed. The server guarantees that a
2047
+ # request doesn't result in creation of duplicate commitments for at least 60
2048
+ # minutes.
2049
+ #
2050
+ # For example, consider a situation where you make an initial request and the
2051
+ # request times out. If you make the request again with the same request
2052
+ # ID, the server can check if original operation with the same request ID
2053
+ # was received, and if so, will ignore the second request. This prevents
2054
+ # clients from accidentally creating duplicate commitments.
2055
+ #
2056
+ # The request ID must be a valid UUID with the exception that zero UUID is
2057
+ # not supported (00000000-0000-0000-0000-000000000000).
2058
+ #
2059
+ # @yield [response, operation] Access the result along with the RPC operation
2060
+ # @yieldparam response [::Gapic::Operation]
2061
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2062
+ #
2063
+ # @return [::Gapic::Operation]
2064
+ #
2065
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2066
+ #
2067
+ # @example Basic example
2068
+ # require "google/cloud/vmware_engine/v1"
2069
+ #
2070
+ # # Create a client object. The client can be reused for multiple calls.
2071
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
2072
+ #
2073
+ # # Create a request. To set request fields, pass in keyword arguments.
2074
+ # request = Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new
2075
+ #
2076
+ # # Call the reset_nsx_credentials method.
2077
+ # result = client.reset_nsx_credentials request
2078
+ #
2079
+ # # The returned object is of type Gapic::Operation. You can use this
2080
+ # # object to check the status of an operation, cancel it, or wait
2081
+ # # for results. Here is how to block until completion:
2082
+ # result.wait_until_done! timeout: 60
2083
+ # if result.response?
2084
+ # p result.response
2085
+ # else
2086
+ # puts "Error!"
2087
+ # end
2088
+ #
2089
+ def reset_nsx_credentials request, options = nil
2090
+ raise ::ArgumentError, "request must be provided" if request.nil?
2091
+
2092
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest
2093
+
2094
+ # Converts hash and nil to an options object
2095
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2096
+
2097
+ # Customize the options with defaults
2098
+ metadata = @config.rpcs.reset_nsx_credentials.metadata.to_h
2099
+
2100
+ # Set x-goog-api-client and x-goog-user-project headers
2101
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2102
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2103
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
2104
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2105
+
2106
+ header_params = {}
2107
+ if request.private_cloud
2108
+ header_params["private_cloud"] = request.private_cloud
2109
+ end
2110
+
2111
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2112
+ metadata[:"x-goog-request-params"] ||= request_params_header
2113
+
2114
+ options.apply_defaults timeout: @config.rpcs.reset_nsx_credentials.timeout,
2115
+ metadata: metadata,
2116
+ retry_policy: @config.rpcs.reset_nsx_credentials.retry_policy
2117
+
2118
+ options.apply_defaults timeout: @config.timeout,
2119
+ metadata: @config.metadata,
2120
+ retry_policy: @config.retry_policy
2121
+
2122
+ @vmware_engine_stub.call_rpc :reset_nsx_credentials, request, options: options do |response, operation|
2123
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2124
+ yield response, operation if block_given?
2125
+ return response
2126
+ end
2127
+ rescue ::GRPC::BadStatus => e
2128
+ raise ::Google::Cloud::Error.from_error(e)
2129
+ end
2130
+
2131
+ ##
2132
+ # Resets credentials of the Vcenter appliance.
2133
+ #
2134
+ # @overload reset_vcenter_credentials(request, options = nil)
2135
+ # Pass arguments to `reset_vcenter_credentials` via a request object, either of type
2136
+ # {::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest} or an equivalent Hash.
2137
+ #
2138
+ # @param request [::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest, ::Hash]
2139
+ # A request object representing the call parameters. Required. To specify no
2140
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2141
+ # @param options [::Gapic::CallOptions, ::Hash]
2142
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2143
+ #
2144
+ # @overload reset_vcenter_credentials(private_cloud: nil, request_id: nil)
2145
+ # Pass arguments to `reset_vcenter_credentials` via keyword arguments. Note that at
2146
+ # least one keyword argument is required. To specify no parameters, or to keep all
2147
+ # the default parameter values, pass an empty Hash as a request object (see above).
2148
+ #
2149
+ # @param private_cloud [::String]
2150
+ # Required. The resource name of the private cloud
2151
+ # to reset credentials for.
2152
+ # Resource names are schemeless URIs that follow the conventions in
2153
+ # https://cloud.google.com/apis/design/resource_names.
2154
+ # For example:
2155
+ # `projects/my-project/locations/us-west1-a/privateClouds/my-cloud`
2156
+ # @param request_id [::String]
2157
+ # Optional. A request ID to identify requests. Specify a unique request ID
2158
+ # so that if you must retry your request, the server will know to ignore
2159
+ # the request if it has already been completed. The server guarantees that a
2160
+ # request doesn't result in creation of duplicate commitments for at least 60
2161
+ # minutes.
2162
+ #
2163
+ # For example, consider a situation where you make an initial request and the
2164
+ # request times out. If you make the request again with the same request
2165
+ # ID, the server can check if original operation with the same request ID
2166
+ # was received, and if so, will ignore the second request. This prevents
2167
+ # clients from accidentally creating duplicate commitments.
2168
+ #
2169
+ # The request ID must be a valid UUID with the exception that zero UUID is
2170
+ # not supported (00000000-0000-0000-0000-000000000000).
2171
+ #
2172
+ # @yield [response, operation] Access the result along with the RPC operation
2173
+ # @yieldparam response [::Gapic::Operation]
2174
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2175
+ #
2176
+ # @return [::Gapic::Operation]
2177
+ #
2178
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2179
+ #
2180
+ # @example Basic example
2181
+ # require "google/cloud/vmware_engine/v1"
2182
+ #
2183
+ # # Create a client object. The client can be reused for multiple calls.
2184
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
2185
+ #
2186
+ # # Create a request. To set request fields, pass in keyword arguments.
2187
+ # request = Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new
2188
+ #
2189
+ # # Call the reset_vcenter_credentials method.
2190
+ # result = client.reset_vcenter_credentials request
2191
+ #
2192
+ # # The returned object is of type Gapic::Operation. You can use this
2193
+ # # object to check the status of an operation, cancel it, or wait
2194
+ # # for results. Here is how to block until completion:
2195
+ # result.wait_until_done! timeout: 60
2196
+ # if result.response?
2197
+ # p result.response
2198
+ # else
2199
+ # puts "Error!"
2200
+ # end
2201
+ #
2202
+ def reset_vcenter_credentials request, options = nil
2203
+ raise ::ArgumentError, "request must be provided" if request.nil?
2204
+
2205
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest
2206
+
2207
+ # Converts hash and nil to an options object
2208
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2209
+
2210
+ # Customize the options with defaults
2211
+ metadata = @config.rpcs.reset_vcenter_credentials.metadata.to_h
2212
+
2213
+ # Set x-goog-api-client and x-goog-user-project headers
2214
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2215
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2216
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
2217
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2218
+
2219
+ header_params = {}
2220
+ if request.private_cloud
2221
+ header_params["private_cloud"] = request.private_cloud
2222
+ end
2223
+
2224
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2225
+ metadata[:"x-goog-request-params"] ||= request_params_header
2226
+
2227
+ options.apply_defaults timeout: @config.rpcs.reset_vcenter_credentials.timeout,
2228
+ metadata: metadata,
2229
+ retry_policy: @config.rpcs.reset_vcenter_credentials.retry_policy
2230
+
2231
+ options.apply_defaults timeout: @config.timeout,
2232
+ metadata: @config.metadata,
2233
+ retry_policy: @config.retry_policy
2234
+
2235
+ @vmware_engine_stub.call_rpc :reset_vcenter_credentials, request, options: options do |response, operation|
2236
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2237
+ yield response, operation if block_given?
2238
+ return response
2239
+ end
2240
+ rescue ::GRPC::BadStatus => e
2241
+ raise ::Google::Cloud::Error.from_error(e)
2242
+ end
2243
+
2244
+ ##
2245
+ # Creates a new HCX activation key in a given private cloud.
2246
+ #
2247
+ # @overload create_hcx_activation_key(request, options = nil)
2248
+ # Pass arguments to `create_hcx_activation_key` via a request object, either of type
2249
+ # {::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest} or an equivalent Hash.
2250
+ #
2251
+ # @param request [::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest, ::Hash]
2252
+ # A request object representing the call parameters. Required. To specify no
2253
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2254
+ # @param options [::Gapic::CallOptions, ::Hash]
2255
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2256
+ #
2257
+ # @overload create_hcx_activation_key(parent: nil, hcx_activation_key: nil, hcx_activation_key_id: nil, request_id: nil)
2258
+ # Pass arguments to `create_hcx_activation_key` via keyword arguments. Note that at
2259
+ # least one keyword argument is required. To specify no parameters, or to keep all
2260
+ # the default parameter values, pass an empty Hash as a request object (see above).
2261
+ #
2262
+ # @param parent [::String]
2263
+ # Required. The resource name of the private cloud to create the key for.
2264
+ # Resource names are schemeless URIs that follow the conventions in
2265
+ # https://cloud.google.com/apis/design/resource_names.
2266
+ # For example:
2267
+ # `projects/my-project/locations/us-central1/privateClouds/my-cloud`
2268
+ # @param hcx_activation_key [::Google::Cloud::VmwareEngine::V1::HcxActivationKey, ::Hash]
2269
+ # Required. The initial description of a new HCX activation key. When
2270
+ # creating a new key, this field must be an empty object.
2271
+ # @param hcx_activation_key_id [::String]
2272
+ # Required. The user-provided identifier of the `HcxActivationKey` to be
2273
+ # created. This identifier must be unique among `HcxActivationKey` resources
2274
+ # within the parent and becomes the final token in the name URI.
2275
+ # The identifier must meet the following requirements:
2276
+ #
2277
+ # * Only contains 1-63 alphanumeric characters and hyphens
2278
+ # * Begins with an alphabetical character
2279
+ # * Ends with a non-hyphen character
2280
+ # * Not formatted as a UUID
2281
+ # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
2282
+ # (section 3.5)
2283
+ # @param request_id [::String]
2284
+ # A request ID to identify requests. Specify a unique request ID
2285
+ # so that if you must retry your request, the server will know to ignore
2286
+ # the request if it has already been completed. The server guarantees that a
2287
+ # request doesn't result in creation of duplicate commitments for at least 60
2288
+ # minutes.
2289
+ #
2290
+ # For example, consider a situation where you make an initial request and the
2291
+ # request times out. If you make the request again with the same request ID,
2292
+ # the server can check if original operation with the same request ID was
2293
+ # received, and if so, will ignore the second request. This prevents clients
2294
+ # from accidentally creating duplicate commitments.
2295
+ #
2296
+ # The request ID must be a valid UUID with the exception that zero UUID is
2297
+ # not supported (00000000-0000-0000-0000-000000000000).
2298
+ #
2299
+ # @yield [response, operation] Access the result along with the RPC operation
2300
+ # @yieldparam response [::Gapic::Operation]
2301
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2302
+ #
2303
+ # @return [::Gapic::Operation]
2304
+ #
2305
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2306
+ #
2307
+ # @example Basic example
2308
+ # require "google/cloud/vmware_engine/v1"
2309
+ #
2310
+ # # Create a client object. The client can be reused for multiple calls.
2311
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
2312
+ #
2313
+ # # Create a request. To set request fields, pass in keyword arguments.
2314
+ # request = Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new
2315
+ #
2316
+ # # Call the create_hcx_activation_key method.
2317
+ # result = client.create_hcx_activation_key request
2318
+ #
2319
+ # # The returned object is of type Gapic::Operation. You can use this
2320
+ # # object to check the status of an operation, cancel it, or wait
2321
+ # # for results. Here is how to block until completion:
2322
+ # result.wait_until_done! timeout: 60
2323
+ # if result.response?
2324
+ # p result.response
2325
+ # else
2326
+ # puts "Error!"
2327
+ # end
2328
+ #
2329
+ def create_hcx_activation_key request, options = nil
2330
+ raise ::ArgumentError, "request must be provided" if request.nil?
2331
+
2332
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest
2333
+
2334
+ # Converts hash and nil to an options object
2335
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2336
+
2337
+ # Customize the options with defaults
2338
+ metadata = @config.rpcs.create_hcx_activation_key.metadata.to_h
2339
+
2340
+ # Set x-goog-api-client and x-goog-user-project headers
2341
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2342
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2343
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
2344
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2345
+
2346
+ header_params = {}
2347
+ if request.parent
2348
+ header_params["parent"] = request.parent
2349
+ end
2350
+
2351
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2352
+ metadata[:"x-goog-request-params"] ||= request_params_header
2353
+
2354
+ options.apply_defaults timeout: @config.rpcs.create_hcx_activation_key.timeout,
2355
+ metadata: metadata,
2356
+ retry_policy: @config.rpcs.create_hcx_activation_key.retry_policy
2357
+
2358
+ options.apply_defaults timeout: @config.timeout,
2359
+ metadata: @config.metadata,
2360
+ retry_policy: @config.retry_policy
2361
+
2362
+ @vmware_engine_stub.call_rpc :create_hcx_activation_key, request, options: options do |response, operation|
2363
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2364
+ yield response, operation if block_given?
2365
+ return response
2366
+ end
2367
+ rescue ::GRPC::BadStatus => e
2368
+ raise ::Google::Cloud::Error.from_error(e)
2369
+ end
2370
+
2371
+ ##
2372
+ # Lists `HcxActivationKey` resources in a given private cloud.
2373
+ #
2374
+ # @overload list_hcx_activation_keys(request, options = nil)
2375
+ # Pass arguments to `list_hcx_activation_keys` via a request object, either of type
2376
+ # {::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest} or an equivalent Hash.
2377
+ #
2378
+ # @param request [::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest, ::Hash]
2379
+ # A request object representing the call parameters. Required. To specify no
2380
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2381
+ # @param options [::Gapic::CallOptions, ::Hash]
2382
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2383
+ #
2384
+ # @overload list_hcx_activation_keys(parent: nil, page_size: nil, page_token: nil)
2385
+ # Pass arguments to `list_hcx_activation_keys` via keyword arguments. Note that at
2386
+ # least one keyword argument is required. To specify no parameters, or to keep all
2387
+ # the default parameter values, pass an empty Hash as a request object (see above).
2388
+ #
2389
+ # @param parent [::String]
2390
+ # Required. The resource name of the private cloud
2391
+ # to be queried for HCX activation keys.
2392
+ # Resource names are schemeless URIs that follow the conventions in
2393
+ # https://cloud.google.com/apis/design/resource_names.
2394
+ # For example:
2395
+ # `projects/my-project/locations/us-central1/privateClouds/my-cloud`
2396
+ # @param page_size [::Integer]
2397
+ # The maximum number of HCX activation keys to return in one page.
2398
+ # The service may return fewer than this value.
2399
+ # The maximum value is coerced to 1000.
2400
+ # The default value of this field is 500.
2401
+ # @param page_token [::String]
2402
+ # A page token, received from a previous `ListHcxActivationKeys` call.
2403
+ # Provide this to retrieve the subsequent page.
2404
+ #
2405
+ # When paginating, all other parameters provided to
2406
+ # `ListHcxActivationKeys` must match the call that provided the page
2407
+ # token.
2408
+ #
2409
+ # @yield [response, operation] Access the result along with the RPC operation
2410
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::HcxActivationKey>]
2411
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2412
+ #
2413
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::HcxActivationKey>]
2414
+ #
2415
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2416
+ #
2417
+ # @example Basic example
2418
+ # require "google/cloud/vmware_engine/v1"
2419
+ #
2420
+ # # Create a client object. The client can be reused for multiple calls.
2421
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
2422
+ #
2423
+ # # Create a request. To set request fields, pass in keyword arguments.
2424
+ # request = Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.new
2425
+ #
2426
+ # # Call the list_hcx_activation_keys method.
2427
+ # result = client.list_hcx_activation_keys request
2428
+ #
2429
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2430
+ # # iterate over all elements by calling #each, and the enumerable
2431
+ # # will lazily make API calls to fetch subsequent pages. Other
2432
+ # # methods are also available for managing paging directly.
2433
+ # result.each do |response|
2434
+ # # Each element is of type ::Google::Cloud::VmwareEngine::V1::HcxActivationKey.
2435
+ # p response
2436
+ # end
2437
+ #
2438
+ def list_hcx_activation_keys request, options = nil
2439
+ raise ::ArgumentError, "request must be provided" if request.nil?
2440
+
2441
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest
2442
+
2443
+ # Converts hash and nil to an options object
2444
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2445
+
2446
+ # Customize the options with defaults
2447
+ metadata = @config.rpcs.list_hcx_activation_keys.metadata.to_h
2448
+
2449
+ # Set x-goog-api-client and x-goog-user-project headers
2450
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2451
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2452
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
2453
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2454
+
2455
+ header_params = {}
2456
+ if request.parent
2457
+ header_params["parent"] = request.parent
2458
+ end
2459
+
2460
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2461
+ metadata[:"x-goog-request-params"] ||= request_params_header
2462
+
2463
+ options.apply_defaults timeout: @config.rpcs.list_hcx_activation_keys.timeout,
2464
+ metadata: metadata,
2465
+ retry_policy: @config.rpcs.list_hcx_activation_keys.retry_policy
2466
+
2467
+ options.apply_defaults timeout: @config.timeout,
2468
+ metadata: @config.metadata,
2469
+ retry_policy: @config.retry_policy
2470
+
2471
+ @vmware_engine_stub.call_rpc :list_hcx_activation_keys, request, options: options do |response, operation|
2472
+ response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_hcx_activation_keys, request, response, operation, options
2473
+ yield response, operation if block_given?
2474
+ return response
2475
+ end
2476
+ rescue ::GRPC::BadStatus => e
2477
+ raise ::Google::Cloud::Error.from_error(e)
2478
+ end
2479
+
2480
+ ##
2481
+ # Retrieves a `HcxActivationKey` resource by its resource name.
2482
+ #
2483
+ # @overload get_hcx_activation_key(request, options = nil)
2484
+ # Pass arguments to `get_hcx_activation_key` via a request object, either of type
2485
+ # {::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest} or an equivalent Hash.
2486
+ #
2487
+ # @param request [::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest, ::Hash]
2488
+ # A request object representing the call parameters. Required. To specify no
2489
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2490
+ # @param options [::Gapic::CallOptions, ::Hash]
2491
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2492
+ #
2493
+ # @overload get_hcx_activation_key(name: nil)
2494
+ # Pass arguments to `get_hcx_activation_key` via keyword arguments. Note that at
2495
+ # least one keyword argument is required. To specify no parameters, or to keep all
2496
+ # the default parameter values, pass an empty Hash as a request object (see above).
2497
+ #
2498
+ # @param name [::String]
2499
+ # Required. The resource name of the HCX activation key to retrieve.
2500
+ # Resource names are schemeless URIs that follow the conventions in
2501
+ # https://cloud.google.com/apis/design/resource_names.
2502
+ # For example:
2503
+ # `projects/my-project/locations/us-west1/privateClouds/my-cloud/hcxActivationKeys/my-key`
2504
+ #
2505
+ # @yield [response, operation] Access the result along with the RPC operation
2506
+ # @yieldparam response [::Google::Cloud::VmwareEngine::V1::HcxActivationKey]
2507
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2508
+ #
2509
+ # @return [::Google::Cloud::VmwareEngine::V1::HcxActivationKey]
2510
+ #
2511
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2512
+ #
2513
+ # @example Basic example
2514
+ # require "google/cloud/vmware_engine/v1"
2515
+ #
2516
+ # # Create a client object. The client can be reused for multiple calls.
2517
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
2518
+ #
2519
+ # # Create a request. To set request fields, pass in keyword arguments.
2520
+ # request = Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.new
2521
+ #
2522
+ # # Call the get_hcx_activation_key method.
2523
+ # result = client.get_hcx_activation_key request
2524
+ #
2525
+ # # The returned object is of type Google::Cloud::VmwareEngine::V1::HcxActivationKey.
2526
+ # p result
2527
+ #
2528
+ def get_hcx_activation_key request, options = nil
2529
+ raise ::ArgumentError, "request must be provided" if request.nil?
2530
+
2531
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest
2532
+
2533
+ # Converts hash and nil to an options object
2534
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2535
+
2536
+ # Customize the options with defaults
2537
+ metadata = @config.rpcs.get_hcx_activation_key.metadata.to_h
2538
+
2539
+ # Set x-goog-api-client and x-goog-user-project headers
2540
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2541
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2542
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
2543
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2544
+
2545
+ header_params = {}
2546
+ if request.name
2547
+ header_params["name"] = request.name
2548
+ end
2549
+
2550
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2551
+ metadata[:"x-goog-request-params"] ||= request_params_header
2552
+
2553
+ options.apply_defaults timeout: @config.rpcs.get_hcx_activation_key.timeout,
2554
+ metadata: metadata,
2555
+ retry_policy: @config.rpcs.get_hcx_activation_key.retry_policy
2556
+
2557
+ options.apply_defaults timeout: @config.timeout,
2558
+ metadata: @config.metadata,
2559
+ retry_policy: @config.retry_policy
2560
+
2561
+ @vmware_engine_stub.call_rpc :get_hcx_activation_key, request, options: options do |response, operation|
2562
+ yield response, operation if block_given?
2563
+ return response
2564
+ end
2565
+ rescue ::GRPC::BadStatus => e
2566
+ raise ::Google::Cloud::Error.from_error(e)
2567
+ end
2568
+
2569
+ ##
2570
+ # Retrieves a `NetworkPolicy` resource by its resource name.
2571
+ #
2572
+ # @overload get_network_policy(request, options = nil)
2573
+ # Pass arguments to `get_network_policy` via a request object, either of type
2574
+ # {::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest} or an equivalent Hash.
2575
+ #
2576
+ # @param request [::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest, ::Hash]
2577
+ # A request object representing the call parameters. Required. To specify no
2578
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2579
+ # @param options [::Gapic::CallOptions, ::Hash]
2580
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2581
+ #
2582
+ # @overload get_network_policy(name: nil)
2583
+ # Pass arguments to `get_network_policy` via keyword arguments. Note that at
2584
+ # least one keyword argument is required. To specify no parameters, or to keep all
2585
+ # the default parameter values, pass an empty Hash as a request object (see above).
2586
+ #
2587
+ # @param name [::String]
2588
+ # Required. The resource name of the network policy to retrieve.
2589
+ # Resource names are schemeless URIs that follow the conventions in
2590
+ # https://cloud.google.com/apis/design/resource_names.
2591
+ # For example:
2592
+ # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
2593
+ #
2594
+ # @yield [response, operation] Access the result along with the RPC operation
2595
+ # @yieldparam response [::Google::Cloud::VmwareEngine::V1::NetworkPolicy]
2596
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2597
+ #
2598
+ # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy]
2599
+ #
2600
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2601
+ #
2602
+ # @example Basic example
2603
+ # require "google/cloud/vmware_engine/v1"
2604
+ #
2605
+ # # Create a client object. The client can be reused for multiple calls.
2606
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
2607
+ #
2608
+ # # Create a request. To set request fields, pass in keyword arguments.
2609
+ # request = Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.new
2610
+ #
2611
+ # # Call the get_network_policy method.
2612
+ # result = client.get_network_policy request
2613
+ #
2614
+ # # The returned object is of type Google::Cloud::VmwareEngine::V1::NetworkPolicy.
2615
+ # p result
2616
+ #
2617
+ def get_network_policy request, options = nil
2618
+ raise ::ArgumentError, "request must be provided" if request.nil?
2619
+
2620
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest
2621
+
2622
+ # Converts hash and nil to an options object
2623
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2624
+
2625
+ # Customize the options with defaults
2626
+ metadata = @config.rpcs.get_network_policy.metadata.to_h
2627
+
2628
+ # Set x-goog-api-client and x-goog-user-project headers
2629
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2630
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2631
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
2632
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2633
+
2634
+ header_params = {}
2635
+ if request.name
2636
+ header_params["name"] = request.name
2637
+ end
2638
+
2639
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2640
+ metadata[:"x-goog-request-params"] ||= request_params_header
2641
+
2642
+ options.apply_defaults timeout: @config.rpcs.get_network_policy.timeout,
2643
+ metadata: metadata,
2644
+ retry_policy: @config.rpcs.get_network_policy.retry_policy
2645
+
2646
+ options.apply_defaults timeout: @config.timeout,
2647
+ metadata: @config.metadata,
2648
+ retry_policy: @config.retry_policy
2649
+
2650
+ @vmware_engine_stub.call_rpc :get_network_policy, request, options: options do |response, operation|
2651
+ yield response, operation if block_given?
2652
+ return response
2653
+ end
2654
+ rescue ::GRPC::BadStatus => e
2655
+ raise ::Google::Cloud::Error.from_error(e)
2656
+ end
2657
+
2658
+ ##
2659
+ # Lists `NetworkPolicy` resources in a specified project and location.
2660
+ #
2661
+ # @overload list_network_policies(request, options = nil)
2662
+ # Pass arguments to `list_network_policies` via a request object, either of type
2663
+ # {::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest} or an equivalent Hash.
2664
+ #
2665
+ # @param request [::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest, ::Hash]
2666
+ # A request object representing the call parameters. Required. To specify no
2667
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2668
+ # @param options [::Gapic::CallOptions, ::Hash]
2669
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2670
+ #
2671
+ # @overload list_network_policies(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2672
+ # Pass arguments to `list_network_policies` via keyword arguments. Note that at
2673
+ # least one keyword argument is required. To specify no parameters, or to keep all
2674
+ # the default parameter values, pass an empty Hash as a request object (see above).
2675
+ #
2676
+ # @param parent [::String]
2677
+ # Required. The resource name of the location (region) to query for
2678
+ # network policies. Resource names are schemeless URIs that follow the
2679
+ # conventions in https://cloud.google.com/apis/design/resource_names. For
2680
+ # example: `projects/my-project/locations/us-central1`
2681
+ # @param page_size [::Integer]
2682
+ # The maximum number of network policies to return in one page.
2683
+ # The service may return fewer than this value.
2684
+ # The maximum value is coerced to 1000.
2685
+ # The default value of this field is 500.
2686
+ # @param page_token [::String]
2687
+ # A page token, received from a previous `ListNetworkPolicies` call.
2688
+ # Provide this to retrieve the subsequent page.
2689
+ #
2690
+ # When paginating, all other parameters provided to
2691
+ # `ListNetworkPolicies` must match the call that provided the page
2692
+ # token.
2693
+ # @param filter [::String]
2694
+ # A filter expression that matches resources returned in the response.
2695
+ # The expression must specify the field name, a comparison
2696
+ # operator, and the value that you want to use for filtering. The value
2697
+ # must be a string, a number, or a boolean. The comparison operator
2698
+ # must be `=`, `!=`, `>`, or `<`.
2699
+ #
2700
+ # For example, if you are filtering a list of network policies, you can
2701
+ # exclude the ones named `example-policy` by specifying
2702
+ # `name != "example-policy"`.
2703
+ #
2704
+ # To filter on multiple expressions, provide each separate expression within
2705
+ # parentheses. For example:
2706
+ # ```
2707
+ # (name = "example-policy")
2708
+ # (createTime > "2021-04-12T08:15:10.40Z")
2709
+ # ```
2710
+ #
2711
+ # By default, each expression is an `AND` expression. However, you
2712
+ # can include `AND` and `OR` expressions explicitly.
2713
+ # For example:
2714
+ # ```
2715
+ # (name = "example-policy-1") AND
2716
+ # (createTime > "2021-04-12T08:15:10.40Z") OR
2717
+ # (name = "example-policy-2")
2718
+ # ```
2719
+ # @param order_by [::String]
2720
+ # Sorts list results by a certain order. By default, returned results
2721
+ # are ordered by `name` in ascending order.
2722
+ # You can also sort results in descending order based on the `name` value
2723
+ # using `orderBy="name desc"`.
2724
+ # Currently, only ordering by `name` is supported.
2725
+ #
2726
+ # @yield [response, operation] Access the result along with the RPC operation
2727
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPolicy>]
2728
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2729
+ #
2730
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPolicy>]
2731
+ #
2732
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2733
+ #
2734
+ # @example Basic example
2735
+ # require "google/cloud/vmware_engine/v1"
2736
+ #
2737
+ # # Create a client object. The client can be reused for multiple calls.
2738
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
2739
+ #
2740
+ # # Create a request. To set request fields, pass in keyword arguments.
2741
+ # request = Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.new
2742
+ #
2743
+ # # Call the list_network_policies method.
2744
+ # result = client.list_network_policies request
2745
+ #
2746
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2747
+ # # iterate over all elements by calling #each, and the enumerable
2748
+ # # will lazily make API calls to fetch subsequent pages. Other
2749
+ # # methods are also available for managing paging directly.
2750
+ # result.each do |response|
2751
+ # # Each element is of type ::Google::Cloud::VmwareEngine::V1::NetworkPolicy.
2752
+ # p response
2753
+ # end
2754
+ #
2755
+ def list_network_policies request, options = nil
2756
+ raise ::ArgumentError, "request must be provided" if request.nil?
2757
+
2758
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest
2759
+
2760
+ # Converts hash and nil to an options object
2761
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2762
+
2763
+ # Customize the options with defaults
2764
+ metadata = @config.rpcs.list_network_policies.metadata.to_h
2765
+
2766
+ # Set x-goog-api-client and x-goog-user-project headers
2767
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2768
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2769
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
2770
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2771
+
2772
+ header_params = {}
2773
+ if request.parent
2774
+ header_params["parent"] = request.parent
2775
+ end
2776
+
2777
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2778
+ metadata[:"x-goog-request-params"] ||= request_params_header
2779
+
2780
+ options.apply_defaults timeout: @config.rpcs.list_network_policies.timeout,
2781
+ metadata: metadata,
2782
+ retry_policy: @config.rpcs.list_network_policies.retry_policy
2783
+
2784
+ options.apply_defaults timeout: @config.timeout,
2785
+ metadata: @config.metadata,
2786
+ retry_policy: @config.retry_policy
2787
+
2788
+ @vmware_engine_stub.call_rpc :list_network_policies, request, options: options do |response, operation|
2789
+ response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_network_policies, request, response, operation, options
2790
+ yield response, operation if block_given?
2791
+ return response
2792
+ end
2793
+ rescue ::GRPC::BadStatus => e
2794
+ raise ::Google::Cloud::Error.from_error(e)
2795
+ end
2796
+
2797
+ ##
2798
+ # Creates a new network policy in a given VMware Engine network of a
2799
+ # project and location (region). A new network policy cannot be created if
2800
+ # another network policy already exists in the same scope.
2801
+ #
2802
+ # @overload create_network_policy(request, options = nil)
2803
+ # Pass arguments to `create_network_policy` via a request object, either of type
2804
+ # {::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest} or an equivalent Hash.
2805
+ #
2806
+ # @param request [::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest, ::Hash]
2807
+ # A request object representing the call parameters. Required. To specify no
2808
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2809
+ # @param options [::Gapic::CallOptions, ::Hash]
2810
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2811
+ #
2812
+ # @overload create_network_policy(parent: nil, network_policy_id: nil, network_policy: nil, request_id: nil)
2813
+ # Pass arguments to `create_network_policy` via keyword arguments. Note that at
2814
+ # least one keyword argument is required. To specify no parameters, or to keep all
2815
+ # the default parameter values, pass an empty Hash as a request object (see above).
2816
+ #
2817
+ # @param parent [::String]
2818
+ # Required. The resource name of the location (region)
2819
+ # to create the new network policy in.
2820
+ # Resource names are schemeless URIs that follow the conventions in
2821
+ # https://cloud.google.com/apis/design/resource_names.
2822
+ # For example:
2823
+ # `projects/my-project/locations/us-central1`
2824
+ # @param network_policy_id [::String]
2825
+ # Required. The user-provided identifier of the network policy to be created.
2826
+ # This identifier must be unique within parent
2827
+ # `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes
2828
+ # the final token in the name URI.
2829
+ # The identifier must meet the following requirements:
2830
+ #
2831
+ # * Only contains 1-63 alphanumeric characters and hyphens
2832
+ # * Begins with an alphabetical character
2833
+ # * Ends with a non-hyphen character
2834
+ # * Not formatted as a UUID
2835
+ # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
2836
+ # (section 3.5)
2837
+ # @param network_policy [::Google::Cloud::VmwareEngine::V1::NetworkPolicy, ::Hash]
2838
+ # Required. The network policy configuration to use in the request.
2839
+ # @param request_id [::String]
2840
+ # Optional. A request ID to identify requests. Specify a unique request ID
2841
+ # so that if you must retry your request, the server will know to ignore
2842
+ # the request if it has already been completed. The server guarantees that a
2843
+ # request doesn't result in creation of duplicate commitments for at least 60
2844
+ # minutes.
2845
+ #
2846
+ # For example, consider a situation where you make an initial request and the
2847
+ # request times out. If you make the request again with the same request
2848
+ # ID, the server can check if original operation with the same request ID
2849
+ # was received, and if so, will ignore the second request. This prevents
2850
+ # clients from accidentally creating duplicate commitments.
2851
+ #
2852
+ # The request ID must be a valid UUID with the exception that zero UUID is
2853
+ # not supported (00000000-0000-0000-0000-000000000000).
2854
+ #
2855
+ # @yield [response, operation] Access the result along with the RPC operation
2856
+ # @yieldparam response [::Gapic::Operation]
2857
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2858
+ #
2859
+ # @return [::Gapic::Operation]
2860
+ #
2861
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2862
+ #
2863
+ # @example Basic example
2864
+ # require "google/cloud/vmware_engine/v1"
2865
+ #
2866
+ # # Create a client object. The client can be reused for multiple calls.
2867
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
2868
+ #
2869
+ # # Create a request. To set request fields, pass in keyword arguments.
2870
+ # request = Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new
2871
+ #
2872
+ # # Call the create_network_policy method.
2873
+ # result = client.create_network_policy request
2874
+ #
2875
+ # # The returned object is of type Gapic::Operation. You can use this
2876
+ # # object to check the status of an operation, cancel it, or wait
2877
+ # # for results. Here is how to block until completion:
2878
+ # result.wait_until_done! timeout: 60
2879
+ # if result.response?
2880
+ # p result.response
2881
+ # else
2882
+ # puts "Error!"
2883
+ # end
2884
+ #
2885
+ def create_network_policy request, options = nil
2886
+ raise ::ArgumentError, "request must be provided" if request.nil?
2887
+
2888
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest
2889
+
2890
+ # Converts hash and nil to an options object
2891
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2892
+
2893
+ # Customize the options with defaults
2894
+ metadata = @config.rpcs.create_network_policy.metadata.to_h
2895
+
2896
+ # Set x-goog-api-client and x-goog-user-project headers
2897
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2898
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2899
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
2900
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2901
+
2902
+ header_params = {}
2903
+ if request.parent
2904
+ header_params["parent"] = request.parent
2905
+ end
2906
+
2907
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2908
+ metadata[:"x-goog-request-params"] ||= request_params_header
2909
+
2910
+ options.apply_defaults timeout: @config.rpcs.create_network_policy.timeout,
2911
+ metadata: metadata,
2912
+ retry_policy: @config.rpcs.create_network_policy.retry_policy
2913
+
2914
+ options.apply_defaults timeout: @config.timeout,
2915
+ metadata: @config.metadata,
2916
+ retry_policy: @config.retry_policy
2917
+
2918
+ @vmware_engine_stub.call_rpc :create_network_policy, request, options: options do |response, operation|
2919
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2920
+ yield response, operation if block_given?
2921
+ return response
2922
+ end
2923
+ rescue ::GRPC::BadStatus => e
2924
+ raise ::Google::Cloud::Error.from_error(e)
2925
+ end
2926
+
2927
+ ##
2928
+ # Modifies a `NetworkPolicy` resource. Only the following fields can be
2929
+ # updated: `internet_access`, `external_ip`, `edge_services_cidr`.
2930
+ # Only fields specified in `updateMask` are applied. When updating a network
2931
+ # policy, the external IP network service can only be disabled if there are
2932
+ # no external IP addresses present in the scope of the policy. Also, a
2933
+ # `NetworkService` cannot be updated when `NetworkService.state` is set
2934
+ # to `RECONCILING`.
2935
+ #
2936
+ # During operation processing, the resource is temporarily in the `ACTIVE`
2937
+ # state before the operation fully completes. For that period of time, you
2938
+ # can't update the resource. Use the operation status to determine when the
2939
+ # processing fully completes.
2940
+ #
2941
+ # @overload update_network_policy(request, options = nil)
2942
+ # Pass arguments to `update_network_policy` via a request object, either of type
2943
+ # {::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest} or an equivalent Hash.
2944
+ #
2945
+ # @param request [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest, ::Hash]
2946
+ # A request object representing the call parameters. Required. To specify no
2947
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2948
+ # @param options [::Gapic::CallOptions, ::Hash]
2949
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2950
+ #
2951
+ # @overload update_network_policy(network_policy: nil, update_mask: nil, request_id: nil)
2952
+ # Pass arguments to `update_network_policy` via keyword arguments. Note that at
2953
+ # least one keyword argument is required. To specify no parameters, or to keep all
2954
+ # the default parameter values, pass an empty Hash as a request object (see above).
2955
+ #
2956
+ # @param network_policy [::Google::Cloud::VmwareEngine::V1::NetworkPolicy, ::Hash]
2957
+ # Required. Network policy description.
2958
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2959
+ # Required. Field mask is used to specify the fields to be overwritten in the
2960
+ # `NetworkPolicy` resource by the update.
2961
+ # The fields specified in the `update_mask` are relative to the resource, not
2962
+ # the full request. A field will be overwritten if it is in the mask. If the
2963
+ # user does not provide a mask then all fields will be overwritten.
2964
+ # @param request_id [::String]
2965
+ # Optional. A request ID to identify requests. Specify a unique request ID
2966
+ # so that if you must retry your request, the server will know to ignore
2967
+ # the request if it has already been completed. The server guarantees that a
2968
+ # request doesn't result in creation of duplicate commitments for at least 60
2969
+ # minutes.
2970
+ #
2971
+ # For example, consider a situation where you make an initial request and the
2972
+ # request times out. If you make the request again with the same request
2973
+ # ID, the server can check if original operation with the same request ID
2974
+ # was received, and if so, will ignore the second request. This prevents
2975
+ # clients from accidentally creating duplicate commitments.
2976
+ #
2977
+ # The request ID must be a valid UUID with the exception that zero UUID is
2978
+ # not supported (00000000-0000-0000-0000-000000000000).
2979
+ #
2980
+ # @yield [response, operation] Access the result along with the RPC operation
2981
+ # @yieldparam response [::Gapic::Operation]
2982
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2983
+ #
2984
+ # @return [::Gapic::Operation]
2985
+ #
2986
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2987
+ #
2988
+ # @example Basic example
2989
+ # require "google/cloud/vmware_engine/v1"
2990
+ #
2991
+ # # Create a client object. The client can be reused for multiple calls.
2992
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
2993
+ #
2994
+ # # Create a request. To set request fields, pass in keyword arguments.
2995
+ # request = Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new
2996
+ #
2997
+ # # Call the update_network_policy method.
2998
+ # result = client.update_network_policy request
2999
+ #
3000
+ # # The returned object is of type Gapic::Operation. You can use this
3001
+ # # object to check the status of an operation, cancel it, or wait
3002
+ # # for results. Here is how to block until completion:
3003
+ # result.wait_until_done! timeout: 60
3004
+ # if result.response?
3005
+ # p result.response
3006
+ # else
3007
+ # puts "Error!"
3008
+ # end
3009
+ #
3010
+ def update_network_policy request, options = nil
3011
+ raise ::ArgumentError, "request must be provided" if request.nil?
3012
+
3013
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest
3014
+
3015
+ # Converts hash and nil to an options object
3016
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3017
+
3018
+ # Customize the options with defaults
3019
+ metadata = @config.rpcs.update_network_policy.metadata.to_h
3020
+
3021
+ # Set x-goog-api-client and x-goog-user-project headers
3022
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3023
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3024
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
3025
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3026
+
3027
+ header_params = {}
3028
+ if request.network_policy&.name
3029
+ header_params["network_policy.name"] = request.network_policy.name
3030
+ end
3031
+
3032
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3033
+ metadata[:"x-goog-request-params"] ||= request_params_header
3034
+
3035
+ options.apply_defaults timeout: @config.rpcs.update_network_policy.timeout,
3036
+ metadata: metadata,
3037
+ retry_policy: @config.rpcs.update_network_policy.retry_policy
3038
+
3039
+ options.apply_defaults timeout: @config.timeout,
3040
+ metadata: @config.metadata,
3041
+ retry_policy: @config.retry_policy
3042
+
3043
+ @vmware_engine_stub.call_rpc :update_network_policy, request, options: options do |response, operation|
3044
+ response = ::Gapic::Operation.new response, @operations_client, options: options
3045
+ yield response, operation if block_given?
3046
+ return response
3047
+ end
3048
+ rescue ::GRPC::BadStatus => e
3049
+ raise ::Google::Cloud::Error.from_error(e)
3050
+ end
3051
+
3052
+ ##
3053
+ # Deletes a `NetworkPolicy` resource. A network policy cannot be deleted
3054
+ # when `NetworkService.state` is set to `RECONCILING` for either its external
3055
+ # IP or internet access service.
3056
+ #
3057
+ # @overload delete_network_policy(request, options = nil)
3058
+ # Pass arguments to `delete_network_policy` via a request object, either of type
3059
+ # {::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest} or an equivalent Hash.
3060
+ #
3061
+ # @param request [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest, ::Hash]
3062
+ # A request object representing the call parameters. Required. To specify no
3063
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3064
+ # @param options [::Gapic::CallOptions, ::Hash]
3065
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3066
+ #
3067
+ # @overload delete_network_policy(name: nil, request_id: nil)
3068
+ # Pass arguments to `delete_network_policy` via keyword arguments. Note that at
3069
+ # least one keyword argument is required. To specify no parameters, or to keep all
3070
+ # the default parameter values, pass an empty Hash as a request object (see above).
3071
+ #
3072
+ # @param name [::String]
3073
+ # Required. The resource name of the network policy to delete.
3074
+ # Resource names are schemeless URIs that follow the conventions in
3075
+ # https://cloud.google.com/apis/design/resource_names.
3076
+ # For example:
3077
+ # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
3078
+ # @param request_id [::String]
3079
+ # Optional. A request ID to identify requests. Specify a unique request ID
3080
+ # so that if you must retry your request, the server will know to ignore
3081
+ # the request if it has already been completed. The server guarantees that a
3082
+ # request doesn't result in creation of duplicate commitments for at least 60
3083
+ # minutes.
3084
+ #
3085
+ # For example, consider a situation where you make an initial request and the
3086
+ # request times out. If you make the request again with the same request
3087
+ # ID, the server can check if original operation with the same request ID
3088
+ # was received, and if so, will ignore the second request. This prevents
3089
+ # clients from accidentally creating duplicate commitments.
3090
+ #
3091
+ # The request ID must be a valid UUID with the exception that zero UUID is
3092
+ # not supported (00000000-0000-0000-0000-000000000000).
3093
+ #
3094
+ # @yield [response, operation] Access the result along with the RPC operation
3095
+ # @yieldparam response [::Gapic::Operation]
3096
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3097
+ #
3098
+ # @return [::Gapic::Operation]
3099
+ #
3100
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3101
+ #
3102
+ # @example Basic example
3103
+ # require "google/cloud/vmware_engine/v1"
3104
+ #
3105
+ # # Create a client object. The client can be reused for multiple calls.
3106
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
3107
+ #
3108
+ # # Create a request. To set request fields, pass in keyword arguments.
3109
+ # request = Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new
3110
+ #
3111
+ # # Call the delete_network_policy method.
3112
+ # result = client.delete_network_policy request
3113
+ #
3114
+ # # The returned object is of type Gapic::Operation. You can use this
3115
+ # # object to check the status of an operation, cancel it, or wait
3116
+ # # for results. Here is how to block until completion:
3117
+ # result.wait_until_done! timeout: 60
3118
+ # if result.response?
3119
+ # p result.response
3120
+ # else
3121
+ # puts "Error!"
3122
+ # end
3123
+ #
3124
+ def delete_network_policy request, options = nil
3125
+ raise ::ArgumentError, "request must be provided" if request.nil?
3126
+
3127
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest
3128
+
3129
+ # Converts hash and nil to an options object
3130
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3131
+
3132
+ # Customize the options with defaults
3133
+ metadata = @config.rpcs.delete_network_policy.metadata.to_h
3134
+
3135
+ # Set x-goog-api-client and x-goog-user-project headers
3136
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3137
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3138
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
3139
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3140
+
3141
+ header_params = {}
3142
+ if request.name
3143
+ header_params["name"] = request.name
3144
+ end
3145
+
3146
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3147
+ metadata[:"x-goog-request-params"] ||= request_params_header
3148
+
3149
+ options.apply_defaults timeout: @config.rpcs.delete_network_policy.timeout,
3150
+ metadata: metadata,
3151
+ retry_policy: @config.rpcs.delete_network_policy.retry_policy
3152
+
3153
+ options.apply_defaults timeout: @config.timeout,
3154
+ metadata: @config.metadata,
3155
+ retry_policy: @config.retry_policy
3156
+
3157
+ @vmware_engine_stub.call_rpc :delete_network_policy, request, options: options do |response, operation|
3158
+ response = ::Gapic::Operation.new response, @operations_client, options: options
3159
+ yield response, operation if block_given?
3160
+ return response
3161
+ end
3162
+ rescue ::GRPC::BadStatus => e
3163
+ raise ::Google::Cloud::Error.from_error(e)
3164
+ end
3165
+
3166
+ ##
3167
+ # Creates a new VMware Engine network that can be used by a private cloud.
3168
+ #
3169
+ # @overload create_vmware_engine_network(request, options = nil)
3170
+ # Pass arguments to `create_vmware_engine_network` via a request object, either of type
3171
+ # {::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest} or an equivalent Hash.
3172
+ #
3173
+ # @param request [::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest, ::Hash]
3174
+ # A request object representing the call parameters. Required. To specify no
3175
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3176
+ # @param options [::Gapic::CallOptions, ::Hash]
3177
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3178
+ #
3179
+ # @overload create_vmware_engine_network(parent: nil, vmware_engine_network_id: nil, vmware_engine_network: nil, request_id: nil)
3180
+ # Pass arguments to `create_vmware_engine_network` via keyword arguments. Note that at
3181
+ # least one keyword argument is required. To specify no parameters, or to keep all
3182
+ # the default parameter values, pass an empty Hash as a request object (see above).
3183
+ #
3184
+ # @param parent [::String]
3185
+ # Required. The resource name of the location to create the new VMware Engine
3186
+ # network in. A VMware Engine network of type
3187
+ # `LEGACY` is a regional resource, and a VMware
3188
+ # Engine network of type `STANDARD` is a global resource.
3189
+ # Resource names are schemeless URIs that follow the conventions in
3190
+ # https://cloud.google.com/apis/design/resource_names. For example:
3191
+ # `projects/my-project/locations/global`
3192
+ # @param vmware_engine_network_id [::String]
3193
+ # Required. The user-provided identifier of the new VMware Engine network.
3194
+ # This identifier must be unique among VMware Engine network resources
3195
+ # within the parent and becomes the final token in the name URI. The
3196
+ # identifier must meet the following requirements:
3197
+ #
3198
+ # * For networks of type LEGACY, adheres to the format:
3199
+ # `{region-id}-default`. Replace `{region-id}` with the region where you want
3200
+ # to create the VMware Engine network. For example, "us-west1-default".
3201
+ # * Only contains 1-63 alphanumeric characters and hyphens
3202
+ # * Begins with an alphabetical character
3203
+ # * Ends with a non-hyphen character
3204
+ # * Not formatted as a UUID
3205
+ # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
3206
+ # (section 3.5)
3207
+ # @param vmware_engine_network [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork, ::Hash]
3208
+ # Required. The initial description of the new VMware Engine network.
3209
+ # @param request_id [::String]
3210
+ # Optional. A request ID to identify requests. Specify a unique request ID
3211
+ # so that if you must retry your request, the server will know to ignore
3212
+ # the request if it has already been completed. The server guarantees that a
3213
+ # request doesn't result in creation of duplicate commitments for at least 60
3214
+ # minutes.
3215
+ #
3216
+ # For example, consider a situation where you make an initial request and the
3217
+ # request times out. If you make the request again with the same request
3218
+ # ID, the server can check if original operation with the same request ID
3219
+ # was received, and if so, will ignore the second request. This prevents
3220
+ # clients from accidentally creating duplicate commitments.
3221
+ #
3222
+ # The request ID must be a valid UUID with the exception that zero UUID is
3223
+ # not supported (00000000-0000-0000-0000-000000000000).
3224
+ #
3225
+ # @yield [response, operation] Access the result along with the RPC operation
3226
+ # @yieldparam response [::Gapic::Operation]
3227
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3228
+ #
3229
+ # @return [::Gapic::Operation]
3230
+ #
3231
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3232
+ #
3233
+ # @example Basic example
3234
+ # require "google/cloud/vmware_engine/v1"
3235
+ #
3236
+ # # Create a client object. The client can be reused for multiple calls.
3237
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
3238
+ #
3239
+ # # Create a request. To set request fields, pass in keyword arguments.
3240
+ # request = Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new
3241
+ #
3242
+ # # Call the create_vmware_engine_network method.
3243
+ # result = client.create_vmware_engine_network request
3244
+ #
3245
+ # # The returned object is of type Gapic::Operation. You can use this
3246
+ # # object to check the status of an operation, cancel it, or wait
3247
+ # # for results. Here is how to block until completion:
3248
+ # result.wait_until_done! timeout: 60
3249
+ # if result.response?
3250
+ # p result.response
3251
+ # else
3252
+ # puts "Error!"
3253
+ # end
3254
+ #
3255
+ def create_vmware_engine_network request, options = nil
3256
+ raise ::ArgumentError, "request must be provided" if request.nil?
3257
+
3258
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest
3259
+
3260
+ # Converts hash and nil to an options object
3261
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3262
+
3263
+ # Customize the options with defaults
3264
+ metadata = @config.rpcs.create_vmware_engine_network.metadata.to_h
3265
+
3266
+ # Set x-goog-api-client and x-goog-user-project headers
3267
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3268
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3269
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
3270
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3271
+
3272
+ header_params = {}
3273
+ if request.parent
3274
+ header_params["parent"] = request.parent
3275
+ end
3276
+
3277
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3278
+ metadata[:"x-goog-request-params"] ||= request_params_header
3279
+
3280
+ options.apply_defaults timeout: @config.rpcs.create_vmware_engine_network.timeout,
3281
+ metadata: metadata,
3282
+ retry_policy: @config.rpcs.create_vmware_engine_network.retry_policy
3283
+
3284
+ options.apply_defaults timeout: @config.timeout,
3285
+ metadata: @config.metadata,
3286
+ retry_policy: @config.retry_policy
3287
+
3288
+ @vmware_engine_stub.call_rpc :create_vmware_engine_network, request, options: options do |response, operation|
3289
+ response = ::Gapic::Operation.new response, @operations_client, options: options
3290
+ yield response, operation if block_given?
3291
+ return response
3292
+ end
3293
+ rescue ::GRPC::BadStatus => e
3294
+ raise ::Google::Cloud::Error.from_error(e)
3295
+ end
3296
+
3297
+ ##
3298
+ # Modifies a VMware Engine network resource. Only the following fields can be
3299
+ # updated: `description`. Only fields specified in `updateMask` are
3300
+ # applied.
3301
+ #
3302
+ # @overload update_vmware_engine_network(request, options = nil)
3303
+ # Pass arguments to `update_vmware_engine_network` via a request object, either of type
3304
+ # {::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest} or an equivalent Hash.
3305
+ #
3306
+ # @param request [::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest, ::Hash]
3307
+ # A request object representing the call parameters. Required. To specify no
3308
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3309
+ # @param options [::Gapic::CallOptions, ::Hash]
3310
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3311
+ #
3312
+ # @overload update_vmware_engine_network(vmware_engine_network: nil, update_mask: nil, request_id: nil)
3313
+ # Pass arguments to `update_vmware_engine_network` via keyword arguments. Note that at
3314
+ # least one keyword argument is required. To specify no parameters, or to keep all
3315
+ # the default parameter values, pass an empty Hash as a request object (see above).
3316
+ #
3317
+ # @param vmware_engine_network [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork, ::Hash]
3318
+ # Required. VMware Engine network description.
3319
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3320
+ # Required. Field mask is used to specify the fields to be overwritten in the
3321
+ # VMware Engine network resource by the update.
3322
+ # The fields specified in the `update_mask` are relative to the resource, not
3323
+ # the full request. A field will be overwritten if it is in the mask. If the
3324
+ # user does not provide a mask then all fields will be overwritten. Only the
3325
+ # following fields can be updated: `description`.
3326
+ # @param request_id [::String]
3327
+ # Optional. A request ID to identify requests. Specify a unique request ID
3328
+ # so that if you must retry your request, the server will know to ignore
3329
+ # the request if it has already been completed. The server guarantees that a
3330
+ # request doesn't result in creation of duplicate commitments for at least 60
3331
+ # minutes.
3332
+ #
3333
+ # For example, consider a situation where you make an initial request and the
3334
+ # request times out. If you make the request again with the same request
3335
+ # ID, the server can check if original operation with the same request ID
3336
+ # was received, and if so, will ignore the second request. This prevents
3337
+ # clients from accidentally creating duplicate commitments.
3338
+ #
3339
+ # The request ID must be a valid UUID with the exception that zero UUID is
3340
+ # not supported (00000000-0000-0000-0000-000000000000).
3341
+ #
3342
+ # @yield [response, operation] Access the result along with the RPC operation
3343
+ # @yieldparam response [::Gapic::Operation]
3344
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3345
+ #
3346
+ # @return [::Gapic::Operation]
3347
+ #
3348
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3349
+ #
3350
+ # @example Basic example
3351
+ # require "google/cloud/vmware_engine/v1"
3352
+ #
3353
+ # # Create a client object. The client can be reused for multiple calls.
3354
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
3355
+ #
3356
+ # # Create a request. To set request fields, pass in keyword arguments.
3357
+ # request = Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new
3358
+ #
3359
+ # # Call the update_vmware_engine_network method.
3360
+ # result = client.update_vmware_engine_network request
3361
+ #
3362
+ # # The returned object is of type Gapic::Operation. You can use this
3363
+ # # object to check the status of an operation, cancel it, or wait
3364
+ # # for results. Here is how to block until completion:
3365
+ # result.wait_until_done! timeout: 60
3366
+ # if result.response?
3367
+ # p result.response
3368
+ # else
3369
+ # puts "Error!"
3370
+ # end
3371
+ #
3372
+ def update_vmware_engine_network request, options = nil
3373
+ raise ::ArgumentError, "request must be provided" if request.nil?
3374
+
3375
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest
3376
+
3377
+ # Converts hash and nil to an options object
3378
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3379
+
3380
+ # Customize the options with defaults
3381
+ metadata = @config.rpcs.update_vmware_engine_network.metadata.to_h
3382
+
3383
+ # Set x-goog-api-client and x-goog-user-project headers
3384
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3385
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3386
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
3387
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3388
+
3389
+ header_params = {}
3390
+ if request.vmware_engine_network&.name
3391
+ header_params["vmware_engine_network.name"] = request.vmware_engine_network.name
3392
+ end
3393
+
3394
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3395
+ metadata[:"x-goog-request-params"] ||= request_params_header
3396
+
3397
+ options.apply_defaults timeout: @config.rpcs.update_vmware_engine_network.timeout,
3398
+ metadata: metadata,
3399
+ retry_policy: @config.rpcs.update_vmware_engine_network.retry_policy
3400
+
3401
+ options.apply_defaults timeout: @config.timeout,
3402
+ metadata: @config.metadata,
3403
+ retry_policy: @config.retry_policy
3404
+
3405
+ @vmware_engine_stub.call_rpc :update_vmware_engine_network, request, options: options do |response, operation|
3406
+ response = ::Gapic::Operation.new response, @operations_client, options: options
3407
+ yield response, operation if block_given?
3408
+ return response
3409
+ end
3410
+ rescue ::GRPC::BadStatus => e
3411
+ raise ::Google::Cloud::Error.from_error(e)
3412
+ end
3413
+
3414
+ ##
3415
+ # Deletes a `VmwareEngineNetwork` resource. You can only delete a VMware
3416
+ # Engine network after all resources that refer to it are deleted. For
3417
+ # example, a private cloud, a network peering, and a network policy can all
3418
+ # refer to the same VMware Engine network.
3419
+ #
3420
+ # @overload delete_vmware_engine_network(request, options = nil)
3421
+ # Pass arguments to `delete_vmware_engine_network` via a request object, either of type
3422
+ # {::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest} or an equivalent Hash.
3423
+ #
3424
+ # @param request [::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest, ::Hash]
3425
+ # A request object representing the call parameters. Required. To specify no
3426
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3427
+ # @param options [::Gapic::CallOptions, ::Hash]
3428
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3429
+ #
3430
+ # @overload delete_vmware_engine_network(name: nil, request_id: nil, etag: nil)
3431
+ # Pass arguments to `delete_vmware_engine_network` via keyword arguments. Note that at
3432
+ # least one keyword argument is required. To specify no parameters, or to keep all
3433
+ # the default parameter values, pass an empty Hash as a request object (see above).
3434
+ #
3435
+ # @param name [::String]
3436
+ # Required. The resource name of the VMware Engine network to be deleted.
3437
+ # Resource names are schemeless URIs that follow the conventions in
3438
+ # https://cloud.google.com/apis/design/resource_names.
3439
+ # For example:
3440
+ # `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
3441
+ # @param request_id [::String]
3442
+ # Optional. A request ID to identify requests. Specify a unique request ID
3443
+ # so that if you must retry your request, the server will know to ignore
3444
+ # the request if it has already been completed. The server guarantees that a
3445
+ # request doesn't result in creation of duplicate commitments for at least 60
3446
+ # minutes.
3447
+ #
3448
+ # For example, consider a situation where you make an initial request and the
3449
+ # request times out. If you make the request again with the same request
3450
+ # ID, the server can check if original operation with the same request ID
3451
+ # was received, and if so, will ignore the second request. This prevents
3452
+ # clients from accidentally creating duplicate commitments.
3453
+ #
3454
+ # The request ID must be a valid UUID with the exception that zero UUID is
3455
+ # not supported (00000000-0000-0000-0000-000000000000).
3456
+ # @param etag [::String]
3457
+ # Optional. Checksum used to ensure that the user-provided value is up to date before
3458
+ # the server processes the request. The server compares provided checksum
3459
+ # with the current checksum of the resource. If the user-provided value is
3460
+ # out of date, this request returns an `ABORTED` error.
3461
+ #
3462
+ # @yield [response, operation] Access the result along with the RPC operation
3463
+ # @yieldparam response [::Gapic::Operation]
3464
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3465
+ #
3466
+ # @return [::Gapic::Operation]
3467
+ #
3468
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3469
+ #
3470
+ # @example Basic example
3471
+ # require "google/cloud/vmware_engine/v1"
3472
+ #
3473
+ # # Create a client object. The client can be reused for multiple calls.
3474
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
3475
+ #
3476
+ # # Create a request. To set request fields, pass in keyword arguments.
3477
+ # request = Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new
3478
+ #
3479
+ # # Call the delete_vmware_engine_network method.
3480
+ # result = client.delete_vmware_engine_network request
3481
+ #
3482
+ # # The returned object is of type Gapic::Operation. You can use this
3483
+ # # object to check the status of an operation, cancel it, or wait
3484
+ # # for results. Here is how to block until completion:
3485
+ # result.wait_until_done! timeout: 60
3486
+ # if result.response?
3487
+ # p result.response
3488
+ # else
3489
+ # puts "Error!"
3490
+ # end
3491
+ #
3492
+ def delete_vmware_engine_network request, options = nil
3493
+ raise ::ArgumentError, "request must be provided" if request.nil?
3494
+
3495
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest
3496
+
3497
+ # Converts hash and nil to an options object
3498
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3499
+
3500
+ # Customize the options with defaults
3501
+ metadata = @config.rpcs.delete_vmware_engine_network.metadata.to_h
3502
+
3503
+ # Set x-goog-api-client and x-goog-user-project headers
3504
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3505
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3506
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
3507
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3508
+
3509
+ header_params = {}
3510
+ if request.name
3511
+ header_params["name"] = request.name
3512
+ end
3513
+
3514
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3515
+ metadata[:"x-goog-request-params"] ||= request_params_header
3516
+
3517
+ options.apply_defaults timeout: @config.rpcs.delete_vmware_engine_network.timeout,
3518
+ metadata: metadata,
3519
+ retry_policy: @config.rpcs.delete_vmware_engine_network.retry_policy
3520
+
3521
+ options.apply_defaults timeout: @config.timeout,
3522
+ metadata: @config.metadata,
3523
+ retry_policy: @config.retry_policy
3524
+
3525
+ @vmware_engine_stub.call_rpc :delete_vmware_engine_network, request, options: options do |response, operation|
3526
+ response = ::Gapic::Operation.new response, @operations_client, options: options
3527
+ yield response, operation if block_given?
3528
+ return response
3529
+ end
3530
+ rescue ::GRPC::BadStatus => e
3531
+ raise ::Google::Cloud::Error.from_error(e)
3532
+ end
3533
+
3534
+ ##
3535
+ # Retrieves a `VmwareEngineNetwork` resource by its resource name. The
3536
+ # resource contains details of the VMware Engine network, such as its VMware
3537
+ # Engine network type, peered networks in a service project, and state
3538
+ # (for example, `CREATING`, `ACTIVE`, `DELETING`).
3539
+ #
3540
+ # @overload get_vmware_engine_network(request, options = nil)
3541
+ # Pass arguments to `get_vmware_engine_network` via a request object, either of type
3542
+ # {::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest} or an equivalent Hash.
3543
+ #
3544
+ # @param request [::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest, ::Hash]
3545
+ # A request object representing the call parameters. Required. To specify no
3546
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3547
+ # @param options [::Gapic::CallOptions, ::Hash]
3548
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3549
+ #
3550
+ # @overload get_vmware_engine_network(name: nil)
3551
+ # Pass arguments to `get_vmware_engine_network` via keyword arguments. Note that at
3552
+ # least one keyword argument is required. To specify no parameters, or to keep all
3553
+ # the default parameter values, pass an empty Hash as a request object (see above).
3554
+ #
3555
+ # @param name [::String]
3556
+ # Required. The resource name of the VMware Engine network to retrieve.
3557
+ # Resource names are schemeless URIs that follow the conventions in
3558
+ # https://cloud.google.com/apis/design/resource_names.
3559
+ # For example:
3560
+ # `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
3561
+ #
3562
+ # @yield [response, operation] Access the result along with the RPC operation
3563
+ # @yieldparam response [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork]
3564
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3565
+ #
3566
+ # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork]
3567
+ #
3568
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3569
+ #
3570
+ # @example Basic example
3571
+ # require "google/cloud/vmware_engine/v1"
3572
+ #
3573
+ # # Create a client object. The client can be reused for multiple calls.
3574
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
3575
+ #
3576
+ # # Create a request. To set request fields, pass in keyword arguments.
3577
+ # request = Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.new
3578
+ #
3579
+ # # Call the get_vmware_engine_network method.
3580
+ # result = client.get_vmware_engine_network request
3581
+ #
3582
+ # # The returned object is of type Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork.
3583
+ # p result
3584
+ #
3585
+ def get_vmware_engine_network request, options = nil
3586
+ raise ::ArgumentError, "request must be provided" if request.nil?
3587
+
3588
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest
3589
+
3590
+ # Converts hash and nil to an options object
3591
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3592
+
3593
+ # Customize the options with defaults
3594
+ metadata = @config.rpcs.get_vmware_engine_network.metadata.to_h
3595
+
3596
+ # Set x-goog-api-client and x-goog-user-project headers
3597
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3598
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3599
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
3600
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3601
+
3602
+ header_params = {}
3603
+ if request.name
3604
+ header_params["name"] = request.name
3605
+ end
3606
+
3607
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3608
+ metadata[:"x-goog-request-params"] ||= request_params_header
3609
+
3610
+ options.apply_defaults timeout: @config.rpcs.get_vmware_engine_network.timeout,
3611
+ metadata: metadata,
3612
+ retry_policy: @config.rpcs.get_vmware_engine_network.retry_policy
3613
+
3614
+ options.apply_defaults timeout: @config.timeout,
3615
+ metadata: @config.metadata,
3616
+ retry_policy: @config.retry_policy
3617
+
3618
+ @vmware_engine_stub.call_rpc :get_vmware_engine_network, request, options: options do |response, operation|
3619
+ yield response, operation if block_given?
3620
+ return response
3621
+ end
3622
+ rescue ::GRPC::BadStatus => e
3623
+ raise ::Google::Cloud::Error.from_error(e)
3624
+ end
3625
+
3626
+ ##
3627
+ # Lists `VmwareEngineNetwork` resources in a given project and location.
3628
+ #
3629
+ # @overload list_vmware_engine_networks(request, options = nil)
3630
+ # Pass arguments to `list_vmware_engine_networks` via a request object, either of type
3631
+ # {::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest} or an equivalent Hash.
3632
+ #
3633
+ # @param request [::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest, ::Hash]
3634
+ # A request object representing the call parameters. Required. To specify no
3635
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3636
+ # @param options [::Gapic::CallOptions, ::Hash]
3637
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3638
+ #
3639
+ # @overload list_vmware_engine_networks(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
3640
+ # Pass arguments to `list_vmware_engine_networks` via keyword arguments. Note that at
3641
+ # least one keyword argument is required. To specify no parameters, or to keep all
3642
+ # the default parameter values, pass an empty Hash as a request object (see above).
3643
+ #
3644
+ # @param parent [::String]
3645
+ # Required. The resource name of the location to query for
3646
+ # VMware Engine networks. Resource names are schemeless URIs that follow the
3647
+ # conventions in https://cloud.google.com/apis/design/resource_names. For
3648
+ # example: `projects/my-project/locations/global`
3649
+ # @param page_size [::Integer]
3650
+ # The maximum number of results to return in one page.
3651
+ # The maximum value is coerced to 1000.
3652
+ # The default value of this field is 500.
3653
+ # @param page_token [::String]
3654
+ # A page token, received from a previous `ListVmwareEngineNetworks` call.
3655
+ # Provide this to retrieve the subsequent page.
3656
+ #
3657
+ # When paginating, all other parameters provided to
3658
+ # `ListVmwareEngineNetworks` must match the call that provided the page
3659
+ # token.
3660
+ # @param filter [::String]
3661
+ # A filter expression that matches resources returned in the response.
3662
+ # The expression must specify the field name, a comparison
3663
+ # operator, and the value that you want to use for filtering. The value
3664
+ # must be a string, a number, or a boolean. The comparison operator
3665
+ # must be `=`, `!=`, `>`, or `<`.
3666
+ #
3667
+ # For example, if you are filtering a list of network peerings, you can
3668
+ # exclude the ones named `example-network` by specifying
3669
+ # `name != "example-network"`.
3670
+ #
3671
+ # To filter on multiple expressions, provide each separate expression within
3672
+ # parentheses. For example:
3673
+ # ```
3674
+ # (name = "example-network")
3675
+ # (createTime > "2021-04-12T08:15:10.40Z")
3676
+ # ```
3677
+ #
3678
+ # By default, each expression is an `AND` expression. However, you
3679
+ # can include `AND` and `OR` expressions explicitly.
3680
+ # For example:
3681
+ # ```
3682
+ # (name = "example-network-1") AND
3683
+ # (createTime > "2021-04-12T08:15:10.40Z") OR
3684
+ # (name = "example-network-2")
3685
+ # ```
3686
+ # @param order_by [::String]
3687
+ # Sorts list results by a certain order. By default, returned results
3688
+ # are ordered by `name` in ascending order.
3689
+ # You can also sort results in descending order based on the `name` value
3690
+ # using `orderBy="name desc"`.
3691
+ # Currently, only ordering by `name` is supported.
3692
+ #
3693
+ # @yield [response, operation] Access the result along with the RPC operation
3694
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork>]
3695
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3696
+ #
3697
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork>]
3698
+ #
3699
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3700
+ #
3701
+ # @example Basic example
3702
+ # require "google/cloud/vmware_engine/v1"
3703
+ #
3704
+ # # Create a client object. The client can be reused for multiple calls.
3705
+ # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new
3706
+ #
3707
+ # # Create a request. To set request fields, pass in keyword arguments.
3708
+ # request = Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.new
3709
+ #
3710
+ # # Call the list_vmware_engine_networks method.
3711
+ # result = client.list_vmware_engine_networks request
3712
+ #
3713
+ # # The returned object is of type Gapic::PagedEnumerable. You can
3714
+ # # iterate over all elements by calling #each, and the enumerable
3715
+ # # will lazily make API calls to fetch subsequent pages. Other
3716
+ # # methods are also available for managing paging directly.
3717
+ # result.each do |response|
3718
+ # # Each element is of type ::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork.
3719
+ # p response
3720
+ # end
3721
+ #
3722
+ def list_vmware_engine_networks request, options = nil
3723
+ raise ::ArgumentError, "request must be provided" if request.nil?
3724
+
3725
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest
3726
+
3727
+ # Converts hash and nil to an options object
3728
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3729
+
3730
+ # Customize the options with defaults
3731
+ metadata = @config.rpcs.list_vmware_engine_networks.metadata.to_h
3732
+
3733
+ # Set x-goog-api-client and x-goog-user-project headers
3734
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3735
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3736
+ gapic_version: ::Google::Cloud::VmwareEngine::V1::VERSION
3737
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3738
+
3739
+ header_params = {}
3740
+ if request.parent
3741
+ header_params["parent"] = request.parent
3742
+ end
3743
+
3744
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3745
+ metadata[:"x-goog-request-params"] ||= request_params_header
3746
+
3747
+ options.apply_defaults timeout: @config.rpcs.list_vmware_engine_networks.timeout,
3748
+ metadata: metadata,
3749
+ retry_policy: @config.rpcs.list_vmware_engine_networks.retry_policy
3750
+
3751
+ options.apply_defaults timeout: @config.timeout,
3752
+ metadata: @config.metadata,
3753
+ retry_policy: @config.retry_policy
3754
+
3755
+ @vmware_engine_stub.call_rpc :list_vmware_engine_networks, request, options: options do |response, operation|
3756
+ response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_vmware_engine_networks, request, response, operation, options
3757
+ yield response, operation if block_given?
3758
+ return response
3759
+ end
3760
+ rescue ::GRPC::BadStatus => e
3761
+ raise ::Google::Cloud::Error.from_error(e)
3762
+ end
3763
+
3764
+ ##
3765
+ # Configuration class for the VmwareEngine API.
3766
+ #
3767
+ # This class represents the configuration for VmwareEngine,
3768
+ # providing control over timeouts, retry behavior, logging, transport
3769
+ # parameters, and other low-level controls. Certain parameters can also be
3770
+ # applied individually to specific RPCs. See
3771
+ # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client::Configuration::Rpcs}
3772
+ # for a list of RPCs that can be configured independently.
3773
+ #
3774
+ # Configuration can be applied globally to all clients, or to a single client
3775
+ # on construction.
3776
+ #
3777
+ # @example
3778
+ #
3779
+ # # Modify the global config, setting the timeout for
3780
+ # # list_private_clouds to 20 seconds,
3781
+ # # and all remaining timeouts to 10 seconds.
3782
+ # ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.configure do |config|
3783
+ # config.timeout = 10.0
3784
+ # config.rpcs.list_private_clouds.timeout = 20.0
3785
+ # end
3786
+ #
3787
+ # # Apply the above configuration only to a new client.
3788
+ # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config|
3789
+ # config.timeout = 10.0
3790
+ # config.rpcs.list_private_clouds.timeout = 20.0
3791
+ # end
3792
+ #
3793
+ # @!attribute [rw] endpoint
3794
+ # The hostname or hostname:port of the service endpoint.
3795
+ # Defaults to `"vmwareengine.googleapis.com"`.
3796
+ # @return [::String]
3797
+ # @!attribute [rw] credentials
3798
+ # Credentials to send with calls. You may provide any of the following types:
3799
+ # * (`String`) The path to a service account key file in JSON format
3800
+ # * (`Hash`) A service account key as a Hash
3801
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
3802
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
3803
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
3804
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
3805
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
3806
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
3807
+ # * (`nil`) indicating no credentials
3808
+ # @return [::Object]
3809
+ # @!attribute [rw] scope
3810
+ # The OAuth scopes
3811
+ # @return [::Array<::String>]
3812
+ # @!attribute [rw] lib_name
3813
+ # The library name as recorded in instrumentation and logging
3814
+ # @return [::String]
3815
+ # @!attribute [rw] lib_version
3816
+ # The library version as recorded in instrumentation and logging
3817
+ # @return [::String]
3818
+ # @!attribute [rw] channel_args
3819
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
3820
+ # `GRPC::Core::Channel` object is provided as the credential.
3821
+ # @return [::Hash]
3822
+ # @!attribute [rw] interceptors
3823
+ # An array of interceptors that are run before calls are executed.
3824
+ # @return [::Array<::GRPC::ClientInterceptor>]
3825
+ # @!attribute [rw] timeout
3826
+ # The call timeout in seconds.
3827
+ # @return [::Numeric]
3828
+ # @!attribute [rw] metadata
3829
+ # Additional gRPC headers to be sent with the call.
3830
+ # @return [::Hash{::Symbol=>::String}]
3831
+ # @!attribute [rw] retry_policy
3832
+ # The retry policy. The value is a hash with the following keys:
3833
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3834
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3835
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3836
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3837
+ # trigger a retry.
3838
+ # @return [::Hash]
3839
+ # @!attribute [rw] quota_project
3840
+ # A separate project against which to charge quota.
3841
+ # @return [::String]
3842
+ #
3843
+ class Configuration
3844
+ extend ::Gapic::Config
3845
+
3846
+ config_attr :endpoint, "vmwareengine.googleapis.com", ::String
3847
+ config_attr :credentials, nil do |value|
3848
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
3849
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
3850
+ allowed.any? { |klass| klass === value }
3851
+ end
3852
+ config_attr :scope, nil, ::String, ::Array, nil
3853
+ config_attr :lib_name, nil, ::String, nil
3854
+ config_attr :lib_version, nil, ::String, nil
3855
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
3856
+ config_attr :interceptors, nil, ::Array, nil
3857
+ config_attr :timeout, nil, ::Numeric, nil
3858
+ config_attr :metadata, nil, ::Hash, nil
3859
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3860
+ config_attr :quota_project, nil, ::String, nil
3861
+
3862
+ # @private
3863
+ def initialize parent_config = nil
3864
+ @parent_config = parent_config unless parent_config.nil?
3865
+
3866
+ yield self if block_given?
3867
+ end
3868
+
3869
+ ##
3870
+ # Configurations for individual RPCs
3871
+ # @return [Rpcs]
3872
+ #
3873
+ def rpcs
3874
+ @rpcs ||= begin
3875
+ parent_rpcs = nil
3876
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
3877
+ Rpcs.new parent_rpcs
3878
+ end
3879
+ end
3880
+
3881
+ ##
3882
+ # Configuration RPC class for the VmwareEngine API.
3883
+ #
3884
+ # Includes fields providing the configuration for each RPC in this service.
3885
+ # Each configuration object is of type `Gapic::Config::Method` and includes
3886
+ # the following configuration fields:
3887
+ #
3888
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
3889
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
3890
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
3891
+ # include the following keys:
3892
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3893
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3894
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3895
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3896
+ # trigger a retry.
3897
+ #
3898
+ class Rpcs
3899
+ ##
3900
+ # RPC-specific configuration for `list_private_clouds`
3901
+ # @return [::Gapic::Config::Method]
3902
+ #
3903
+ attr_reader :list_private_clouds
3904
+ ##
3905
+ # RPC-specific configuration for `get_private_cloud`
3906
+ # @return [::Gapic::Config::Method]
3907
+ #
3908
+ attr_reader :get_private_cloud
3909
+ ##
3910
+ # RPC-specific configuration for `create_private_cloud`
3911
+ # @return [::Gapic::Config::Method]
3912
+ #
3913
+ attr_reader :create_private_cloud
3914
+ ##
3915
+ # RPC-specific configuration for `update_private_cloud`
3916
+ # @return [::Gapic::Config::Method]
3917
+ #
3918
+ attr_reader :update_private_cloud
3919
+ ##
3920
+ # RPC-specific configuration for `delete_private_cloud`
3921
+ # @return [::Gapic::Config::Method]
3922
+ #
3923
+ attr_reader :delete_private_cloud
3924
+ ##
3925
+ # RPC-specific configuration for `undelete_private_cloud`
3926
+ # @return [::Gapic::Config::Method]
3927
+ #
3928
+ attr_reader :undelete_private_cloud
3929
+ ##
3930
+ # RPC-specific configuration for `list_clusters`
3931
+ # @return [::Gapic::Config::Method]
3932
+ #
3933
+ attr_reader :list_clusters
3934
+ ##
3935
+ # RPC-specific configuration for `get_cluster`
3936
+ # @return [::Gapic::Config::Method]
3937
+ #
3938
+ attr_reader :get_cluster
3939
+ ##
3940
+ # RPC-specific configuration for `create_cluster`
3941
+ # @return [::Gapic::Config::Method]
3942
+ #
3943
+ attr_reader :create_cluster
3944
+ ##
3945
+ # RPC-specific configuration for `update_cluster`
3946
+ # @return [::Gapic::Config::Method]
3947
+ #
3948
+ attr_reader :update_cluster
3949
+ ##
3950
+ # RPC-specific configuration for `delete_cluster`
3951
+ # @return [::Gapic::Config::Method]
3952
+ #
3953
+ attr_reader :delete_cluster
3954
+ ##
3955
+ # RPC-specific configuration for `list_subnets`
3956
+ # @return [::Gapic::Config::Method]
3957
+ #
3958
+ attr_reader :list_subnets
3959
+ ##
3960
+ # RPC-specific configuration for `list_node_types`
3961
+ # @return [::Gapic::Config::Method]
3962
+ #
3963
+ attr_reader :list_node_types
3964
+ ##
3965
+ # RPC-specific configuration for `get_node_type`
3966
+ # @return [::Gapic::Config::Method]
3967
+ #
3968
+ attr_reader :get_node_type
3969
+ ##
3970
+ # RPC-specific configuration for `show_nsx_credentials`
3971
+ # @return [::Gapic::Config::Method]
3972
+ #
3973
+ attr_reader :show_nsx_credentials
3974
+ ##
3975
+ # RPC-specific configuration for `show_vcenter_credentials`
3976
+ # @return [::Gapic::Config::Method]
3977
+ #
3978
+ attr_reader :show_vcenter_credentials
3979
+ ##
3980
+ # RPC-specific configuration for `reset_nsx_credentials`
3981
+ # @return [::Gapic::Config::Method]
3982
+ #
3983
+ attr_reader :reset_nsx_credentials
3984
+ ##
3985
+ # RPC-specific configuration for `reset_vcenter_credentials`
3986
+ # @return [::Gapic::Config::Method]
3987
+ #
3988
+ attr_reader :reset_vcenter_credentials
3989
+ ##
3990
+ # RPC-specific configuration for `create_hcx_activation_key`
3991
+ # @return [::Gapic::Config::Method]
3992
+ #
3993
+ attr_reader :create_hcx_activation_key
3994
+ ##
3995
+ # RPC-specific configuration for `list_hcx_activation_keys`
3996
+ # @return [::Gapic::Config::Method]
3997
+ #
3998
+ attr_reader :list_hcx_activation_keys
3999
+ ##
4000
+ # RPC-specific configuration for `get_hcx_activation_key`
4001
+ # @return [::Gapic::Config::Method]
4002
+ #
4003
+ attr_reader :get_hcx_activation_key
4004
+ ##
4005
+ # RPC-specific configuration for `get_network_policy`
4006
+ # @return [::Gapic::Config::Method]
4007
+ #
4008
+ attr_reader :get_network_policy
4009
+ ##
4010
+ # RPC-specific configuration for `list_network_policies`
4011
+ # @return [::Gapic::Config::Method]
4012
+ #
4013
+ attr_reader :list_network_policies
4014
+ ##
4015
+ # RPC-specific configuration for `create_network_policy`
4016
+ # @return [::Gapic::Config::Method]
4017
+ #
4018
+ attr_reader :create_network_policy
4019
+ ##
4020
+ # RPC-specific configuration for `update_network_policy`
4021
+ # @return [::Gapic::Config::Method]
4022
+ #
4023
+ attr_reader :update_network_policy
4024
+ ##
4025
+ # RPC-specific configuration for `delete_network_policy`
4026
+ # @return [::Gapic::Config::Method]
4027
+ #
4028
+ attr_reader :delete_network_policy
4029
+ ##
4030
+ # RPC-specific configuration for `create_vmware_engine_network`
4031
+ # @return [::Gapic::Config::Method]
4032
+ #
4033
+ attr_reader :create_vmware_engine_network
4034
+ ##
4035
+ # RPC-specific configuration for `update_vmware_engine_network`
4036
+ # @return [::Gapic::Config::Method]
4037
+ #
4038
+ attr_reader :update_vmware_engine_network
4039
+ ##
4040
+ # RPC-specific configuration for `delete_vmware_engine_network`
4041
+ # @return [::Gapic::Config::Method]
4042
+ #
4043
+ attr_reader :delete_vmware_engine_network
4044
+ ##
4045
+ # RPC-specific configuration for `get_vmware_engine_network`
4046
+ # @return [::Gapic::Config::Method]
4047
+ #
4048
+ attr_reader :get_vmware_engine_network
4049
+ ##
4050
+ # RPC-specific configuration for `list_vmware_engine_networks`
4051
+ # @return [::Gapic::Config::Method]
4052
+ #
4053
+ attr_reader :list_vmware_engine_networks
4054
+
4055
+ # @private
4056
+ def initialize parent_rpcs = nil
4057
+ list_private_clouds_config = parent_rpcs.list_private_clouds if parent_rpcs.respond_to? :list_private_clouds
4058
+ @list_private_clouds = ::Gapic::Config::Method.new list_private_clouds_config
4059
+ get_private_cloud_config = parent_rpcs.get_private_cloud if parent_rpcs.respond_to? :get_private_cloud
4060
+ @get_private_cloud = ::Gapic::Config::Method.new get_private_cloud_config
4061
+ create_private_cloud_config = parent_rpcs.create_private_cloud if parent_rpcs.respond_to? :create_private_cloud
4062
+ @create_private_cloud = ::Gapic::Config::Method.new create_private_cloud_config
4063
+ update_private_cloud_config = parent_rpcs.update_private_cloud if parent_rpcs.respond_to? :update_private_cloud
4064
+ @update_private_cloud = ::Gapic::Config::Method.new update_private_cloud_config
4065
+ delete_private_cloud_config = parent_rpcs.delete_private_cloud if parent_rpcs.respond_to? :delete_private_cloud
4066
+ @delete_private_cloud = ::Gapic::Config::Method.new delete_private_cloud_config
4067
+ undelete_private_cloud_config = parent_rpcs.undelete_private_cloud if parent_rpcs.respond_to? :undelete_private_cloud
4068
+ @undelete_private_cloud = ::Gapic::Config::Method.new undelete_private_cloud_config
4069
+ list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters
4070
+ @list_clusters = ::Gapic::Config::Method.new list_clusters_config
4071
+ get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster
4072
+ @get_cluster = ::Gapic::Config::Method.new get_cluster_config
4073
+ create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster
4074
+ @create_cluster = ::Gapic::Config::Method.new create_cluster_config
4075
+ update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster
4076
+ @update_cluster = ::Gapic::Config::Method.new update_cluster_config
4077
+ delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
4078
+ @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
4079
+ list_subnets_config = parent_rpcs.list_subnets if parent_rpcs.respond_to? :list_subnets
4080
+ @list_subnets = ::Gapic::Config::Method.new list_subnets_config
4081
+ list_node_types_config = parent_rpcs.list_node_types if parent_rpcs.respond_to? :list_node_types
4082
+ @list_node_types = ::Gapic::Config::Method.new list_node_types_config
4083
+ get_node_type_config = parent_rpcs.get_node_type if parent_rpcs.respond_to? :get_node_type
4084
+ @get_node_type = ::Gapic::Config::Method.new get_node_type_config
4085
+ show_nsx_credentials_config = parent_rpcs.show_nsx_credentials if parent_rpcs.respond_to? :show_nsx_credentials
4086
+ @show_nsx_credentials = ::Gapic::Config::Method.new show_nsx_credentials_config
4087
+ show_vcenter_credentials_config = parent_rpcs.show_vcenter_credentials if parent_rpcs.respond_to? :show_vcenter_credentials
4088
+ @show_vcenter_credentials = ::Gapic::Config::Method.new show_vcenter_credentials_config
4089
+ reset_nsx_credentials_config = parent_rpcs.reset_nsx_credentials if parent_rpcs.respond_to? :reset_nsx_credentials
4090
+ @reset_nsx_credentials = ::Gapic::Config::Method.new reset_nsx_credentials_config
4091
+ reset_vcenter_credentials_config = parent_rpcs.reset_vcenter_credentials if parent_rpcs.respond_to? :reset_vcenter_credentials
4092
+ @reset_vcenter_credentials = ::Gapic::Config::Method.new reset_vcenter_credentials_config
4093
+ create_hcx_activation_key_config = parent_rpcs.create_hcx_activation_key if parent_rpcs.respond_to? :create_hcx_activation_key
4094
+ @create_hcx_activation_key = ::Gapic::Config::Method.new create_hcx_activation_key_config
4095
+ list_hcx_activation_keys_config = parent_rpcs.list_hcx_activation_keys if parent_rpcs.respond_to? :list_hcx_activation_keys
4096
+ @list_hcx_activation_keys = ::Gapic::Config::Method.new list_hcx_activation_keys_config
4097
+ get_hcx_activation_key_config = parent_rpcs.get_hcx_activation_key if parent_rpcs.respond_to? :get_hcx_activation_key
4098
+ @get_hcx_activation_key = ::Gapic::Config::Method.new get_hcx_activation_key_config
4099
+ get_network_policy_config = parent_rpcs.get_network_policy if parent_rpcs.respond_to? :get_network_policy
4100
+ @get_network_policy = ::Gapic::Config::Method.new get_network_policy_config
4101
+ list_network_policies_config = parent_rpcs.list_network_policies if parent_rpcs.respond_to? :list_network_policies
4102
+ @list_network_policies = ::Gapic::Config::Method.new list_network_policies_config
4103
+ create_network_policy_config = parent_rpcs.create_network_policy if parent_rpcs.respond_to? :create_network_policy
4104
+ @create_network_policy = ::Gapic::Config::Method.new create_network_policy_config
4105
+ update_network_policy_config = parent_rpcs.update_network_policy if parent_rpcs.respond_to? :update_network_policy
4106
+ @update_network_policy = ::Gapic::Config::Method.new update_network_policy_config
4107
+ delete_network_policy_config = parent_rpcs.delete_network_policy if parent_rpcs.respond_to? :delete_network_policy
4108
+ @delete_network_policy = ::Gapic::Config::Method.new delete_network_policy_config
4109
+ create_vmware_engine_network_config = parent_rpcs.create_vmware_engine_network if parent_rpcs.respond_to? :create_vmware_engine_network
4110
+ @create_vmware_engine_network = ::Gapic::Config::Method.new create_vmware_engine_network_config
4111
+ update_vmware_engine_network_config = parent_rpcs.update_vmware_engine_network if parent_rpcs.respond_to? :update_vmware_engine_network
4112
+ @update_vmware_engine_network = ::Gapic::Config::Method.new update_vmware_engine_network_config
4113
+ delete_vmware_engine_network_config = parent_rpcs.delete_vmware_engine_network if parent_rpcs.respond_to? :delete_vmware_engine_network
4114
+ @delete_vmware_engine_network = ::Gapic::Config::Method.new delete_vmware_engine_network_config
4115
+ get_vmware_engine_network_config = parent_rpcs.get_vmware_engine_network if parent_rpcs.respond_to? :get_vmware_engine_network
4116
+ @get_vmware_engine_network = ::Gapic::Config::Method.new get_vmware_engine_network_config
4117
+ list_vmware_engine_networks_config = parent_rpcs.list_vmware_engine_networks if parent_rpcs.respond_to? :list_vmware_engine_networks
4118
+ @list_vmware_engine_networks = ::Gapic::Config::Method.new list_vmware_engine_networks_config
4119
+
4120
+ yield self if block_given?
4121
+ end
4122
+ end
4123
+ end
4124
+ end
4125
+ end
4126
+ end
4127
+ end
4128
+ end
4129
+ end