google-cloud-parallelstore-v1beta 0.3.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47f1e94e2d9595e2d6049ff69b7457611ea68f9e223645879f3549b367a4d226
4
- data.tar.gz: 82362691d7544ac13e41423257a4a0a78364002ff2d6dabebb36c48c93d67535
3
+ metadata.gz: e9c166e71d9b2e85fd7fda45696eaa8ebcbe718221ddecf86e053fb0b3dc3f26
4
+ data.tar.gz: a026b4d0530002938908385289d8a999978af66b299f8f69155539759ca319a9
5
5
  SHA512:
6
- metadata.gz: abdedca29c4d4a37c98601bc95919e7b2e1d2da43bdb0b4e5b6cc9e044d6eb41af17b60e5c6ec37063569d288dcdcb93f6966b04e3d915c91a24a33cab822776
7
- data.tar.gz: 391f9138550060507b6b6bfcb685bedbf0a5a1f5b71bd41891412ebf1ed1db741259d3731f99be1de9015dcc2ad565858833737f8a8c2ed9e5134eb98bce569a
6
+ metadata.gz: bf3ccb73fcc2fe42f20ac06c78a9e75725f75f33b26abc13a63a9ad1c79abdcefafbf42ddc83ba5438c0a5dcef23dbfe59e3348968e12078d6983b3096131a49
7
+ data.tar.gz: d6047fa52a47504ce002e284c21285eb511019a91bd7408563788b5d3b9b43709224c67291c2c3e38ad5c1cb9eb6b78e6fd31c3f09cc2e411046de627e56726c
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/parallelstore?hl=en)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/parallelstore/v1beta"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::Parallelstore::V1beta::Parallelstore::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -179,14 +179,26 @@ module Google
179
179
  universe_domain: @config.universe_domain,
180
180
  channel_args: @config.channel_args,
181
181
  interceptors: @config.interceptors,
182
- channel_pool_config: @config.channel_pool
182
+ channel_pool_config: @config.channel_pool,
183
+ logger: @config.logger
183
184
  )
184
185
 
186
+ @parallelstore_stub.stub_logger&.info do |entry|
187
+ entry.set_system_name
188
+ entry.set_service
189
+ entry.message = "Created client for #{entry.service}"
190
+ entry.set_credentials_fields credentials
191
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
192
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
193
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
194
+ end
195
+
185
196
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
186
197
  config.credentials = credentials
187
198
  config.quota_project = @quota_project_id
188
199
  config.endpoint = @parallelstore_stub.endpoint
189
200
  config.universe_domain = @parallelstore_stub.universe_domain
201
+ config.logger = @parallelstore_stub.logger if config.respond_to? :logger=
190
202
  end
191
203
  end
192
204
 
@@ -204,10 +216,19 @@ module Google
204
216
  #
205
217
  attr_reader :location_client
206
218
 
219
+ ##
220
+ # The logger used for request/response debug logging.
221
+ #
222
+ # @return [Logger]
223
+ #
224
+ def logger
225
+ @parallelstore_stub.logger
226
+ end
227
+
207
228
  # Service calls
208
229
 
209
230
  ##
210
- # Lists Instances in a given project and location.
231
+ # Lists all instances in a given project and location.
211
232
  #
212
233
  # @overload list_instances(request, options = nil)
213
234
  # Pass arguments to `list_instances` via a request object, either of type
@@ -227,19 +248,18 @@ module Google
227
248
  # @param parent [::String]
228
249
  # Required. The project and location for which to retrieve instance
229
250
  # information, in the format `projects/{project_id}/locations/{location}`.
230
- # For Parallelstore locations map to Google Cloud zones, for example
231
- # **us-central1-a**.
232
- # To retrieve instance information for all locations, use "-" for the
233
- # `{location}` value.
251
+ #
252
+ # To retrieve instance information for all locations, use "-" as the value of
253
+ # `{location}`.
234
254
  # @param page_size [::Integer]
235
255
  # Optional. Requested page size. Server may return fewer items than
236
- # requested. If unspecified, server will pick an appropriate default.
256
+ # requested. If unspecified, the server will pick an appropriate default.
237
257
  # @param page_token [::String]
238
258
  # Optional. A token identifying a page of results the server should return.
239
259
  # @param filter [::String]
240
- # Optional. Filtering results
260
+ # Optional. Filtering results.
241
261
  # @param order_by [::String]
