google-cloud-batch-v1 0.19.1 → 0.20.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/batch/v1/batch_service/client.rb +31 -7
- data/lib/google/cloud/batch/v1/batch_service/operations.rb +12 -15
- data/lib/google/cloud/batch/v1/batch_service/rest/client.rb +29 -7
- data/lib/google/cloud/batch/v1/batch_service/rest/operations.rb +43 -38
- data/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb +62 -38
- data/lib/google/cloud/batch/v1/version.rb +1 -1
- data/lib/google/iam/v1/iam_policy/client.rb +28 -5
- data/lib/google/iam/v1/iam_policy/rest/client.rb +28 -5
- data/lib/google/iam/v1/iam_policy/rest/service_stub.rb +38 -20
- data/lib/google/iam/v1/iam_policy/rest.rb +0 -1
- data/lib/google/iam/v1/iam_policy.rb +0 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/cloud/batch/v1/job.rb +49 -32
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3295ffb42bc81bdcc492bc4b55a8078aa5c9dffaec542b41ab963dd964eea42c
|
4
|
+
data.tar.gz: e47e5c9047f237a4ae5ca26ee7ff234d43912f31fe73b95901d0e7ff8f4e53f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d42a80210f285f76587c68d223406797b8e055a9325ae2cceddb25a3fd9d8cd7f171fb6340ea6bec5f13c7c9ff9acc001bd4703c2015345df97d2b36a1320c7b
|
7
|
+
data.tar.gz: af380b3b61345011d4e5ad2182a0769800b7a52198446bc451aa486ca600e900244bcbb071f11eca8cfbd5cce85850ce9e1dd1ac6a9e5d2c5a1b8b2ca871e3bb
|
data/README.md
CHANGED
@@ -40,33 +40,43 @@ response = client.create_job request
|
|
40
40
|
View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest)
|
41
41
|
for class and method documentation.
|
42
42
|
|
43
|
-
##
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
43
|
+
## Debug Logging
|
44
|
+
|
45
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
46
|
+
your application's integration with the API. When logging is activated, key
|
47
|
+
events such as requests and responses, along with data payloads and metadata
|
48
|
+
such as headers and client configuration, are logged to the standard error
|
49
|
+
stream.
|
50
|
+
|
51
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
52
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
53
|
+
customers, private keys, or other security data that could be compromising if
|
54
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
55
|
+
the principle of least access. Google also recommends that Client Library Debug
|
56
|
+
Logging be enabled only temporarily during active debugging, and not used
|
57
|
+
permanently in production.
|
58
|
+
|
59
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
60
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
61
|
+
list of client library gem names. This will select the default logging behavior,
|
62
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
63
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
64
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
65
|
+
results in logs appearing alongside your application logs in the
|
66
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
67
|
+
|
68
|
+
You can customize logging by modifying the `logger` configuration when
|
69
|
+
constructing a client object. For example:
|
52
70
|
|
53
71
|
```ruby
|
72
|
+
require "google/cloud/batch/v1"
|
54
73
|
require "logger"
|
55
74
|
|
56
|
-
|
57
|
-
|
58
|
-
def logger
|
59
|
-
LOGGER
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
64
|
-
module GRPC
|
65
|
-
extend MyLogger
|
75
|
+
client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config|
|
76
|
+
config.logger = Logger.new "my-app.log"
|
66
77
|
end
|
67
78
|
```
|
68
79
|
|
69
|
-
|
70
80
|
## Google Cloud Samples
|
71
81
|
|
72
82
|
To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
|
@@ -191,14 +191,26 @@ module Google
|
|
191
191
|
universe_domain: @config.universe_domain,
|
192
192
|
channel_args: @config.channel_args,
|
193
193
|
interceptors: @config.interceptors,
|
194
|
-
channel_pool_config: @config.channel_pool
|
194
|
+
channel_pool_config: @config.channel_pool,
|
195
|
+
logger: @config.logger
|
195
196
|
)
|
196
197
|
|
198
|
+
@batch_service_stub.stub_logger&.info do |entry|
|
199
|
+
entry.set_system_name
|
200
|
+
entry.set_service
|
201
|
+
entry.message = "Created client for #{entry.service}"
|
202
|
+
entry.set_credentials_fields credentials
|
203
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
204
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
205
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
206
|
+
end
|
207
|
+
|
197
208
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
198
209
|
config.credentials = credentials
|
199
210
|
config.quota_project = @quota_project_id
|
200
211
|
config.endpoint = @batch_service_stub.endpoint
|
201
212
|
config.universe_domain = @batch_service_stub.universe_domain
|
213
|
+
config.logger = @batch_service_stub.logger if config.respond_to? :logger=
|
202
214
|
end
|
203
215
|
end
|
204
216
|
|
@@ -216,6 +228,15 @@ module Google
|
|
216
228
|
#
|
217
229
|
attr_reader :location_client
|
218
230
|
|
231
|
+
##
|
232
|
+
# The logger used for request/response debug logging.
|
233
|
+
#
|
234
|
+
# @return [Logger]
|
235
|
+
#
|
236
|
+
def logger
|
237
|
+
@batch_service_stub.logger
|
238
|
+
end
|
239
|
+
|
219
240
|
# Service calls
|
220
241
|
|
221
242
|
##
|
@@ -325,7 +346,6 @@ module Google
|
|
325
346
|
|
326
347
|
@batch_service_stub.call_rpc :create_job, request, options: options do |response, operation|
|
327
348
|
yield response, operation if block_given?
|
328
|
-
return response
|
329
349
|
end
|
330
350
|
rescue ::GRPC::BadStatus => e
|
331
351
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -411,7 +431,6 @@ module Google
|
|
411
431
|
|
412
432
|
@batch_service_stub.call_rpc :get_job, request, options: options do |response, operation|
|
413
433
|
yield response, operation if block_given?
|
414
|
-
return response
|
415
434
|
end
|
416
435
|
rescue ::GRPC::BadStatus => e
|
417
436
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -521,7 +540,7 @@ module Google
|
|
521
540
|
@batch_service_stub.call_rpc :delete_job, request, options: options do |response, operation|
|
522
541
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
523
542
|
yield response, operation if block_given?
|
524
|
-
|
543
|
+
throw :response, response
|
525
544
|
end
|
526
545
|
rescue ::GRPC::BadStatus => e
|
527
546
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -621,7 +640,7 @@ module Google
|
|
621
640
|
@batch_service_stub.call_rpc :list_jobs, request, options: options do |response, operation|
|
622
641
|
response = ::Gapic::PagedEnumerable.new @batch_service_stub, :list_jobs, request, response, operation, options
|
623
642
|
yield response, operation if block_given?
|
624
|
-
|
643
|
+
throw :response, response
|
625
644
|
end
|
626
645
|
rescue ::GRPC::BadStatus => e
|
627
646
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -707,7 +726,6 @@ module Google
|
|
707
726
|
|
708
727
|
@batch_service_stub.call_rpc :get_task, request, options: options do |response, operation|
|
709
728
|
yield response, operation if block_given?
|
710
|
-
return response
|
711
729
|
end
|
712
730
|
rescue ::GRPC::BadStatus => e
|
713
731
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -808,7 +826,7 @@ module Google
|
|
808
826
|
@batch_service_stub.call_rpc :list_tasks, request, options: options do |response, operation|
|
809
827
|
response = ::Gapic::PagedEnumerable.new @batch_service_stub, :list_tasks, request, response, operation, options
|
810
828
|
yield response, operation if block_given?
|
811
|
-
|
829
|
+
throw :response, response
|
812
830
|
end
|
813
831
|
rescue ::GRPC::BadStatus => e
|
814
832
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -897,6 +915,11 @@ module Google
|
|
897
915
|
# default endpoint URL. The default value of nil uses the environment
|
898
916
|
# universe (usually the default "googleapis.com" universe).
|
899
917
|
# @return [::String,nil]
|
918
|
+
# @!attribute [rw] logger
|
919
|
+
# A custom logger to use for request/response debug logging, or the value
|
920
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
921
|
+
# explicitly disable logging.
|
922
|
+
# @return [::Logger,:default,nil]
|
900
923
|
#
|
901
924
|
class Configuration
|
902
925
|
extend ::Gapic::Config
|
@@ -921,6 +944,7 @@ module Google
|
|
921
944
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
922
945
|
config_attr :quota_project, nil, ::String, nil
|
923
946
|
config_attr :universe_domain, nil, ::String, nil
|
947
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
924
948
|
|
925
949
|
# @private
|
926
950
|
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
|
-
|
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
|
-
|
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
|
425
|
-
# corresponding to
|
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
|
-
|
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
|
@@ -184,15 +184,27 @@ module Google
|
|
184
184
|
endpoint: @config.endpoint,
|
185
185
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
186
186
|
universe_domain: @config.universe_domain,
|
187
|
-
credentials: credentials
|
187
|
+
credentials: credentials,
|
188
|
+
logger: @config.logger
|
188
189
|
)
|
189
190
|
|
191
|
+
@batch_service_stub.logger(stub: true)&.info do |entry|
|
192
|
+
entry.set_system_name
|
193
|
+
entry.set_service
|
194
|
+
entry.message = "Created client for #{entry.service}"
|
195
|
+
entry.set_credentials_fields credentials
|
196
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
197
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
198
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
199
|
+
end
|
200
|
+
|
190
201
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
191
202
|
config.credentials = credentials
|
192
203
|
config.quota_project = @quota_project_id
|
193
204
|
config.endpoint = @batch_service_stub.endpoint
|
194
205
|
config.universe_domain = @batch_service_stub.universe_domain
|
195
206
|
config.bindings_override = @config.bindings_override
|
207
|
+
config.logger = @batch_service_stub.logger if config.respond_to? :logger=
|
196
208
|
end
|
197
209
|
end
|
198
210
|
|
@@ -210,6 +222,15 @@ module Google
|
|
210
222
|
#
|
211
223
|
attr_reader :location_client
|
212
224
|
|
225
|
+
##
|
226
|
+
# The logger used for request/response debug logging.
|
227
|
+
#
|
228
|
+
# @return [Logger]
|
229
|
+
#
|
230
|
+
def logger
|
231
|
+
@batch_service_stub.logger
|
232
|
+
end
|
233
|
+
|
213
234
|
# Service calls
|
214
235
|
|
215
236
|
##
|
@@ -312,7 +333,6 @@ module Google
|
|
312
333
|
|
313
334
|
@batch_service_stub.create_job request, options do |result, operation|
|
314
335
|
yield result, operation if block_given?
|
315
|
-
return result
|
316
336
|
end
|
317
337
|
rescue ::Gapic::Rest::Error => e
|
318
338
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -391,7 +411,6 @@ module Google
|
|
391
411
|
|
392
412
|
@batch_service_stub.get_job request, options do |result, operation|
|
393
413
|
yield result, operation if block_given?
|
394
|
-
return result
|
395
414
|
end
|
396
415
|
rescue ::Gapic::Rest::Error => e
|
397
416
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -494,7 +513,7 @@ module Google
|
|
494
513
|
@batch_service_stub.delete_job request, options do |result, operation|
|
495
514
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
496
515
|
yield result, operation if block_given?
|
497
|
-
|
516
|
+
throw :response, result
|
498
517
|
end
|
499
518
|
rescue ::Gapic::Rest::Error => e
|
500
519
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -586,7 +605,6 @@ module Google
|
|
586
605
|
|
587
606
|
@batch_service_stub.list_jobs request, options do |result, operation|
|
588
607
|
yield result, operation if block_given?
|
589
|
-
return result
|
590
608
|
end
|
591
609
|
rescue ::Gapic::Rest::Error => e
|
592
610
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -665,7 +683,6 @@ module Google
|
|
665
683
|
|
666
684
|
@batch_service_stub.get_task request, options do |result, operation|
|
667
685
|
yield result, operation if block_given?
|
668
|
-
return result
|
669
686
|
end
|
670
687
|
rescue ::Gapic::Rest::Error => e
|
671
688
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -758,7 +775,6 @@ module Google
|
|
758
775
|
|
759
776
|
@batch_service_stub.list_tasks request, options do |result, operation|
|
760
777
|
yield result, operation if block_given?
|
761
|
-
return result
|
762
778
|
end
|
763
779
|
rescue ::Gapic::Rest::Error => e
|
764
780
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -838,6 +854,11 @@ module Google
|
|
838
854
|
# default endpoint URL. The default value of nil uses the environment
|
839
855
|
# universe (usually the default "googleapis.com" universe).
|
840
856
|
# @return [::String,nil]
|
857
|
+
# @!attribute [rw] logger
|
858
|
+
# A custom logger to use for request/response debug logging, or the value
|
859
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
860
|
+
# explicitly disable logging.
|
861
|
+
# @return [::Logger,:default,nil]
|
841
862
|
#
|
842
863
|
class Configuration
|
843
864
|
extend ::Gapic::Config
|
@@ -866,6 +887,7 @@ module Google
|
|
866
887
|
# by the host service.
|
867
888
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
868
889
|
config_attr :bindings_override, {}, ::Hash, nil
|
890
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
869
891
|
|
870
892
|
# @private
|
871
893
|
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
|
##
|