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 +4 -4
- data/README.md +30 -20
- data/lib/google/cloud/parallelstore/v1beta/parallelstore/client.rb +67 -32
- data/lib/google/cloud/parallelstore/v1beta/parallelstore/operations.rb +12 -15
- data/lib/google/cloud/parallelstore/v1beta/parallelstore/rest/client.rb +66 -32
- data/lib/google/cloud/parallelstore/v1beta/parallelstore/rest/operations.rb +43 -39
- data/lib/google/cloud/parallelstore/v1beta/parallelstore/rest/service_stub.rb +70 -44
- data/lib/google/cloud/parallelstore/v1beta/parallelstore_pb.rb +2 -1
- data/lib/google/cloud/parallelstore/v1beta/parallelstore_services_pb.rb +6 -6
- data/lib/google/cloud/parallelstore/v1beta/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/cloud/parallelstore/v1beta/parallelstore.rb +114 -93
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +5 -5
@@ -172,15 +172,27 @@ module Google
|
|
172
172
|
endpoint: @config.endpoint,
|
173
173
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
174
174
|
universe_domain: @config.universe_domain,
|
175
|
-
credentials: credentials
|
175
|
+
credentials: credentials,
|
176
|
+
logger: @config.logger
|
176
177
|
)
|
177
178
|
|
179
|
+
@parallelstore_stub.logger(stub: true)&.info do |entry|
|
180
|
+
entry.set_system_name
|
181
|
+
entry.set_service
|
182
|
+
entry.message = "Created client for #{entry.service}"
|
183
|
+
entry.set_credentials_fields credentials
|
184
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
185
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
186
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
187
|
+
end
|
188
|
+
|
178
189
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
179
190
|
config.credentials = credentials
|
180
191
|
config.quota_project = @quota_project_id
|
181
192
|
config.endpoint = @parallelstore_stub.endpoint
|
182
193
|
config.universe_domain = @parallelstore_stub.universe_domain
|
183
194
|
config.bindings_override = @config.bindings_override
|
195
|
+
config.logger = @parallelstore_stub.logger if config.respond_to? :logger=
|
184
196
|
end
|
185
197
|
end
|
186
198
|
|
@@ -198,10 +210,19 @@ module Google
|
|
198
210
|
#
|
199
211
|
attr_reader :location_client
|
200
212
|
|
213
|
+
##
|
214
|
+
# The logger used for request/response debug logging.
|
215
|
+
#
|
216
|
+
# @return [Logger]
|
217
|
+
#
|
218
|
+
def logger
|
219
|
+
@parallelstore_stub.logger
|
220
|
+
end
|
221
|
+
|
201
222
|
# Service calls
|
202
223
|
|
203
224
|
##
|
204
|
-
# Lists
|
225
|
+
# Lists all instances in a given project and location.
|
205
226
|
#
|
206
227
|
# @overload list_instances(request, options = nil)
|
207
228
|
# Pass arguments to `list_instances` via a request object, either of type
|
@@ -221,19 +242,18 @@ module Google
|
|
221
242
|
# @param parent [::String]
|
222
243
|
# Required. The project and location for which to retrieve instance
|
223
244
|
# information, in the format `projects/{project_id}/locations/{location}`.
|
224
|
-
#
|
225
|
-
#
|
226
|
-
#
|
227
|
-
# `{location}` value.
|
245
|
+
#
|
246
|
+
# To retrieve instance information for all locations, use "-" as the value of
|
247
|
+
# `{location}`.
|
228
248
|
# @param page_size [::Integer]
|
229
249
|
# Optional. Requested page size. Server may return fewer items than
|
230
|
-
# requested. If unspecified, server will pick an appropriate default.
|
250
|
+
# requested. If unspecified, the server will pick an appropriate default.
|
231
251
|
# @param page_token [::String]
|
232
252
|
# Optional. A token identifying a page of results the server should return.
|
233
253
|
# @param filter [::String]
|
234
|
-
# Optional. Filtering results
|
254
|
+
# Optional. Filtering results.
|
235
255
|
# @param order_by [::String]
|
236
|
-
# Optional. Hint for how to order the results
|
256
|
+
# Optional. Hint for how to order the results.
|
237
257
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
238
258
|
# @yieldparam result [::Google::Cloud::Parallelstore::V1beta::ListInstancesResponse]
|
239
259
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -291,14 +311,13 @@ module Google
|
|
291
311
|
|
292
312
|
@parallelstore_stub.list_instances request, options do |result, operation|
|
293
313
|
yield result, operation if block_given?
|
294
|
-
return result
|
295
314
|
end
|
296
315
|
rescue ::Gapic::Rest::Error => e
|
297
316
|
raise ::Google::Cloud::Error.from_error(e)
|
298
317
|
end
|
299
318
|
|
300
319
|
##
|
301
|
-
# Gets details of a single
|
320
|
+
# Gets details of a single instance.
|
302
321
|
#
|
303
322
|
# @overload get_instance(request, options = nil)
|
304
323
|
# Pass arguments to `get_instance` via a request object, either of type
|
@@ -371,7 +390,6 @@ module Google
|
|
371
390
|
|
372
391
|
@parallelstore_stub.get_instance request, options do |result, operation|
|
373
392
|
yield result, operation if block_given?
|
374
|
-
return result
|
375
393
|
end
|
376
394
|
rescue ::Gapic::Rest::Error => e
|
377
395
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -398,10 +416,9 @@ module Google
|
|
398
416
|
# @param parent [::String]
|
399
417
|
# Required. The instance's project and location, in the format
|
400
418
|
# `projects/{project}/locations/{location}`.
|
401
|
-
# Locations map to Google Cloud zones
|
419
|
+
# Locations map to Google Cloud zones; for example, `us-west1-b`.
|
402
420
|
# @param instance_id [::String]
|
403
|
-
# Required. The
|
404
|
-
# project with the following restrictions:
|
421
|
+
# Required. The name of the Parallelstore instance.
|
405
422
|
#
|
406
423
|
# * Must contain only lowercase letters, numbers, and hyphens.
|
407
424
|
# * Must start with a letter.
|
@@ -485,14 +502,14 @@ module Google
|
|
485
502
|
@parallelstore_stub.create_instance request, options do |result, operation|
|
486
503
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
487
504
|
yield result, operation if block_given?
|
488
|
-
|
505
|
+
throw :response, result
|
489
506
|
end
|
490
507
|
rescue ::Gapic::Rest::Error => e
|
491
508
|
raise ::Google::Cloud::Error.from_error(e)
|
492
509
|
end
|
493
510
|
|
494
511
|
##
|
495
|
-
# Updates the parameters of a single
|
512
|
+
# Updates the parameters of a single instance.
|
496
513
|
#
|
497
514
|
# @overload update_instance(request, options = nil)
|
498
515
|
# Pass arguments to `update_instance` via a request object, either of type
|
@@ -510,12 +527,12 @@ module Google
|
|
510
527
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
511
528
|
#
|
512
529
|
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
513
|
-
# Required. Mask of fields to update
|
530
|
+
# Required. Mask of fields to update. Field mask is used to specify the
|
514
531
|
# fields to be overwritten in the Instance resource by the update. At least
|
515
532
|
# one path must be supplied in this field. The fields specified in the
|
516
533
|
# update_mask are relative to the resource, not the full request.
|
517
534
|
# @param instance [::Google::Cloud::Parallelstore::V1beta::Instance, ::Hash]
|
518
|
-
# Required. The instance to update
|
535
|
+
# Required. The instance to update.
|
519
536
|
# @param request_id [::String]
|
520
537
|
# Optional. An optional request ID to identify requests. Specify a unique
|
521
538
|
# request ID so that if you must retry your request, the server will know to
|
@@ -591,14 +608,14 @@ module Google
|
|
591
608
|
@parallelstore_stub.update_instance request, options do |result, operation|
|
592
609
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
593
610
|
yield result, operation if block_given?
|
594
|
-
|
611
|
+
throw :response, result
|
595
612
|
end
|
596
613
|
rescue ::Gapic::Rest::Error => e
|
597
614
|
raise ::Google::Cloud::Error.from_error(e)
|
598
615
|
end
|
599
616
|
|
600
617
|
##
|
601
|
-
# Deletes a single
|
618
|
+
# Deletes a single instance.
|
602
619
|
#
|
603
620
|
# @overload delete_instance(request, options = nil)
|
604
621
|
# Pass arguments to `delete_instance` via a request object, either of type
|
@@ -692,14 +709,14 @@ module Google
|
|
692
709
|
@parallelstore_stub.delete_instance request, options do |result, operation|
|
693
710
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
694
711
|
yield result, operation if block_given?
|
695
|
-
|
712
|
+
throw :response, result
|
696
713
|
end
|
697
714
|
rescue ::Gapic::Rest::Error => e
|
698
715
|
raise ::Google::Cloud::Error.from_error(e)
|
699
716
|
end
|
700
717
|
|
701
718
|
##
|
702
|
-
#
|
719
|
+
# Copies data from Cloud Storage to Parallelstore.
|
703
720
|
#
|
704
721
|
# @overload import_data(request, options = nil)
|
705
722
|
# Pass arguments to `import_data` via a request object, either of type
|
@@ -717,7 +734,7 @@ module Google
|
|
717
734
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
718
735
|
#
|
719
736
|
# @param source_gcs_bucket [::Google::Cloud::Parallelstore::V1beta::SourceGcsBucket, ::Hash]
|
720
|
-
# Cloud Storage source.
|
737
|
+
# The Cloud Storage source bucket and, optionally, path inside the bucket.
|
721
738
|
# @param destination_parallelstore [::Google::Cloud::Parallelstore::V1beta::DestinationParallelstore, ::Hash]
|
722
739
|
# Parallelstore destination.
|
723
740
|
# @param name [::String]
|
@@ -737,11 +754,17 @@ module Google
|
|
737
754
|
# The request ID must be a valid UUID with the exception that zero UUID is
|
738
755
|
# not supported (00000000-0000-0000-0000-000000000000).
|
739
756
|
# @param service_account [::String]
|
740
|
-
# Optional. User-specified
|
757
|
+
# Optional. User-specified service account credentials to be used when
|
741
758
|
# performing the transfer.
|
742
|
-
#
|
759
|
+
#
|
760
|
+
# Use one of the following formats:
|
761
|
+
#
|
762
|
+
# * `{EMAIL_ADDRESS_OR_UNIQUE_ID}`
|
763
|
+
# * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
|
764
|
+
# * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
|
765
|
+
#
|
743
766
|
# If unspecified, the Parallelstore service agent is used:
|
744
|
-
# service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com
|
767
|
+
# `service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com`
|
745
768
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
746
769
|
# @yieldparam result [::Gapic::Operation]
|
747
770
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -803,14 +826,14 @@ module Google
|
|
803
826
|
@parallelstore_stub.import_data request, options do |result, operation|
|
804
827
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
805
828
|
yield result, operation if block_given?
|
806
|
-
|
829
|
+
throw :response, result
|
807
830
|
end
|
808
831
|
rescue ::Gapic::Rest::Error => e
|
809
832
|
raise ::Google::Cloud::Error.from_error(e)
|
810
833
|
end
|
811
834
|
|
812
835
|
##
|
813
|
-
#
|
836
|
+
# Copies data from Parallelstore to Cloud Storage.
|
814
837
|
#
|
815
838
|
# @overload export_data(request, options = nil)
|
816
839
|
# Pass arguments to `export_data` via a request object, either of type
|
@@ -850,9 +873,14 @@ module Google
|
|
850
873
|
# @param service_account [::String]
|
851
874
|
# Optional. User-specified Service Account (SA) credentials to be used when
|
852
875
|
# performing the transfer.
|
853
|
-
#
|
876
|
+
# Use one of the following formats:
|
877
|
+
#
|
878
|
+
# * `{EMAIL_ADDRESS_OR_UNIQUE_ID}`
|
879
|
+
# * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
|
880
|
+
# * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
|
881
|
+
#
|
854
882
|
# If unspecified, the Parallelstore service agent is used:
|
855
|
-
# service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com
|
883
|
+
# `service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com`
|
856
884
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
857
885
|
# @yieldparam result [::Gapic::Operation]
|
858
886
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -914,7 +942,7 @@ module Google
|
|
914
942
|
@parallelstore_stub.export_data request, options do |result, operation|
|
915
943
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
916
944
|
yield result, operation if block_given?
|
917
|
-
|
945
|
+
throw :response, result
|
918
946
|
end
|
919
947
|
rescue ::Gapic::Rest::Error => e
|
920
948
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -994,6 +1022,11 @@ module Google
|
|
994
1022
|
# default endpoint URL. The default value of nil uses the environment
|
995
1023
|
# universe (usually the default "googleapis.com" universe).
|
996
1024
|
# @return [::String,nil]
|
1025
|
+
# @!attribute [rw] logger
|
1026
|
+
# A custom logger to use for request/response debug logging, or the value
|
1027
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1028
|
+
# explicitly disable logging.
|
1029
|
+
# @return [::Logger,:default,nil]
|
997
1030
|
#
|
998
1031
|
class Configuration
|
999
1032
|
extend ::Gapic::Config
|
@@ -1022,6 +1055,7 @@ module Google
|
|
1022
1055
|
# by the host service.
|
1023
1056
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
1024
1057
|
config_attr :bindings_override, {}, ::Hash, nil
|
1058
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1025
1059
|
|
1026
1060
|
# @private
|
1027
1061
|
def initialize parent_config = nil
|
@@ -115,14 +115,6 @@ module Google
|
|
115
115
|
# Lists operations that match the specified filter in the request. If the
|
116
116
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
117
117
|
#
|
118
|
-
# NOTE: the `name` binding allows API services to override the binding
|
119
|
-
# to use different resource name schemes, such as `users/*/operations`. To
|
120
|
-
# override the binding, API services can add a binding such as
|
121
|
-
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
122
|
-
# For backwards compatibility, the default name includes the operations
|
123
|
-
# collection id, however overriding users must ensure the name binding
|
124
|
-
# is the parent resource, without the operations collection id.
|
125
|
-
#
|
126
118
|
# @overload list_operations(request, options = nil)
|
127
119
|
# Pass arguments to `list_operations` via a request object, either of type
|
128
120
|
# {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
|
@@ -204,7 +196,7 @@ module Google
|
|
204
196
|
@operations_stub.list_operations request, options do |result, operation|
|
205
197
|
result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
|
206
198
|
yield result, operation if block_given?
|
207
|
-
|
199
|
+
throw :response, result
|
208
200
|
end
|
209
201
|
rescue ::Gapic::Rest::Error => e
|
210
202
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -293,7 +285,7 @@ module Google
|
|
293
285
|
@operations_stub.get_operation request, options do |result, operation|
|
294
286
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
295
287
|
yield result, operation if block_given?
|
296
|
-
|
288
|
+
throw :response, result
|
297
289
|
end
|
298
290
|
rescue ::Gapic::Rest::Error => e
|
299
291
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -375,7 +367,6 @@ module Google
|
|
375
367
|
|
376
368
|
@operations_stub.delete_operation request, options do |result, operation|
|
377
369
|
yield result, operation if block_given?
|
378
|
-
return result
|
379
370
|
end
|
380
371
|
rescue ::Gapic::Rest::Error => e
|
381
372
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -390,8 +381,9 @@ module Google
|
|
390
381
|
# other methods to check whether the cancellation succeeded or whether the
|
391
382
|
# operation completed despite cancellation. On successful cancellation,
|
392
383
|
# the operation is not deleted; instead, it becomes an operation with
|
393
|
-
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
394
|
-
# corresponding to
|
384
|
+
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
385
|
+
# {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
|
386
|
+
# `Code.CANCELLED`.
|
395
387
|
#
|
396
388
|
# @overload cancel_operation(request, options = nil)
|
397
389
|
# Pass arguments to `cancel_operation` via a request object, either of type
|
@@ -463,7 +455,6 @@ module Google
|
|
463
455
|
|
464
456
|
@operations_stub.cancel_operation request, options do |result, operation|
|
465
457
|
yield result, operation if block_given?
|
466
|
-
return result
|
467
458
|
end
|
468
459
|
rescue ::Gapic::Rest::Error => e
|
469
460
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -543,6 +534,11 @@ module Google
|
|
543
534
|
# default endpoint URL. The default value of nil uses the environment
|
544
535
|
# universe (usually the default "googleapis.com" universe).
|
545
536
|
# @return [::String,nil]
|
537
|
+
# @!attribute [rw] logger
|
538
|
+
# A custom logger to use for request/response debug logging, or the value
|
539
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
540
|
+
# explicitly disable logging.
|
541
|
+
# @return [::Logger,:default,nil]
|
546
542
|
#
|
547
543
|
class Configuration
|
548
544
|
extend ::Gapic::Config
|
@@ -564,6 +560,7 @@ module Google
|
|
564
560
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
565
561
|
config_attr :quota_project, nil, ::String, nil
|
566
562
|
config_attr :universe_domain, nil, ::String, nil
|
563
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
567
564
|
|
568
565
|
# @private
|
569
566
|
def initialize parent_config = nil
|
@@ -683,16 +680,18 @@ module Google
|
|
683
680
|
|
684
681
|
response = @client_stub.make_http_request(
|
685
682
|
verb,
|
686
|
-
uri:
|
687
|
-
body:
|
688
|
-
params:
|
683
|
+
uri: uri,
|
684
|
+
body: body || "",
|
685
|
+
params: query_string_params,
|
686
|
+
method_name: "list_operations",
|
689
687
|
options: options
|
690
688
|
)
|
691
689
|
operation = ::Gapic::Rest::TransportOperation.new response
|
692
690
|
result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
|
693
|
-
|
694
|
-
|
695
|
-
|
691
|
+
catch :response do
|
692
|
+
yield result, operation if block_given?
|
693
|
+
result
|
694
|
+
end
|
696
695
|
end
|
697
696
|
|
698
697
|
##
|
@@ -721,16 +720,18 @@ module Google
|
|
721
720
|
|
722
721
|
response = @client_stub.make_http_request(
|
723
722
|
verb,
|
724
|
-
uri:
|
725
|
-
body:
|
726
|
-
params:
|
723
|
+
uri: uri,
|
724
|
+
body: body || "",
|
725
|
+
params: query_string_params,
|
726
|
+
method_name: "get_operation",
|
727
727
|
options: options
|
728
728
|
)
|
729
729
|
operation = ::Gapic::Rest::TransportOperation.new response
|
730
730
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
731
|
-
|
732
|
-
|
733
|
-
|
731
|
+
catch :response do
|
732
|
+
yield result, operation if block_given?
|
733
|
+
result
|
734
|
+
end
|
734
735
|
end
|
735
736
|
|
736
737
|
##
|
@@ -759,16 +760,18 @@ module Google
|
|
759
760
|
|
760
761
|
response = @client_stub.make_http_request(
|
761
762
|
verb,
|
762
|
-
uri:
|
763
|
-
body:
|
764
|
-
params:
|
763
|
+
uri: uri,
|
764
|
+
body: body || "",
|
765
|
+
params: query_string_params,
|
766
|
+
method_name: "delete_operation",
|
765
767
|
options: options
|
766
768
|
)
|
767
769
|
operation = ::Gapic::Rest::TransportOperation.new response
|
768
770
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
769
|
-
|
770
|
-
|
771
|
-
|
771
|
+
catch :response do
|
772
|
+
yield result, operation if block_given?
|
773
|
+
result
|
774
|
+
end
|
772
775
|
end
|
773
776
|
|
774
777
|
##
|
@@ -797,16 +800,18 @@ module Google
|
|
797
800
|
|
798
801
|
response = @client_stub.make_http_request(
|
799
802
|
verb,
|
800
|
-
uri:
|
801
|
-
body:
|
802
|
-
params:
|
803
|
+
uri: uri,
|
804
|
+
body: body || "",
|
805
|
+
params: query_string_params,
|
806
|
+
method_name: "cancel_operation",
|
803
807
|
options: options
|
804
808
|
)
|
805
809
|
operation = ::Gapic::Rest::TransportOperation.new response
|
806
810
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
807
|
-
|
808
|
-
|
809
|
-
|
811
|
+
catch :response do
|
812
|
+
yield result, operation if block_given?
|
813
|
+
result
|
814
|
+
end
|
810
815
|
end
|
811
816
|
|
812
817
|
##
|
@@ -886,7 +891,6 @@ module Google
|
|
886
891
|
.with_bindings(
|
887
892
|
uri_method: :post,
|
888
893
|
uri_template: "/v1beta/{name}:cancel",
|
889
|
-
body: "*",
|
890
894
|
matches: [
|
891
895
|
["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
|
892
896
|
]
|
@@ -30,7 +30,8 @@ module Google
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
31
31
|
#
|
32
32
|
class ServiceStub
|
33
|
-
|
33
|
+
# @private
|
34
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
|
34
35
|
# These require statements are intentionally placed here to initialize
|
35
36
|
# the REST modules only when it's required.
|
36
37
|
require "gapic/rest"
|
@@ -40,7 +41,9 @@ module Google
|
|
40
41
|
universe_domain: universe_domain,
|
41
42
|
credentials: credentials,
|
42
43
|
numeric_enums: true,
|
43
|
-
|
44
|
+
service_name: self.class,
|
45
|
+
raise_faraday_errors: false,
|
46
|
+
logger: logger
|
44
47
|
end
|
45
48
|
|
46
49
|
##
|
@@ -61,6 +64,15 @@ module Google
|
|
61
64
|
@client_stub.endpoint
|
62
65
|
end
|
63
66
|
|
67
|
+
##
|
68
|
+
# The logger used for request/response debug logging.
|
69
|
+
#
|
70
|
+
# @return [Logger]
|
71
|
+
#
|
72
|
+
def logger stub: false
|
73
|
+
stub ? @client_stub.stub_logger : @client_stub.logger
|
74
|
+
end
|
75
|
+
|
64
76
|
##
|
65
77
|
# Baseline implementation for the list_instances REST call
|
66
78
|
#
|
@@ -87,16 +99,18 @@ module Google
|
|
87
99
|
|
88
100
|
response = @client_stub.make_http_request(
|
89
101
|
verb,
|
90
|
-
uri:
|
91
|
-
body:
|
92
|
-
params:
|
102
|
+
uri: uri,
|
103
|
+
body: body || "",
|
104
|
+
params: query_string_params,
|
105
|
+
method_name: "list_instances",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::Parallelstore::V1beta::ListInstancesResponse.decode_json response.body, ignore_unknown_fields: true
|
97
|
-
|
98
|
-
|
99
|
-
|
110
|
+
catch :response do
|
111
|
+
yield result, operation if block_given?
|
112
|
+
result
|
113
|
+
end
|
100
114
|
end
|
101
115
|
|
102
116
|
##
|
@@ -125,16 +139,18 @@ module Google
|
|
125
139
|
|
126
140
|
response = @client_stub.make_http_request(
|
127
141
|
verb,
|
128
|
-
uri:
|
129
|
-
body:
|
130
|
-
params:
|
142
|
+
uri: uri,
|
143
|
+
body: body || "",
|
144
|
+
params: query_string_params,
|
145
|
+
method_name: "get_instance",
|
131
146
|
options: options
|
132
147
|
)
|
133
148
|
operation = ::Gapic::Rest::TransportOperation.new response
|
134
149
|
result = ::Google::Cloud::Parallelstore::V1beta::Instance.decode_json response.body, ignore_unknown_fields: true
|
135
|
-
|
136
|
-
|
137
|
-
|
150
|
+
catch :response do
|
151
|
+
yield result, operation if block_given?
|
152
|
+
result
|
153
|
+
end
|
138
154
|
end
|
139
155
|
|
140
156
|
##
|
@@ -163,16 +179,18 @@ module Google
|
|
163
179
|
|
164
180
|
response = @client_stub.make_http_request(
|
165
181
|
verb,
|
166
|
-
uri:
|
167
|
-
body:
|
168
|
-
params:
|
182
|
+
uri: uri,
|
183
|
+
body: body || "",
|
184
|
+
params: query_string_params,
|
185
|
+
method_name: "create_instance",
|
169
186
|
options: options
|
170
187
|
)
|
171
188
|
operation = ::Gapic::Rest::TransportOperation.new response
|
172
189
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
173
|
-
|
174
|
-
|
175
|
-
|
190
|
+
catch :response do
|
191
|
+
yield result, operation if block_given?
|
192
|
+
result
|
193
|
+
end
|
176
194
|
end
|
177
195
|
|
178
196
|
##
|
@@ -201,16 +219,18 @@ module Google
|
|
201
219
|
|
202
220
|
response = @client_stub.make_http_request(
|
203
221
|
verb,
|
204
|
-
uri:
|
205
|
-
body:
|
206
|
-
params:
|
222
|
+
uri: uri,
|
223
|
+
body: body || "",
|
224
|
+
params: query_string_params,
|
225
|
+
method_name: "update_instance",
|
207
226
|
options: options
|
208
227
|
)
|
209
228
|
operation = ::Gapic::Rest::TransportOperation.new response
|
210
229
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
211
|
-
|
212
|
-
|
213
|
-
|
230
|
+
catch :response do
|
231
|
+
yield result, operation if block_given?
|
232
|
+
result
|
233
|
+
end
|
214
234
|
end
|
215
235
|
|
216
236
|
##
|
@@ -239,16 +259,18 @@ module Google
|
|
239
259
|
|
240
260
|
response = @client_stub.make_http_request(
|
241
261
|
verb,
|
242
|
-
uri:
|
243
|
-
body:
|
244
|
-
params:
|
262
|
+
uri: uri,
|
263
|
+
body: body || "",
|
264
|
+
params: query_string_params,
|
265
|
+
method_name: "delete_instance",
|
245
266
|
options: options
|
246
267
|
)
|
247
268
|
operation = ::Gapic::Rest::TransportOperation.new response
|
248
269
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
249
|
-
|
250
|
-
|
251
|
-
|
270
|
+
catch :response do
|
271
|
+
yield result, operation if block_given?
|
272
|
+
result
|
273
|
+
end
|
252
274
|
end
|
253
275
|
|
254
276
|
##
|
@@ -277,16 +299,18 @@ module Google
|
|
277
299
|
|
278
300
|
response = @client_stub.make_http_request(
|
279
301
|
verb,
|
280
|
-
uri:
|
281
|
-
body:
|
282
|
-
params:
|
302
|
+
uri: uri,
|
303
|
+
body: body || "",
|
304
|
+
params: query_string_params,
|
305
|
+
method_name: "import_data",
|
283
306
|
options: options
|
284
307
|
)
|
285
308
|
operation = ::Gapic::Rest::TransportOperation.new response
|
286
309
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
287
|
-
|
288
|
-
|
289
|
-
|
310
|
+
catch :response do
|
311
|
+
yield result, operation if block_given?
|
312
|
+
result
|
313
|
+
end
|
290
314
|
end
|
291
315
|
|
292
316
|
##
|
@@ -315,16 +339,18 @@ module Google
|
|
315
339
|
|
316
340
|
response = @client_stub.make_http_request(
|
317
341
|
verb,
|
318
|
-
uri:
|
319
|
-
body:
|
320
|
-
params:
|
342
|
+
uri: uri,
|
343
|
+
body: body || "",
|
344
|
+
params: query_string_params,
|
345
|
+
method_name: "export_data",
|
321
346
|
options: options
|
322
347
|
)
|
323
348
|
operation = ::Gapic::Rest::TransportOperation.new response
|
324
349
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
325
|
-
|
326
|
-
|
327
|
-
|
350
|
+
catch :response do
|
351
|
+
yield result, operation if block_given?
|
352
|
+
result
|
353
|
+
end
|
328
354
|
end
|
329
355
|
|
330
356
|
##
|