242
- # Optional. Hint for how to order the results
262
+ # Optional. Hint for how to order the results.
243
263
  #
244
264
  # @yield [response, operation] Access the result along with the RPC operation
245
265
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Parallelstore::V1beta::Instance>]
@@ -305,14 +325,14 @@ module Google
305
325
  @parallelstore_stub.call_rpc :list_instances, request, options: options do |response, operation|
306
326
  response = ::Gapic::PagedEnumerable.new @parallelstore_stub, :list_instances, request, response, operation, options
307
327
  yield response, operation if block_given?
308
- return response
328
+ throw :response, response
309
329
  end
310
330
  rescue ::GRPC::BadStatus => e
311
331
  raise ::Google::Cloud::Error.from_error(e)
312
332
  end
313
333
 
314
334
  ##
315
- # Gets details of a single Instance.
335
+ # Gets details of a single instance.
316
336
  #
317
337
  # @overload get_instance(request, options = nil)
318
338
  # Pass arguments to `get_instance` via a request object, either of type
@@ -392,7 +412,6 @@ module Google
392
412
 
393
413
  @parallelstore_stub.call_rpc :get_instance, request, options: options do |response, operation|
394
414
  yield response, operation if block_given?
395
- return response
396
415
  end
397
416
  rescue ::GRPC::BadStatus => e
398
417
  raise ::Google::Cloud::Error.from_error(e)
@@ -419,10 +438,9 @@ module Google
419
438
  # @param parent [::String]
420
439
  # Required. The instance's project and location, in the format
421
440
  # `projects/{project}/locations/{location}`.
422
- # Locations map to Google Cloud zones, for example **us-west1-b**.
441
+ # Locations map to Google Cloud zones; for example, `us-west1-b`.
423
442
  # @param instance_id [::String]
424
- # Required. The logical name of the Parallelstore instance in the user
425
- # project with the following restrictions:
443
+ # Required. The name of the Parallelstore instance.
426
444
  #
427
445
  # * Must contain only lowercase letters, numbers, and hyphens.
428
446
  # * Must start with a letter.
@@ -513,14 +531,14 @@ module Google
513
531
  @parallelstore_stub.call_rpc :create_instance, request, options: options do |response, operation|
514
532
  response = ::Gapic::Operation.new response, @operations_client, options: options
515
533
  yield response, operation if block_given?
516
- return response
534
+ throw :response, response
517
535
  end
518
536
  rescue ::GRPC::BadStatus => e
519
537
  raise ::Google::Cloud::Error.from_error(e)
520
538
  end
521
539
 
522
540
  ##
523
- # Updates the parameters of a single Instance.
541
+ # Updates the parameters of a single instance.
524
542
  #
525
543
  # @overload update_instance(request, options = nil)
526
544
  # Pass arguments to `update_instance` via a request object, either of type
@@ -538,12 +556,12 @@ module Google
538
556
  # the default parameter values, pass an empty Hash as a request object (see above).
539
557
  #
540
558
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
541
- # Required. Mask of fields to update .Field mask is used to specify the
559
+ # Required. Mask of fields to update. Field mask is used to specify the
542
560
  # fields to be overwritten in the Instance resource by the update. At least
543
561
  # one path must be supplied in this field. The fields specified in the
544
562
  # update_mask are relative to the resource, not the full request.
545
563
  # @param instance [::Google::Cloud::Parallelstore::V1beta::Instance, ::Hash]
546
- # Required. The instance to update
564
+ # Required. The instance to update.
547
565
  # @param request_id [::String]
548
566
  # Optional. An optional request ID to identify requests. Specify a unique
549
567
  # request ID so that if you must retry your request, the server will know to
@@ -626,14 +644,14 @@ module Google
626
644
  @parallelstore_stub.call_rpc :update_instance, request, options: options do |response, operation|
627
645
  response = ::Gapic::Operation.new response, @operations_client, options: options
628
646
  yield response, operation if block_given?
629
- return response
647
+ throw :response, response
630
648
  end
631
649
  rescue ::GRPC::BadStatus => e
632
650
  raise ::Google::Cloud::Error.from_error(e)
633
651
  end
634
652
 
635
653
  ##
636
- # Deletes a single Instance.
654
+ # Deletes a single instance.
637
655
  #
638
656
  # @overload delete_instance(request, options = nil)
