google-cloud-lustre-v1 0.a → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/cloud/lustre/v1/bindings_override.rb +102 -0
  6. data/lib/google/cloud/lustre/v1/instance_pb.rb +58 -0
  7. data/lib/google/cloud/lustre/v1/lustre/client.rb +1185 -0
  8. data/lib/google/cloud/lustre/v1/lustre/credentials.rb +47 -0
  9. data/lib/google/cloud/lustre/v1/lustre/operations.rb +813 -0
  10. data/lib/google/cloud/lustre/v1/lustre/paths.rb +103 -0
  11. data/lib/google/cloud/lustre/v1/lustre/rest/client.rb +1118 -0
  12. data/lib/google/cloud/lustre/v1/lustre/rest/operations.rb +913 -0
  13. data/lib/google/cloud/lustre/v1/lustre/rest/service_stub.rb +512 -0
  14. data/lib/google/cloud/lustre/v1/lustre/rest.rb +54 -0
  15. data/lib/google/cloud/lustre/v1/lustre.rb +56 -0
  16. data/lib/google/cloud/lustre/v1/lustre_pb.rb +49 -0
  17. data/lib/google/cloud/lustre/v1/lustre_services_pb.rb +57 -0
  18. data/lib/google/cloud/lustre/v1/rest.rb +38 -0
  19. data/lib/google/cloud/lustre/v1/transfer_pb.rb +61 -0
  20. data/lib/google/cloud/lustre/v1/version.rb +7 -2
  21. data/lib/google/cloud/lustre/v1.rb +45 -0
  22. data/lib/google-cloud-lustre-v1.rb +21 -0
  23. data/proto_docs/README.md +4 -0
  24. data/proto_docs/google/api/client.rb +473 -0
  25. data/proto_docs/google/api/field_behavior.rb +85 -0
  26. data/proto_docs/google/api/field_info.rb +88 -0
  27. data/proto_docs/google/api/launch_stage.rb +71 -0
  28. data/proto_docs/google/api/resource.rb +227 -0
  29. data/proto_docs/google/cloud/lustre/v1/instance.rb +288 -0
  30. data/proto_docs/google/cloud/lustre/v1/transfer.rb +284 -0
  31. data/proto_docs/google/longrunning/operations.rb +173 -0
  32. data/proto_docs/google/protobuf/any.rb +145 -0
  33. data/proto_docs/google/protobuf/duration.rb +98 -0
  34. data/proto_docs/google/protobuf/empty.rb +34 -0
  35. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  36. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  37. data/proto_docs/google/rpc/code.rb +185 -0
  38. data/proto_docs/google/rpc/status.rb +48 -0
  39. metadata +85 -9
