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

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 +1193 -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 +1126 -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 +287 -0
  30. data/proto_docs/google/cloud/lustre/v1/transfer.rb +296 -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 +86 -10
@@ -0,0 +1,1193 @@
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
+ # If a path inside the bucket is specified, it must end with a forward
772
+ # slash (`/`).
773
+ # @param lustre_path [::Google::Cloud::Lustre::V1::LustrePath, ::Hash]
774
+ # Lustre path destination.
775
+ # @param name [::String]
776
+ # Required. The name of the Managed Lustre instance in the format
777
+ # `projects/{project}/locations/{location}/instances/{instance}`.
778
+ # @param request_id [::String]
779
+ # Optional. UUID to identify requests.
780
+ # @param service_account [::String]
781
+ # Optional. User-specified service account used to perform the transfer.
782
+ # If unspecified, the default Managed Lustre service agent will be used.
783
+ #
784
+ # @yield [response, operation] Access the result along with the RPC operation
785
+ # @yieldparam response [::Gapic::Operation]
786
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
787
+ #
788
+ # @return [::Gapic::Operation]
789
+ #
790
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
791
+ #
792
+ # @example Basic example
793
+ # require "google/cloud/lustre/v1"
794
+ #
795
+ # # Create a client object. The client can be reused for multiple calls.
796
+ # client = Google::Cloud::Lustre::V1::Lustre::Client.new
797
+ #
798
+ # # Create a request. To set request fields, pass in keyword arguments.
799
+ # request = Google::Cloud::Lustre::V1::ImportDataRequest.new
800
+ #
801
+ # # Call the import_data method.
802
+ # result = client.import_data request
803
+ #
804
+ # # The returned object is of type Gapic::Operation. You can use it to
805
+ # # check the status of an operation, cancel it, or wait for results.
806
+ # # Here is how to wait for a response.
807
+ # result.wait_until_done! timeout: 60
808
+ # if result.response?
809
+ # p result.response
810
+ # else
811
+ # puts "No response received."
812
+ # end
813
+ #
814
+ def import_data request, options = nil
815
+ raise ::ArgumentError, "request must be provided" if request.nil?
816
+
817
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Lustre::V1::ImportDataRequest
818
+
819
+ # Converts hash and nil to an options object
820
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
821
+
822
+ # Customize the options with defaults
823
+ metadata = @config.rpcs.import_data.metadata.to_h
824
+
825
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
826
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
827
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
828
+ gapic_version: ::Google::Cloud::Lustre::V1::VERSION
829
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
830
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
831
+
832
+ header_params = {}
833
+ if request.name
834
+ header_params["name"] = request.name
835
+ end
836
+
837
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
838
+ metadata[:"x-goog-request-params"] ||= request_params_header
839
+
840
+ options.apply_defaults timeout: @config.rpcs.import_data.timeout,
841
+ metadata: metadata,
842
+ retry_policy: @config.rpcs.import_data.retry_policy
843
+
844
+ options.apply_defaults timeout: @config.timeout,
845
+ metadata: @config.metadata,
846
+ retry_policy: @config.retry_policy
847
+
848
+ @lustre_stub.call_rpc :import_data, request, options: options do |response, operation|
849
+ response = ::Gapic::Operation.new response, @operations_client, options: options
850
+ yield response, operation if block_given?
851
+ throw :response, response
852
+ end
853
+ rescue ::GRPC::BadStatus => e
854
+ raise ::Google::Cloud::Error.from_error(e)
855
+ end
856
+
857
+ ##
858
+ # Exports data from a Managed Lustre instance to Cloud Storage.
859
+ #
860
+ # @overload export_data(request, options = nil)
861
+ # Pass arguments to `export_data` via a request object, either of type
862
+ # {::Google::Cloud::Lustre::V1::ExportDataRequest} or an equivalent Hash.
863
+ #
864
+ # @param request [::Google::Cloud::Lustre::V1::ExportDataRequest, ::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 export_data(lustre_path: nil, gcs_path: nil, name: nil, request_id: nil, service_account: nil)
871
+ # Pass arguments to `export_data` 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 lustre_path [::Google::Cloud::Lustre::V1::LustrePath, ::Hash]
876
+ # The root directory path to the Managed Lustre file system. Must start
877
+ # with `/`. Default is `/`.
878
+ # @param gcs_path [::Google::Cloud::Lustre::V1::GcsPath, ::Hash]
879
+ # The URI to a Cloud Storage bucket, or a path within a bucket, using
880
+ # the format `gs://<bucket_name>/<optional_path_inside_bucket>/`. If a
881
+ # path inside the bucket is specified, it must end with a forward slash
882
+ # (`/`).
883
+ # @param name [::String]
884
+ # Required. The name of the Managed Lustre instance in the format
885
+ # `projects/{project}/locations/{location}/instances/{instance}`.
886
+ # @param request_id [::String]
887
+ # Optional. UUID to identify requests.
888
+ # @param service_account [::String]
889
+ # Optional. User-specified service account used to perform the transfer.
890
+ # If unspecified, the Managed Lustre service agent is used.
891
+ #
892
+ # @yield [response, operation] Access the result along with the RPC operation
893
+ # @yieldparam response [::Gapic::Operation]
894
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
895
+ #
896
+ # @return [::Gapic::Operation]
897
+ #
898
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
899
+ #
900
+ # @example Basic example
901
+ # require "google/cloud/lustre/v1"
902
+ #
903
+ # # Create a client object. The client can be reused for multiple calls.
904
+ # client = Google::Cloud::Lustre::V1::Lustre::Client.new
905
+ #
906
+ # # Create a request. To set request fields, pass in keyword arguments.
907
+ # request = Google::Cloud::Lustre::V1::ExportDataRequest.new
908
+ #
909
+ # # Call the export_data method.
910
+ # result = client.export_data request
911
+ #
912
+ # # The returned object is of type Gapic::Operation. You can use it to
913
+ # # check the status of an operation, cancel it, or wait for results.
914
+ # # Here is how to wait for a response.
915
+ # result.wait_until_done! timeout: 60
916
+ # if result.response?
917
+ # p result.response
918
+ # else
919
+ # puts "No response received."
920
+ # end
921
+ #
922
+ def export_data request, options = nil
923
+ raise ::ArgumentError, "request must be provided" if request.nil?
924
+
925
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Lustre::V1::ExportDataRequest
926
+
927
+ # Converts hash and nil to an options object
928
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
929
+
930
+ # Customize the options with defaults
931
+ metadata = @config.rpcs.export_data.metadata.to_h
932
+
933
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
934
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
935
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
936
+ gapic_version: ::Google::Cloud::Lustre::V1::VERSION
937
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
938
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
939
+
940
+ header_params = {}
941
+ if request.name
942
+ header_params["name"] = request.name
943
+ end
944
+
945
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
946
+ metadata[:"x-goog-request-params"] ||= request_params_header
947
+
948
+ options.apply_defaults timeout: @config.rpcs.export_data.timeout,
949
+ metadata: metadata,
950
+ retry_policy: @config.rpcs.export_data.retry_policy
951
+
952
+ options.apply_defaults timeout: @config.timeout,
953
+ metadata: @config.metadata,
954
+ retry_policy: @config.retry_policy
955
+
956
+ @lustre_stub.call_rpc :export_data, request, options: options do |response, operation|
957
+ response = ::Gapic::Operation.new response, @operations_client, options: options
958
+ yield response, operation if block_given?
959
+ throw :response, response
960
+ end
961
+ rescue ::GRPC::BadStatus => e
962
+ raise ::Google::Cloud::Error.from_error(e)
963
+ end
964
+
965
+ ##
966
+ # Configuration class for the Lustre API.
967
+ #
968
+ # This class represents the configuration for Lustre,
969
+ # providing control over timeouts, retry behavior, logging, transport
970
+ # parameters, and other low-level controls. Certain parameters can also be
971
+ # applied individually to specific RPCs. See
972
+ # {::Google::Cloud::Lustre::V1::Lustre::Client::Configuration::Rpcs}
973
+ # for a list of RPCs that can be configured independently.
974
+ #
975
+ # Configuration can be applied globally to all clients, or to a single client
976
+ # on construction.
977
+ #
978
+ # @example
979
+ #
980
+ # # Modify the global config, setting the timeout for
981
+ # # list_instances to 20 seconds,
982
+ # # and all remaining timeouts to 10 seconds.
983
+ # ::Google::Cloud::Lustre::V1::Lustre::Client.configure do |config|
984
+ # config.timeout = 10.0
985
+ # config.rpcs.list_instances.timeout = 20.0
986
+ # end
987
+ #
988
+ # # Apply the above configuration only to a new client.
989
+ # client = ::Google::Cloud::Lustre::V1::Lustre::Client.new do |config|
990
+ # config.timeout = 10.0
991
+ # config.rpcs.list_instances.timeout = 20.0
992
+ # end
993
+ #
994
+ # @!attribute [rw] endpoint
995
+ # A custom service endpoint, as a hostname or hostname:port. The default is
996
+ # nil, indicating to use the default endpoint in the current universe domain.
997
+ # @return [::String,nil]
998
+ # @!attribute [rw] credentials
999
+ # Credentials to send with calls. You may provide any of the following types:
1000
+ # * (`String`) The path to a service account key file in JSON format
1001
+ # * (`Hash`) A service account key as a Hash
1002
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1003
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1004
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1005
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1006
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1007
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1008
+ # * (`nil`) indicating no credentials
1009
+ #
1010
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1011
+ # external source for authentication to Google Cloud, you must validate it before
1012
+ # providing it to a Google API client library. Providing an unvalidated credential
1013
+ # configuration to Google APIs can compromise the security of your systems and data.
1014
+ # For more information, refer to [Validate credential configurations from external
1015
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1016
+ # @return [::Object]
1017
+ # @!attribute [rw] scope
1018
+ # The OAuth scopes
1019
+ # @return [::Array<::String>]
1020
+ # @!attribute [rw] lib_name
1021
+ # The library name as recorded in instrumentation and logging
1022
+ # @return [::String]
1023
+ # @!attribute [rw] lib_version
1024
+ # The library version as recorded in instrumentation and logging
1025
+ # @return [::String]
1026
+ # @!attribute [rw] channel_args
1027
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1028
+ # `GRPC::Core::Channel` object is provided as the credential.
1029
+ # @return [::Hash]
1030
+ # @!attribute [rw] interceptors
1031
+ # An array of interceptors that are run before calls are executed.
1032
+ # @return [::Array<::GRPC::ClientInterceptor>]
1033
+ # @!attribute [rw] timeout
1034
+ # The call timeout in seconds.
1035
+ # @return [::Numeric]
1036
+ # @!attribute [rw] metadata
1037
+ # Additional gRPC headers to be sent with the call.
1038
+ # @return [::Hash{::Symbol=>::String}]
1039
+ # @!attribute [rw] retry_policy
1040
+ # The retry policy. The value is a hash with the following keys:
1041
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1042
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1043
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1044
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1045
+ # trigger a retry.
1046
+ # @return [::Hash]
1047
+ # @!attribute [rw] quota_project
1048
+ # A separate project against which to charge quota.
1049
+ # @return [::String]
1050
+ # @!attribute [rw] universe_domain
1051
+ # The universe domain within which to make requests. This determines the
1052
+ # default endpoint URL. The default value of nil uses the environment
1053
+ # universe (usually the default "googleapis.com" universe).
1054
+ # @return [::String,nil]
1055
+ # @!attribute [rw] logger
1056
+ # A custom logger to use for request/response debug logging, or the value
1057
+ # `:default` (the default) to construct a default logger, or `nil` to
1058
+ # explicitly disable logging.
1059
+ # @return [::Logger,:default,nil]
1060
+ #
1061
+ class Configuration
1062
+ extend ::Gapic::Config
1063
+
1064
+ # @private
1065
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1066
+ DEFAULT_ENDPOINT = "lustre.googleapis.com"
1067
+
1068
+ config_attr :endpoint, nil, ::String, nil
1069
+ config_attr :credentials, nil do |value|
1070
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1071
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
1072
+ allowed.any? { |klass| klass === value }
1073
+ end
1074
+ config_attr :scope, nil, ::String, ::Array, nil
1075
+ config_attr :lib_name, nil, ::String, nil
1076
+ config_attr :lib_version, nil, ::String, nil
1077
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1078
+ config_attr :interceptors, nil, ::Array, nil
1079
+ config_attr :timeout, nil, ::Numeric, nil
1080
+ config_attr :metadata, nil, ::Hash, nil
1081
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1082
+ config_attr :quota_project, nil, ::String, nil
1083
+ config_attr :universe_domain, nil, ::String, nil
1084
+ config_attr :logger, :default, ::Logger, nil, :default
1085
+
1086
+ # @private
1087
+ def initialize parent_config = nil
1088
+ @parent_config = parent_config unless parent_config.nil?
1089
+
1090
+ yield self if block_given?
1091
+ end
1092
+
1093
+ ##
1094
+ # Configurations for individual RPCs
1095
+ # @return [Rpcs]
1096
+ #
1097
+ def rpcs
1098
+ @rpcs ||= begin
1099
+ parent_rpcs = nil
1100
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1101
+ Rpcs.new parent_rpcs
1102
+ end
1103
+ end
1104
+
1105
+ ##
1106
+ # Configuration for the channel pool
1107
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1108
+ #
1109
+ def channel_pool
1110
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1111
+ end
1112
+
1113
+ ##
1114
+ # Configuration RPC class for the Lustre API.
1115
+ #
1116
+ # Includes fields providing the configuration for each RPC in this service.
1117
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1118
+ # the following configuration fields:
1119
+ #
1120
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1121
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1122
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1123
+ # include the following keys:
1124
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1125
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1126
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1127
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1128
+ # trigger a retry.
1129
+ #
1130
+ class Rpcs
1131
+ ##
1132
+ # RPC-specific configuration for `list_instances`
1133
+ # @return [::Gapic::Config::Method]
1134
+ #
1135
+ attr_reader :list_instances
1136
+ ##
1137
+ # RPC-specific configuration for `get_instance`
1138
+ # @return [::Gapic::Config::Method]
1139
+ #
1140
+ attr_reader :get_instance
1141
+ ##
1142
+ # RPC-specific configuration for `create_instance`
1143
+ # @return [::Gapic::Config::Method]
1144
+ #
1145
+ attr_reader :create_instance
1146
+ ##
1147
+ # RPC-specific configuration for `update_instance`
1148
+ # @return [::Gapic::Config::Method]
1149
+ #
1150
+ attr_reader :update_instance
1151
+ ##
1152
+ # RPC-specific configuration for `delete_instance`
1153
+ # @return [::Gapic::Config::Method]
1154
+ #
1155
+ attr_reader :delete_instance
1156
+ ##
1157
+ # RPC-specific configuration for `import_data`
1158
+ # @return [::Gapic::Config::Method]
1159
+ #
1160
+ attr_reader :import_data
1161
+ ##
1162
+ # RPC-specific configuration for `export_data`
1163
+ # @return [::Gapic::Config::Method]
1164
+ #
1165
+ attr_reader :export_data
1166
+
1167
+ # @private
1168
+ def initialize parent_rpcs = nil
1169
+ list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
1170
+ @list_instances = ::Gapic::Config::Method.new list_instances_config
1171
+ get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
1172
+ @get_instance = ::Gapic::Config::Method.new get_instance_config
1173
+ create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
1174
+ @create_instance = ::Gapic::Config::Method.new create_instance_config
1175
+ update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
1176
+ @update_instance = ::Gapic::Config::Method.new update_instance_config
1177
+ delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
1178
+ @delete_instance = ::Gapic::Config::Method.new delete_instance_config
1179
+ import_data_config = parent_rpcs.import_data if parent_rpcs.respond_to? :import_data
1180
+ @import_data = ::Gapic::Config::Method.new import_data_config
1181
+ export_data_config = parent_rpcs.export_data if parent_rpcs.respond_to? :export_data
1182
+ @export_data = ::Gapic::Config::Method.new export_data_config
1183
+
1184
+ yield self if block_given?
1185
+ end
1186
+ end
1187
+ end
1188
+ end
1189
+ end
1190
+ end
1191
+ end
1192
+ end
1193
+ end