639
657
  # Pass arguments to `delete_instance` via a request object, either of type
@@ -734,14 +752,14 @@ module Google
734
752
  @parallelstore_stub.call_rpc :delete_instance, request, options: options do |response, operation|
735
753
  response = ::Gapic::Operation.new response, @operations_client, options: options
736
754
  yield response, operation if block_given?
737
- return response
755
+ throw :response, response
738
756
  end
739
757
  rescue ::GRPC::BadStatus => e
740
758
  raise ::Google::Cloud::Error.from_error(e)
741
759
  end
742
760
 
743
761
  ##
744
- # ImportData copies data from Cloud Storage to Parallelstore.
762
+ # Copies data from Cloud Storage to Parallelstore.
745
763
  #
746
764
  # @overload import_data(request, options = nil)
747
765
  # Pass arguments to `import_data` via a request object, either of type
@@ -759,7 +777,7 @@ module Google
759
777
  # the default parameter values, pass an empty Hash as a request object (see above).
760
778
  #
761
779
  # @param source_gcs_bucket [::Google::Cloud::Parallelstore::V1beta::SourceGcsBucket, ::Hash]
762
- # Cloud Storage source.
780
+ # The Cloud Storage source bucket and, optionally, path inside the bucket.
763
781
  # @param destination_parallelstore [::Google::Cloud::Parallelstore::V1beta::DestinationParallelstore, ::Hash]
764
782
  # Parallelstore destination.
765
783
  # @param name [::String]
@@ -779,11 +797,17 @@ module Google
779
797
  # The request ID must be a valid UUID with the exception that zero UUID is
780
798
  # not supported (00000000-0000-0000-0000-000000000000).
781
799
  # @param service_account [::String]
782
- # Optional. User-specified Service Account (SA) credentials to be used when
800
+ # Optional. User-specified service account credentials to be used when
783
801
  # performing the transfer.
784
- # Format: `projects/{project_id}/serviceAccounts/{service_account}`
802
+ #
803
+ # Use one of the following formats:
804
+ #
805
+ # * `{EMAIL_ADDRESS_OR_UNIQUE_ID}`
806
+ # * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
807
+ # * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
808
+ #
785
809
  # If unspecified, the Parallelstore service agent is used:
786
- # service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com)
810
+ # `service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com`
787
811
  #
788
812
  # @yield [response, operation] Access the result along with the RPC operation
789
813
  # @yieldparam response [::Gapic::Operation]
@@ -852,14 +876,14 @@ module Google
852
876
  @parallelstore_stub.call_rpc :import_data, request, options: options do |response, operation|
853
877
  response = ::Gapic::Operation.new response, @operations_client, options: options
854
878
  yield response, operation if block_given?
855
- return response
879
+ throw :response, response
856
880
  end
857
881
  rescue ::GRPC::BadStatus => e
858
882
  raise ::Google::Cloud::Error.from_error(e)
859
883
  end
860
884
 
861
885
  ##
862
- # ExportData copies data from Parallelstore to Cloud Storage
886
+ # Copies data from Parallelstore to Cloud Storage.
863
887
  #
864
888
  # @overload export_data(request, options = nil)
865
889
  # Pass arguments to `export_data` via a request object, either of type
@@ -899,9 +923,14 @@ module Google
899
923
  # @param service_account [::String]
900
924
  # Optional. User-specified Service Account (SA) credentials to be used when
901
925
  # performing the transfer.
902
- # Format: `projects/{project_id}/serviceAccounts/{service_account}`
926
+ # Use one of the following formats:
927
+ #
928
+ # * `{EMAIL_ADDRESS_OR_UNIQUE_ID}`
929
+ # * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
930
+ # * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
931
+ #
903
932
  # If unspecified, the Parallelstore service agent is used:
904
- # service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com)
933
+ # `service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com`
905
934
  #
906
935
  # @yield [response, operation] Access the result along with the RPC operation
907
936
  # @yieldparam response [::Gapic::Operation]
@@ -970,7 +999,7 @@ module Google
970
999
  @parallelstore_stub.call_rpc :export_data, request, options: options do |response, operation|
971
1000
  response = ::Gapic::Operation.new response, @operations_client, options: options
972
1001
  yield response, operation if block_given?
973
- return response
1002
+ throw :response, response
974
1003
  end
975
1004
  rescue ::GRPC::BadStatus => e