@@ -0,0 +1,1185 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/lustre/v1/lustre_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Lustre
26
+ module V1
27
+ module Lustre
28
+ ##
29
+ # Client for the Lustre service.
30
+ #
31
+ # Service describing handlers for resources
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "lustre.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :lustre_stub
44
+
45
+ ##
46
+ # Configure the Lustre Client class.
47
+ #
48
+ # See {::Google::Cloud::Lustre::V1::Lustre::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all Lustre clients
54
+ # ::Google::Cloud::Lustre::V1::Lustre::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "Lustre", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config
75
+ end
76
+ yield @configure if block_given?
77
+ @configure
78
+ end
79
+
80
+ ##
81
+ # Configure the Lustre Client instance.
82
+ #
83
+ # The configuration is set to the derived mode, meaning that values can be changed,
84
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
85
+ # should be made on {Client.configure}.
86
+ #
87
+ # See {::Google::Cloud::Lustre::V1::Lustre::Client::Configuration}
88
+ # for a description of the configuration fields.
89
+ #
90
+ # @yield [config] Configure the Client client.
91
+ # @yieldparam config [Client::Configuration]
92
+ #
93
+ # @return [Client::Configuration]
94
+ #
95
+ def configure
96
+ yield @config if block_given?
97
+ @config
98
+ end
99
+
100
+ ##
101
+ # The effective universe domain
102
+ #
103
+ # @return [String]
104
+ #
105
+ def universe_domain
106
+ @lustre_stub.universe_domain
107
+ end
108
+
109
+ ##
110
+ # Create a new Lustre client object.
111
+ #
112
+ # @example
113
+ #
114
+ # # Create a client using the default configuration
115
+ # client = ::Google::Cloud::Lustre::V1::Lustre::Client.new
116
+ #
117
+ # # Create a client using a custom configuration
118
+ # client = ::Google::Cloud::Lustre::V1::Lustre::Client.new do |config|
119
+ # config.timeout = 10.0
120
+ # end
121
+ #
122
+ # @yield [config] Configure the Lustre client.
123
+ # @yieldparam config [Client::Configuration]
124
+ #
125
+ def initialize
126
+ # These require statements are intentionally placed here to initialize
127
+ # the gRPC module only when it's required.
128
+ # See https://github.com/googleapis/toolkit/issues/446
129
+ require "gapic/grpc"
130
+ require "google/cloud/lustre/v1/lustre_services_pb"
131
+
132
+ # Create the configuration object
133
+ @config = Configuration.new Client.configure
134
+
135
+ # Yield the configuration if needed
136
+ yield @config if block_given?
137
+
138
+ # Create credentials
139
+ credentials = @config.credentials
140
+ # Use self-signed JWT if the endpoint is unchanged from default,
141
+ # but only if the default endpoint does not have a region prefix.
142
+ enable_self_signed_jwt = @config.endpoint.nil? ||
143
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
144
+ !@config.endpoint.split(".").first.include?("-"))
145
+ credentials ||= Credentials.default scope: @config.scope,
146
+ enable_self_signed_jwt: enable_self_signed_jwt
147
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
148
+ credentials = Credentials.new credentials, scope: @config.scope
149
+ end
150
+ @quota_project_id = @config.quota_project
151
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
152
+
153
+ @operations_client = Operations.new do |config|
154
+ config.credentials = credentials
155
+ config.quota_project = @quota_project_id
156
+ config.endpoint = @config.endpoint
157
+ config.universe_domain = @config.universe_domain
158
+ end
159
+
160
+ @lustre_stub = ::Gapic::ServiceStub.new(
161
+ ::Google::Cloud::Lustre::V1::Lustre::Stub,
162
+ credentials: credentials,
163
+ endpoint: @config.endpoint,
164
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
+ universe_domain: @config.universe_domain,
166
+ channel_args: @config.channel_args,
167
+ interceptors: @config.interceptors,
168
+ channel_pool_config: @config.channel_pool,
169
+ logger: @config.logger
170
+ )
171
+
172
+ @lustre_stub.stub_logger&.info do |entry|
173
+ entry.set_system_name
174
+ entry.set_service
175
+ entry.message = "Created client for #{entry.service}"
176
+ entry.set_credentials_fields credentials
177
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
178
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
179
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
180
+ end
181
+
182
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
183
+ config.credentials = credentials
184
+ config.quota_project = @quota_project_id
185
+ config.endpoint = @lustre_stub.endpoint
186
+ config.universe_domain = @lustre_stub.universe_domain
187
+ config.logger = @lustre_stub.logger if config.respond_to? :logger=
188
+ end
189
+ end
190
+
191
+ ##
192
+ # Get the associated client for long-running operations.
193
+ #
194
+ # @return [::Google::Cloud::Lustre::V1::Lustre::Operations]
195
+ #
196
+ attr_reader :operations_client
197
+
198
+ ##
199
+ # Get the associated client for mix-in of the Locations.
200
+ #
201
+ # @return [Google::Cloud::Location::Locations::Client]
202
+ #
203
+ attr_reader :location_client
204
+
205
+ ##
206
+ # The logger used for request/response debug logging.
207
+ #
208
+ # @return [Logger]
209
+ #
210
+ def logger
211
+ @lustre_stub.logger
212
+ end
213
+
214
+ # Service calls
215
+
216
+ ##
217
+ # Lists instances in a given project and location.
218
+ #
219
+ # @overload list_instances(request, options = nil)
220
+ # Pass arguments to `list_instances` via a request object, either of type
221
+ # {::Google::Cloud::Lustre::V1::ListInstancesRequest} or an equivalent Hash.
222
+ #
223
+ # @param request [::Google::Cloud::Lustre::V1::ListInstancesRequest, ::Hash]
224
+ # A request object representing the call parameters. Required. To specify no
225
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
226
+ # @param options [::Gapic::CallOptions, ::Hash]
227
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
228
+ #
229
+ # @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
230
+ # Pass arguments to `list_instances` via keyword arguments. Note that at
231
+ # least one keyword argument is required. To specify no parameters, or to keep all
232
+ # the default parameter values, pass an empty Hash as a request object (see above).
233
+ #
234
+ # @param parent [::String]
235
+ # Required. The project and location for which to retrieve a list of
236
+ # instances, in the format `projects/{projectId}/locations/{location}`.
237
+ #
238
+ # To retrieve instance information for all locations, use "-" as the value
239
+ # of `{location}`.
240
+ # @param page_size [::Integer]
241
+ # Optional. Requested page size. Server might return fewer items than
242
+ # requested. If unspecified, the server will pick an appropriate default.
243
+ # @param page_token [::String]
244
+ # Optional. A token identifying a page of results the server should return.
245
+ # @param filter [::String]
246
+ # Optional. Filtering results.
247
+ # @param order_by [::String]
248
+ # Optional. Desired order of results.
249
+ #
250
+ # @yield [response, operation] Access the result along with the RPC operation
251
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Lustre::V1::Instance>]
252
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
253
+ #
254
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Lustre::V1::Instance>]
255
+ #
256
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
257
+ #
258
+ # @example Basic example
259
+ # require "google/cloud/lustre/v1"
260
+ #
261
+ # # Create a client object. The client can be reused for multiple calls.
262
+ # client = Google::Cloud::Lustre::V1::Lustre::Client.new
263
+ #
264
+ # # Create a request. To set request fields, pass in keyword arguments.
265
+ # request = Google::Cloud::Lustre::V1::ListInstancesRequest.new
266
+ #
267
+ # # Call the list_instances method.
268
+ # result = client.list_instances request
269
+ #
270
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
271
+ # # over elements, and API calls will be issued to fetch pages as needed.
272
+ # result.each do |item|
273
+ # # Each element is of type ::Google::Cloud::Lustre::V1::Instance.
274
+ # p item
275
+ # end
276
+ #
277
+ def list_instances request, options = nil
278
+ raise ::ArgumentError, "request must be provided" if request.nil?
279
+
280
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Lustre::V1::ListInstancesRequest
281
+
282
+ # Converts hash and nil to an options object
283
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
284
+
285
+ # Customize the options with defaults
286
+ metadata = @config.rpcs.list_instances.metadata.to_h
287
+
288
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
289
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
290
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
291
+ gapic_version: ::Google::Cloud::Lustre::V1::VERSION
292
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
293
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
294
+
295
+ header_params = {}
296
+ if request.parent
297
+ header_params["parent"] = request.parent
298
+ end
299
+
300
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
301
+ metadata[:"x-goog-request-params"] ||= request_params_header
302
+
303
+ options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
304
+ metadata: metadata,
305
+ retry_policy: @config.rpcs.list_instances.retry_policy
306
+
307
+ options.apply_defaults timeout: @config.timeout,
308
+ metadata: @config.metadata,
309
+ retry_policy: @config.retry_policy
310
+
311
+ @lustre_stub.call_rpc :list_instances, request, options: options do |response, operation|
312
+ response = ::Gapic::PagedEnumerable.new @lustre_stub, :list_instances, request, response, operation, options
313
+ yield response, operation if block_given?
314
+ throw :response, response
315
+ end
316
+ rescue ::GRPC::BadStatus => e
317
+ raise ::Google::Cloud::Error.from_error(e)
318
+ end
319
+
320
+ ##
321
+ # Gets details of a single instance.
322
+ #
323
+ # @overload get_instance(request, options = nil)
324
+ # Pass arguments to `get_instance` via a request object, either of type
325
+ # {::Google::Cloud::Lustre::V1::GetInstanceRequest} or an equivalent Hash.
326
+ #
327
+ # @param request [::Google::Cloud::Lustre::V1::GetInstanceRequest, ::Hash]
328
+ # A request object representing the call parameters. Required. To specify no
329
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
330
+ # @param options [::Gapic::CallOptions, ::Hash]
331
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
332
+ #
333
+ # @overload get_instance(name: nil)
334
+ # Pass arguments to `get_instance` via keyword arguments. Note that at
335
+ # least one keyword argument is required. To specify no parameters, or to keep all
336
+ # the default parameter values, pass an empty Hash as a request object (see above).
337
+ #
338
+ # @param name [::String]
339
+ # Required. The instance resource name, in the format
340
+ # `projects/{projectId}/locations/{location}/instances/{instanceId}`.
341
+ #
342
+ # @yield [response, operation] Access the result along with the RPC operation
343
+ # @yieldparam response [::Google::Cloud::Lustre::V1::Instance]
344
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
345
+ #
346
+ # @return [::Google::Cloud::Lustre::V1::Instance]
347
+ #
348
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
349
+ #
350
+ # @example Basic example
351
+ # require "google/cloud/lustre/v1"
352
+ #
353
+ # # Create a client object. The client can be reused for multiple calls.
354
+ # client = Google::Cloud::Lustre::V1::Lustre::Client.new
355
+ #
356
+ # # Create a request. To set request fields, pass in keyword arguments.
357
+ # request = Google::Cloud::Lustre::V1::GetInstanceRequest.new
358
+ #
359
+ # # Call the get_instance method.
360
+ # result = client.get_instance request
361
+ #
362
+ # # The returned object is of type Google::Cloud::Lustre::V1::Instance.
363
+ # p result
364
+ #
365
+ def get_instance request, options = nil
366
+ raise ::ArgumentError, "request must be provided" if request.nil?
367
+
368
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Lustre::V1::GetInstanceRequest
369
+
370
+ # Converts hash and nil to an options object
371
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
372
+
373
+ # Customize the options with defaults
374
+ metadata = @config.rpcs.get_instance.metadata.to_h
375
+
376
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
377
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
378
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
379
+ gapic_version: ::Google::Cloud::Lustre::V1::VERSION
380
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
381
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
382
+
383
+ header_params = {}
384
+ if request.name
385
+ header_params["name"] = request.name
386
+ end
387
+
388
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
389
+ metadata[:"x-goog-request-params"] ||= request_params_header
390
+
391
+ options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
392
+ metadata: metadata,
393
+ retry_policy: @config.rpcs.get_instance.retry_policy
394
+
395
+ options.apply_defaults timeout: @config.timeout,
396
+ metadata: @config.metadata,
397
+ retry_policy: @config.retry_policy
398
+
399
+ @lustre_stub.call_rpc :get_instance, request, options: options do |response, operation|
400
+ yield response, operation if block_given?
401
+ end
402
+ rescue ::GRPC::BadStatus => e
403
+ raise ::Google::Cloud::Error.from_error(e)
404
+ end
405
+
406
+ ##
407
+ # Creates a new instance in a given project and location.
408
+ #
409
+ # @overload create_instance(request, options = nil)
410
+ # Pass arguments to `create_instance` via a request object, either of type
411
+ # {::Google::Cloud::Lustre::V1::CreateInstanceRequest} or an equivalent Hash.
412
+ #
413
+ # @param request [::Google::Cloud::Lustre::V1::CreateInstanceRequest, ::Hash]
414
+ # A request object representing the call parameters. Required. To specify no
415
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
416
+ # @param options [::Gapic::CallOptions, ::Hash]
417
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
418
+ #
419
+ # @overload create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil)
420
+ # Pass arguments to `create_instance` via keyword arguments. Note that at
421
+ # least one keyword argument is required. To specify no parameters, or to keep all
422
+ # the default parameter values, pass an empty Hash as a request object (see above).
423
+ #
424
+ # @param parent [::String]
425
+ # Required. The instance's project and location, in the format
426
+ # `projects/{project}/locations/{location}`. Locations map to Google Cloud
427
+ # zones; for example, `us-west1-b`.
428
+ # @param instance_id [::String]
429
+ # Required. The name of the Managed Lustre instance.
430
+ #
431
+ # * Must contain only lowercase letters, numbers, and hyphens.
432
+ # * Must start with a letter.
433
+ # * Must be between 1-63 characters.
434
+ # * Must end with a number or a letter.
435
+ # @param instance [::Google::Cloud::Lustre::V1::Instance, ::Hash]
436
+ # Required. The resource being created
437
+ # @param request_id [::String]
438
+ # Optional. An optional request ID to identify requests. Specify a unique
439
+ # request ID so that if you must retry your request, the server will know to
440
+ # ignore the request if it has already been completed. The server will
441
+ # guarantee that for at least 60 minutes since the first request.
442
+ #
443
+ # For example, consider a situation where you make an initial request and the
444
+ # request times out. If you make the request again with the same request
445
+ # ID, the server can check if original operation with the same request ID
446
+ # was received, and if so, will ignore the second request. This prevents
447
+ # clients from accidentally creating duplicate commitments.
448
+ #
449
+ # The request ID must be a valid UUID with the exception that zero UUID is
450
+ # not supported (00000000-0000-0000-0000-000000000000).
451
+ #
452
+ # @yield [response, operation] Access the result along with the RPC operation
453
+ # @yieldparam response [::Gapic::Operation]
454
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
455
+ #
456
+ # @return [::Gapic::Operation]
457
+ #
458
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
459
+ #
460
+ # @example Basic example
461
+ # require "google/cloud/lustre/v1"
462
+ #
463
+ # # Create a client object. The client can be reused for multiple calls.
464
+ # client = Google::Cloud::Lustre::V1::Lustre::Client.new
465
+ #
466
+ # # Create a request. To set request fields, pass in keyword arguments.
467
+ # request = Google::Cloud::Lustre::V1::CreateInstanceRequest.new
468
+ #
469
+ # # Call the create_instance method.
470
+ # result = client.create_instance request
471
+ #
472
+ # # The returned object is of type Gapic::Operation. You can use it to
473
+ # # check the status of an operation, cancel it, or wait for results.
474
+ # # Here is how to wait for a response.
475
+ # result.wait_until_done! timeout: 60
476
+ # if result.response?
477
+ # p result.response
478
+ # else
479
+ # puts "No response received."
480
+ # end
481
+ #
482
+ def create_instance request, options = nil
483
+ raise ::ArgumentError, "request must be provided" if request.nil?
484
+
485
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Lustre::V1::CreateInstanceRequest
486
+
487
+ # Converts hash and nil to an options object
488
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
489
+
490
+ # Customize the options with defaults
491
+ metadata = @config.rpcs.create_instance.metadata.to_h
492
+
493
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
494
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
495
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
496
+ gapic_version: ::Google::Cloud::Lustre::V1::VERSION
497
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
498
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
499
+
500
+ header_params = {}
501
+ if request.parent
502
+ header_params["parent"] = request.parent
503
+ end
504
+
505
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
506
+ metadata[:"x-goog-request-params"] ||= request_params_header
507
+
508
+ options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
509
+ metadata: metadata,
510
+ retry_policy: @config.rpcs.create_instance.retry_policy
511
+
512
+ options.apply_defaults timeout: @config.timeout,
513
+ metadata: @config.metadata,
514
+ retry_policy: @config.retry_policy
515
+
516
+ @lustre_stub.call_rpc :create_instance, request, options: options do |response, operation|
517
+ response = ::Gapic::Operation.new response, @operations_client, options: options
518
+ yield response, operation if block_given?
519
+ throw :response, response
520
+ end
521
+ rescue ::GRPC::BadStatus => e
522
+ raise ::Google::Cloud::Error.from_error(e)
523
+ end
524
+
525
+ ##
526
+ # Updates the parameters of a single instance.
527
+ #
528
+ # @overload update_instance(request, options = nil)
529
+ # Pass arguments to `update_instance` via a request object, either of type
530
+ # {::Google::Cloud::Lustre::V1::UpdateInstanceRequest} or an equivalent Hash.
531
+ #
532
+ # @param request [::Google::Cloud::Lustre::V1::UpdateInstanceRequest, ::Hash]
533
+ # A request object representing the call parameters. Required. To specify no
534
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
535
+ # @param options [::Gapic::CallOptions, ::Hash]
536
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
537
+ #
538
+ # @overload update_instance(update_mask: nil, instance: nil, request_id: nil)
539
+ # Pass arguments to `update_instance` via keyword arguments. Note that at
540
+ # least one keyword argument is required. To specify no parameters, or to keep all
541
+ # the default parameter values, pass an empty Hash as a request object (see above).
542
+ #
543
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
544
+ # Optional. Specifies the fields to be overwritten in the instance resource
545
+ # by the update.
546
+ #
547
+ # The fields specified in the update_mask are relative to the resource, not
548
+ # the full request. A field will be overwritten if it is in the mask. If no
549
+ # mask is provided then all fields present in the request are
550
+ # overwritten.
551
+ # @param instance [::Google::Cloud::Lustre::V1::Instance, ::Hash]
552
+ # Required. The resource name of the instance to update, in the format
553
+ # `projects/{projectId}/locations/{location}/instances/{instanceId}`.
554
+ # @param request_id [::String]
555
+ # Optional. An optional request ID to identify requests. Specify a unique
556
+ # request ID so that if you must retry your request, the server will know to
557
+ # ignore the request if it has already been completed. The server will
558
+ # guarantee that for at least 60 minutes since the first request.
559
+ #
560
+ # For example, consider a situation where you make an initial request and the
561
+ # request times out. If you make the request again with the same request
562
+ # ID, the server can check if original operation with the same request ID
563
+ # was received, and if so, will ignore the second request. This prevents
564
+ # clients from accidentally creating duplicate commitments.
565
+ #
566
+ # The request ID must be a valid UUID with the exception that zero UUID is
567
+ # not supported (00000000-0000-0000-0000-000000000000).
568
+ #
569
+ # @yield [response, operation] Access the result along with the RPC operation
570
+ # @yieldparam response [::Gapic::Operation]
571
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
572
+ #
573
+ # @return [::Gapic::Operation]
574
+ #
575
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
576
+ #
577
+ # @example Basic example
578
+ # require "google/cloud/lustre/v1"
579
+ #
580
+ # # Create a client object. The client can be reused for multiple calls.
581
+ # client = Google::Cloud::Lustre::V1::Lustre::Client.new
582
+ #
583
+ # # Create a request. To set request fields, pass in keyword arguments.
584
+ # request = Google::Cloud::Lustre::V1::UpdateInstanceRequest.new
585
+ #
586
+ # # Call the update_instance method.
587
+ # result = client.update_instance request
588
+ #
589
+ # # The returned object is of type Gapic::Operation. You can use it to
590
+ # # check the status of an operation, cancel it, or wait for results.
591
+ # # Here is how to wait for a response.
592
+ # result.wait_until_done! timeout: 60
593
+ # if result.response?
594
+ # p result.response
595
+ # else
596
+ # puts "No response received."
597
+ # end
598
+ #
599
+ def update_instance request, options = nil
600
+ raise ::ArgumentError, "request must be provided" if request.nil?
601
+
602
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Lustre::V1::UpdateInstanceRequest
603
+
604
+ # Converts hash and nil to an options object
605
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
606
+
607
+ # Customize the options with defaults
608
+ metadata = @config.rpcs.update_instance.metadata.to_h
609
+
610
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
611
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
612
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
613
+ gapic_version: ::Google::Cloud::Lustre::V1::VERSION
614
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
615
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
616
+
617
+ header_params = {}
618
+ if request.instance&.name
619
+ header_params["instance.name"] = request.instance.name
620
+ end
621
+
622
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
623
+ metadata[:"x-goog-request-params"] ||= request_params_header
624
+
625
+ options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
626
+ metadata: metadata,
627
+ retry_policy: @config.rpcs.update_instance.retry_policy
628
+
629
+ options.apply_defaults timeout: @config.timeout,
630
+ metadata: @config.metadata,
631
+ retry_policy: @config.retry_policy
632
+
633
+ @lustre_stub.call_rpc :update_instance, request, options: options do |response, operation|
634
+ response = ::Gapic::Operation.new response, @operations_client, options: options
635
+ yield response, operation if block_given?
636
+ throw :response, response
637
+ end
638
+ rescue ::GRPC::BadStatus => e
639
+ raise ::Google::Cloud::Error.from_error(e)
640
+ end
641
+
642
+ ##
643
+ # Deletes a single instance.
644
+ #
645
+ # @overload delete_instance(request, options = nil)
646
+ # Pass arguments to `delete_instance` via a request object, either of type
647
+ # {::Google::Cloud::Lustre::V1::DeleteInstanceRequest} or an equivalent Hash.
648
+ #
649
+ # @param request [::Google::Cloud::Lustre::V1::DeleteInstanceRequest, ::Hash]
650
+ # A request object representing the call parameters. Required. To specify no
651
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
652
+ # @param options [::Gapic::CallOptions, ::Hash]
653
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
654
+ #
655
+ # @overload delete_instance(name: nil, request_id: nil)
656
+ # Pass arguments to `delete_instance` via keyword arguments. Note that at
657
+ # least one keyword argument is required. To specify no parameters, or to keep all
658
+ # the default parameter values, pass an empty Hash as a request object (see above).
659
+ #
660
+ # @param name [::String]
661
+ # Required. The resource name of the instance to delete, in the format
662
+ # `projects/{projectId}/locations/{location}/instances/{instanceId}`.
663
+ # @param request_id [::String]
664
+ # Optional. An optional request ID to identify requests. Specify a unique
665
+ # request ID so that if you must retry your request, the server will know to
666
+ # ignore the request if it has already been completed. The server will
667
+ # guarantee that for at least 60 minutes after the first request.
668
+ #
669
+ # For example, consider a situation where you make an initial request and the
670
+ # request times out. If you make the request again with the same request
671
+ # ID, the server can check if original operation with the same request ID
672
+ # was received, and if so, will ignore the second request. This prevents
673
+ # clients from accidentally creating duplicate commitments.
674
+ #
675
+ # The request ID must be a valid UUID with the exception that zero UUID is
676
+ # not supported (00000000-0000-0000-0000-000000000000).
677
+ #
678
+ # @yield [response, operation] Access the result along with the RPC operation
679
+ # @yieldparam response [::Gapic::Operation]
680
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
681
+ #
682
+ # @return [::Gapic::Operation]
683
+ #
684
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
685
+ #
686
+ # @example Basic example
687
+ # require "google/cloud/lustre/v1"
688
+ #
689
+ # # Create a client object. The client can be reused for multiple calls.
690
+ # client = Google::Cloud::Lustre::V1::Lustre::Client.new
691
+ #
692
+ # # Create a request. To set request fields, pass in keyword arguments.
693
+ # request = Google::Cloud::Lustre::V1::DeleteInstanceRequest.new
694
+ #
695
+ # # Call the delete_instance method.
696
+ # result = client.delete_instance request
697
+ #
698
+ # # The returned object is of type Gapic::Operation. You can use it to
699
+ # # check the status of an operation, cancel it, or wait for results.
700
+ # # Here is how to wait for a response.
701
+ # result.wait_until_done! timeout: 60
702
+ # if result.response?
703
+ # p result.response
704
+ # else
705
+ # puts "No response received."
706
+ # end
707
+ #
708
+ def delete_instance request, options = nil
709
+ raise ::ArgumentError, "request must be provided" if request.nil?
710
+
711
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Lustre::V1::DeleteInstanceRequest
712
+
713
+ # Converts hash and nil to an options object
714
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
715
+
716
+ # Customize the options with defaults
717
+ metadata = @config.rpcs.delete_instance.metadata.to_h
718
+
719
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
720
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
721
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
722
+ gapic_version: ::Google::Cloud::Lustre::V1::VERSION
723
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
724
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
725
+
726
+ header_params = {}
727
+ if request.name
728
+ header_params["name"] = request.name
729
+ end
730
+
731
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
732
+ metadata[:"x-goog-request-params"] ||= request_params_header
733
+
734
+ options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
735
+ metadata: metadata,
736
+ retry_policy: @config.rpcs.delete_instance.retry_policy
737
+
738
+ options.apply_defaults timeout: @config.timeout,
739
+ metadata: @config.metadata,
740
+ retry_policy: @config.retry_policy
741
+
742
+ @lustre_stub.call_rpc :delete_instance, request, options: options do |response, operation|
743
+ response = ::Gapic::Operation.new response, @operations_client, options: options
744
+ yield response, operation if block_given?
745
+ throw :response, response
746
+ end
747
+ rescue ::GRPC::BadStatus => e
748
+ raise ::Google::Cloud::Error.from_error(e)
749
+ end
750
+
751
+ ##
752
+ # Imports data from Cloud Storage to a Managed Lustre instance.
753
+ #
754
+ # @overload import_data(request, options = nil)
755
+ # Pass arguments to `import_data` via a request object, either of type
756
+ # {::Google::Cloud::Lustre::V1::ImportDataRequest} or an equivalent Hash.
757
+ #
758
+ # @param request [::Google::Cloud::Lustre::V1::ImportDataRequest, ::Hash]
759
+ # A request object representing the call parameters. Required. To specify no
760
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
761
+ # @param options [::Gapic::CallOptions, ::Hash]
762
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
763
+ #
764
+ # @overload import_data(gcs_path: nil, lustre_path: nil, name: nil, request_id: nil, service_account: nil)
765
+ # Pass arguments to `import_data` via keyword arguments. Note that at
766
+ # least one keyword argument is required. To specify no parameters, or to keep all
767
+ # the default parameter values, pass an empty Hash as a request object (see above).
768
+ #
769
+ # @param gcs_path [::Google::Cloud::Lustre::V1::GcsPath, ::Hash]
770
+ # The Cloud Storage source bucket and, optionally, path inside the bucket.
771
+ # @param lustre_path [::Google::Cloud::Lustre::V1::LustrePath, ::Hash]
772
+ # Lustre path destination.
773
+ # @param name [::String]
774
+ # Required. Name of the resource.
775
+ # @param request_id [::String]
776
+ # Optional. UUID to identify requests.
777
+ # @param service_account [::String]
778
+ # Optional. User-specified service account used to perform the transfer.
779
+ # If unspecified, the default Lustre P4 service account will be used.
780
+ #
781
+ # @yield [response, operation] Access the result along with the RPC operation
782
+ # @yieldparam response [::Gapic::Operation]
783
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
784
+ #
785
+ # @return [::Gapic::Operation]
786
+ #
787
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
788
+ #
789
+ # @example Basic example
790
+ # require "google/cloud/lustre/v1"
791
+ #
792
+ # # Create a client object. The client can be reused for multiple calls.
793
+ # client = Google::Cloud::Lustre::V1::Lustre::Client.new
794
+ #
795
+ # # Create a request. To set request fields, pass in keyword arguments.
796
+ # request = Google::Cloud::Lustre::V1::ImportDataRequest.new
797
+ #
798
+ # # Call the import_data method.
799
+ # result = client.import_data request
800
+ #
801
+ # # The returned object is of type Gapic::Operation. You can use it to
802
+ # # check the status of an operation, cancel it, or wait for results.
803
+ # # Here is how to wait for a response.
804
+ # result.wait_until_done! timeout: 60
805
+ # if result.response?
806
+ # p result.response
807
+ # else
808
+ # puts "No response received."
809
+ # end
810
+ #
811
+ def import_data request, options = nil
812
+ raise ::ArgumentError, "request must be provided" if request.nil?
813
+
814
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Lustre::V1::ImportDataRequest
815
+
816
+ # Converts hash and nil to an options object
817
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
818
+
819
+ # Customize the options with defaults
820
+ metadata = @config.rpcs.import_data.metadata.to_h
821
+
822
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
823
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
824
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
825
+ gapic_version: ::Google::Cloud::Lustre::V1::VERSION
826
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
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.import_data.timeout,
838
+ metadata: metadata,
839
+ retry_policy: @config.rpcs.import_data.retry_policy
840
+
841
+ options.apply_defaults timeout: @config.timeout,
842
+ metadata: @config.metadata,
843
+ retry_policy: @config.retry_policy
844
+
845
+ @lustre_stub.call_rpc :import_data, request, options: options do |response, operation|
846
+ response = ::Gapic::Operation.new response, @operations_client, options: options
847
+ yield response, operation if block_given?
848
+ throw :response, response
849
+ end
850
+ rescue ::GRPC::BadStatus => e
851
+ raise ::Google::Cloud::Error.from_error(e)
852
+ end
853
+
854
+ ##
855
+ # Exports data from a Managed Lustre instance to Cloud Storage.
856
+ #
857
+ # @overload export_data(request, options = nil)
858
+ # Pass arguments to `export_data` via a request object, either of type
859
+ # {::Google::Cloud::Lustre::V1::ExportDataRequest} or an equivalent Hash.
860
+ #
861
+ # @param request [::Google::Cloud::Lustre::V1::ExportDataRequest, ::Hash]
862
+ # A request object representing the call parameters. Required. To specify no
863
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
864
+ # @param options [::Gapic::CallOptions, ::Hash]
865
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
866
+ #
867
+ # @overload export_data(lustre_path: nil, gcs_path: nil, name: nil, request_id: nil, service_account: nil)
868
+ # Pass arguments to `export_data` via keyword arguments. Note that at
869
+ # least one keyword argument is required. To specify no parameters, or to keep all
870
+ # the default parameter values, pass an empty Hash as a request object (see above).
871
+ #
872
+ # @param lustre_path [::Google::Cloud::Lustre::V1::LustrePath, ::Hash]
873
+ # Lustre path source.
874
+ # @param gcs_path [::Google::Cloud::Lustre::V1::GcsPath, ::Hash]
875
+ # Cloud Storage destination.
876
+ # @param name [::String]
877
+ # Required. Name of the resource.
878
+ # @param request_id [::String]
879
+ # Optional. UUID to identify requests.
880
+ # @param service_account [::String]
881
+ # Optional. User-specified service account used to perform the transfer.
882
+ # If unspecified, the Managed Lustre service agent is used.
883
+ #
884
+ # @yield [response, operation] Access the result along with the RPC operation
885
+ # @yieldparam response [::Gapic::Operation]
886
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
887
+ #
888
+ # @return [::Gapic::Operation]
889
+ #
890
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
891
+ #
892
+ # @example Basic example
893
+ # require "google/cloud/lustre/v1"
894
+ #
895
+ # # Create a client object. The client can be reused for multiple calls.
896
+ # client = Google::Cloud::Lustre::V1::Lustre::Client.new
897
+ #
898
+ # # Create a request. To set request fields, pass in keyword arguments.
899
+ # request = Google::Cloud::Lustre::V1::ExportDataRequest.new
900
+ #
901
+ # # Call the export_data method.
902
+ # result = client.export_data request
903
+ #
904
+ # # The returned object is of type Gapic::Operation. You can use it to
905
+ # # check the status of an operation, cancel it, or wait for results.
906
+ # # Here is how to wait for a response.
907
+ # result.wait_until_done! timeout: 60
908
+ # if result.response?
909
+ # p result.response
910
+ # else
911
+ # puts "No response received."
912
+ # end
913
+ #
914
+ def export_data request, options = nil
915
+ raise ::ArgumentError, "request must be provided" if request.nil?
916
+
917
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Lustre::V1::ExportDataRequest
918
+
919
+ # Converts hash and nil to an options object
920
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
921
+
922
+ # Customize the options with defaults
923
+ metadata = @config.rpcs.export_data.metadata.to_h
924
+
925
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
926
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
927
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
928
+ gapic_version: ::Google::Cloud::Lustre::V1::VERSION
929
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
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.export_data.timeout,
941
+ metadata: metadata,
942
+ retry_policy: @config.rpcs.export_data.retry_policy
943
+
944
+ options.apply_defaults timeout: @config.timeout,
945
+ metadata: @config.metadata,
946
+ retry_policy: @config.retry_policy
947
+
948
+ @lustre_stub.call_rpc :export_data, request, options: options do |response, operation|
949
+ response = ::Gapic::Operation.new response, @operations_client, options: options
950
+ yield response, operation if block_given?
951
+ throw :response, response
952
+ end
953
+ rescue ::GRPC::BadStatus => e
954
+ raise ::Google::Cloud::Error.from_error(e)
955
+ end
956
+
957
+ ##
958
+ # Configuration class for the Lustre API.
959
+ #
960
+ # This class represents the configuration for Lustre,
961
+ # providing control over timeouts, retry behavior, logging, transport
962
+ # parameters, and other low-level controls. Certain parameters can also be
963
+ # applied individually to specific RPCs. See
964
+ # {::Google::Cloud::Lustre::V1::Lustre::Client::Configuration::Rpcs}
965
+ # for a list of RPCs that can be configured independently.
966
+ #
967
+ # Configuration can be applied globally to all clients, or to a single client
968
+ # on construction.
969
+ #
970
+ # @example
971
+ #
972
+ # # Modify the global config, setting the timeout for
973
+ # # list_instances to 20 seconds,
974
+ # # and all remaining timeouts to 10 seconds.
975
+ # ::Google::Cloud::Lustre::V1::Lustre::Client.configure do |config|
976
+ # config.timeout = 10.0
977
+ # config.rpcs.list_instances.timeout = 20.0
978
+ # end
979
+ #
980
+ # # Apply the above configuration only to a new client.
981
+ # client = ::Google::Cloud::Lustre::V1::Lustre::Client.new do |config|
982
+ # config.timeout = 10.0
983
+ # config.rpcs.list_instances.timeout = 20.0
984
+ # end
985
+ #
986
+ # @!attribute [rw] endpoint
987
+ # A custom service endpoint, as a hostname or hostname:port. The default is
988
+ # nil, indicating to use the default endpoint in the current universe domain.
989
+ # @return [::String,nil]
990
+ # @!attribute [rw] credentials
991
+ # Credentials to send with calls. You may provide any of the following types:
992
+ # * (`String`) The path to a service account key file in JSON format
993
+ # * (`Hash`) A service account key as a Hash
994
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
995
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
996
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
997
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
998
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
999
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1000
+ # * (`nil`) indicating no credentials
1001
+ #
1002
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1003
+ # external source for authentication to Google Cloud, you must validate it before
1004
+ # providing it to a Google API client library. Providing an unvalidated credential
1005
+ # configuration to Google APIs can compromise the security of your systems and data.
1006
+ # For more information, refer to [Validate credential configurations from external
1007
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1008
+ # @return [::Object]
1009
+ # @!attribute [rw] scope
1010
+ # The OAuth scopes
1011
+ # @return [::Array<::String>]
1012
+ # @!attribute [rw] lib_name
1013
+ # The library name as recorded in instrumentation and logging
1014
+ # @return [::String]
1015
+ # @!attribute [rw] lib_version
1016
+ # The library version as recorded in instrumentation and logging
1017
+ # @return [::String]
1018
+ # @!attribute [rw] channel_args
1019
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1020
+ # `GRPC::Core::Channel` object is provided as the credential.
1021
+ # @return [::Hash]
1022
+ # @!attribute [rw] interceptors
1023
+ # An array of interceptors that are run before calls are executed.
1024
+ # @return [::Array<::GRPC::ClientInterceptor>]
1025
+ # @!attribute [rw] timeout
1026
+ # The call timeout in seconds.
1027
+ # @return [::Numeric]
1028
+ # @!attribute [rw] metadata
1029
+ # Additional gRPC headers to be sent with the call.
1030
+ # @return [::Hash{::Symbol=>::String}]
1031
+ # @!attribute [rw] retry_policy
1032
+ # The retry policy. The value is a hash with the following keys:
1033
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1034
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1035
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1036
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1037
+ # trigger a retry.
1038
+ # @return [::Hash]
1039
+ # @!attribute [rw] quota_project
1040
+ # A separate project against which to charge quota.
1041
+ # @return [::String]
1042
+ # @!attribute [rw] universe_domain
1043
+ # The universe domain within which to make requests. This determines the
1044
+ # default endpoint URL. The default value of nil uses the environment
1045
+ # universe (usually the default "googleapis.com" universe).
1046
+ # @return [::String,nil]
1047
+ # @!attribute [rw] logger
1048
+ # A custom logger to use for request/response debug logging, or the value
1049
+ # `:default` (the default) to construct a default logger, or `nil` to
1050
+ # explicitly disable logging.
1051
+ # @return [::Logger,:default,nil]
1052
+ #
1053
+ class Configuration
1054
+ extend ::Gapic::Config
1055
+
1056
+ # @private
1057
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1058
+ DEFAULT_ENDPOINT = "lustre.googleapis.com"
1059
+
1060
+ config_attr :endpoint, nil, ::String, nil
1061
+ config_attr :credentials, nil do |value|
1062
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1063
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
1064
+ allowed.any? { |klass| klass === value }
1065
+ end
1066
+ config_attr :scope, nil, ::String, ::Array, nil
1067
+ config_attr :lib_name, nil, ::String, nil
1068
+ config_attr :lib_version, nil, ::String, nil
1069
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1070
+ config_attr :interceptors, nil, ::Array, nil
1071
+ config_attr :timeout, nil, ::Numeric, nil
1072
+ config_attr :metadata, nil, ::Hash, nil
1073
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1074
+ config_attr :quota_project, nil, ::String, nil
1075
+ config_attr :universe_domain, nil, ::String, nil
1076
+ config_attr :logger, :default, ::Logger, nil, :default
1077
+
1078
+ # @private
1079
+ def initialize parent_config = nil
1080
+ @parent_config = parent_config unless parent_config.nil?
1081
+
1082
+ yield self if block_given?
1083
+ end
1084
+
1085
+ ##
1086
+ # Configurations for individual RPCs
1087
+ # @return [Rpcs]
1088
+ #
1089
+ def rpcs
1090
+ @rpcs ||= begin
1091
+ parent_rpcs = nil
1092
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1093
+ Rpcs.new parent_rpcs
1094
+ end
1095
+ end
1096
+
1097
+ ##
1098
+ # Configuration for the channel pool
1099
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1100
+ #
1101
+ def channel_pool
1102
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1103
+ end
1104
+
1105
+ ##
1106
+ # Configuration RPC class for the Lustre API.
1107
+ #
1108
+ # Includes fields providing the configuration for each RPC in this service.
1109
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1110
+ # the following configuration fields:
1111
+ #
1112
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1113
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1114
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1115
+ # include the following keys:
1116
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1117
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1118
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1119
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1120
+ # trigger a retry.
1121
+ #
1122
+ class Rpcs
1123
+ ##
1124
+ # RPC-specific configuration for `list_instances`
1125
+ # @return [::Gapic::Config::Method]
1126
+ #
1127
+ attr_reader :list_instances
1128
+ ##
1129
+ # RPC-specific configuration for `get_instance`
1130
+ # @return [::Gapic::Config::Method]
1131
+ #
1132
+ attr_reader :get_instance
1133
+ ##
1134
+ # RPC-specific configuration for `create_instance`
1135
+ # @return [::Gapic::Config::Method]
1136
+ #
1137
+ attr_reader :create_instance
1138
+ ##
1139
+ # RPC-specific configuration for `update_instance`
1140
+ # @return [::Gapic::Config::Method]
1141
+ #
1142
+ attr_reader :update_instance
1143
+ ##
1144
+ # RPC-specific configuration for `delete_instance`
1145
+ # @return [::Gapic::Config::Method]
1146
+ #
1147
+ attr_reader :delete_instance
1148
+ ##
1149
+ # RPC-specific configuration for `import_data`
1150
+ # @return [::Gapic::Config::Method]
1151
+ #
1152
+ attr_reader :import_data
1153
+ ##
1154
+ # RPC-specific configuration for `export_data`
1155
+ # @return [::Gapic::Config::Method]
1156
+ #
1157
+ attr_reader :export_data
1158
+
1159
+ # @private
1160
+ def initialize parent_rpcs = nil
1161
+ list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
1162
+ @list_instances = ::Gapic::Config::Method.new list_instances_config
1163
+ get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
1164
+ @get_instance = ::Gapic::Config::Method.new get_instance_config
1165
+ create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
1166
+ @create_instance = ::Gapic::Config::Method.new create_instance_config
1167
+ update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
1168
+ @update_instance = ::Gapic::Config::Method.new update_instance_config
1169
+ delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
1170
+ @delete_instance = ::Gapic::Config::Method.new delete_instance_config
1171
+ import_data_config = parent_rpcs.import_data if parent_rpcs.respond_to? :import_data
1172
+ @import_data = ::Gapic::Config::Method.new import_data_config
1173
+ export_data_config = parent_rpcs.export_data if parent_rpcs.respond_to? :export_data
1174
+ @export_data = ::Gapic::Config::Method.new export_data_config
1175
+
1176
+ yield self if block_given?
1177
+ end
1178
+ end
1179
+ end
1180
+ end
1181
+ end
1182
+ end
1183
+ end
1184
+ end
1185
+ end