976
1005
  raise ::Google::Cloud::Error.from_error(e)
@@ -1059,6 +1088,11 @@ module Google
1059
1088
  # default endpoint URL. The default value of nil uses the environment
1060
1089
  # universe (usually the default "googleapis.com" universe).
1061
1090
  # @return [::String,nil]
1091
+ # @!attribute [rw] logger
1092
+ # A custom logger to use for request/response debug logging, or the value
1093
+ # `:default` (the default) to construct a default logger, or `nil` to
1094
+ # explicitly disable logging.
1095
+ # @return [::Logger,:default,nil]
1062
1096
  #
1063
1097
  class Configuration
1064
1098
  extend ::Gapic::Config
@@ -1083,6 +1117,7 @@ module Google
1083
1117
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1084
1118
  config_attr :quota_project, nil, ::String, nil
1085
1119
  config_attr :universe_domain, nil, ::String, nil
1120
+ config_attr :logger, :default, ::Logger, nil, :default
1086
1121
 
1087
1122
  # @private
1088
1123
  def initialize parent_config = nil
@@ -124,14 +124,6 @@ module Google
124
124
  # Lists operations that match the specified filter in the request. If the
125
125
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
126
126
  #
127
- # NOTE: the `name` binding allows API services to override the binding
128
- # to use different resource name schemes, such as `users/*/operations`. To
129
- # override the binding, API services can add a binding such as
130
- # `"/v1/{name=users/*}/operations"` to their service configuration.
131
- # For backwards compatibility, the default name includes the operations
132
- # collection id, however overriding users must ensure the name binding
133
- # is the parent resource, without the operations collection id.
134
- #
135
127
  # @overload list_operations(request, options = nil)
136
128
  # Pass arguments to `list_operations` via a request object, either of type
137
129
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -221,7 +213,7 @@ module Google
221
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
222
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
223
215
  yield response, operation if block_given?
224
- return response
216
+ throw :response, response
225
217
  end
226
218
  rescue ::GRPC::BadStatus => e
227
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -317,7 +309,7 @@ module Google
317
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
318
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
319
311
  yield response, operation if block_given?
320
- return response
312
+ throw :response, response
321
313
  end
322
314
  rescue ::GRPC::BadStatus => e
323
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -406,7 +398,6 @@ module Google
406
398
 
407
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
408
400
  yield response, operation if block_given?
409
- return response
410
401
  end
411
402
  rescue ::GRPC::BadStatus => e
412
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -421,8 +412,9 @@ module Google
421
412
  # other methods to check whether the cancellation succeeded or whether the
422
413
  # operation completed despite cancellation. On successful cancellation,
423
414
  # the operation is not deleted; instead, it becomes an operation with
424
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
425
- # corresponding to `Code.CANCELLED`.
415
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
416
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
417
+ # `Code.CANCELLED`.
426
418
  #
427
419
  # @overload cancel_operation(request, options = nil)
428
420
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -501,7 +493,6 @@ module Google
501
493
 
502
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
503
495
  yield response, operation if block_given?
504
- return response
505
496
  end
506
497
  rescue ::GRPC::BadStatus => e
507
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -599,7 +590,7 @@ module Google
599
590
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
600
591
  response = ::Gapic::Operation.new response, @operations_client, options: options
601
592
  yield response, operation if block_given?
602
- return response
593
+ throw :response, response
603
594
  end
604
595
  rescue ::GRPC::BadStatus => e
605
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -688,6 +679,11 @@ module Google
688
679
  # default endpoint URL. The default value of nil uses the environment
689
680
  # universe (usually the default "googleapis.com" universe).
690
681
  # @return [::String,nil]
682
+ # @!attribute [rw] logger
683
+ # A custom logger to use for request/response debug logging, or the value
684
+ # `:default` (the default) to construct a default logger, or `nil` to
685
+ # explicitly disable logging.
686
+ # @return [::Logger,:default,nil]
691
687
  #
692
688
  class Configuration
693
689
  extend ::Gapic::Config
@@ -712,6 +708,7 @@ module Google
712
708
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
713
709
  config_attr :quota_project, nil, ::String, nil
714
710
  config_attr :universe_domain, nil, ::String, nil
711
+ config_attr :logger, :default, ::Logger, nil, :default
715
712
 
716
713
  # @private
717
714
  def initialize parent_config = nil