google-cloud-notebooks-v1 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +30 -20
- data/lib/google/cloud/notebooks/v1/managed_notebook_service/client.rb +40 -14
- data/lib/google/cloud/notebooks/v1/managed_notebook_service/operations.rb +12 -15
- data/lib/google/cloud/notebooks/v1/managed_notebook_service/rest/client.rb +39 -14
- data/lib/google/cloud/notebooks/v1/managed_notebook_service/rest/operations.rb +43 -38
- data/lib/google/cloud/notebooks/v1/managed_notebook_service/rest/service_stub.rb +118 -80
- data/lib/google/cloud/notebooks/v1/notebook_service/client.rb +56 -35
- data/lib/google/cloud/notebooks/v1/notebook_service/operations.rb +12 -15
- data/lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb +52 -35
- data/lib/google/cloud/notebooks/v1/notebook_service/rest/operations.rb +43 -38
- data/lib/google/cloud/notebooks/v1/notebook_service/rest/service_stub.rb +286 -206
- data/lib/google/cloud/notebooks/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +5 -5
@@ -228,15 +228,27 @@ module Google
|
|
228
228
|
endpoint: @config.endpoint,
|
229
229
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
230
230
|
universe_domain: @config.universe_domain,
|
231
|
-
credentials: credentials
|
231
|
+
credentials: credentials,
|
232
|
+
logger: @config.logger
|
232
233
|
)
|
233
234
|
|
235
|
+
@notebook_service_stub.logger(stub: true)&.info do |entry|
|
236
|
+
entry.set_system_name
|
237
|
+
entry.set_service
|
238
|
+
entry.message = "Created client for #{entry.service}"
|
239
|
+
entry.set_credentials_fields credentials
|
240
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
241
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
242
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
243
|
+
end
|
244
|
+
|
234
245
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
235
246
|
config.credentials = credentials
|
236
247
|
config.quota_project = @quota_project_id
|
237
248
|
config.endpoint = @notebook_service_stub.endpoint
|
238
249
|
config.universe_domain = @notebook_service_stub.universe_domain
|
239
250
|
config.bindings_override = @config.bindings_override
|
251
|
+
config.logger = @notebook_service_stub.logger if config.respond_to? :logger=
|
240
252
|
end
|
241
253
|
|
242
254
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
@@ -245,6 +257,7 @@ module Google
|
|
245
257
|
config.endpoint = @notebook_service_stub.endpoint
|
246
258
|
config.universe_domain = @notebook_service_stub.universe_domain
|
247
259
|
config.bindings_override = @config.bindings_override
|
260
|
+
config.logger = @notebook_service_stub.logger if config.respond_to? :logger=
|
248
261
|
end
|
249
262
|
end
|
250
263
|
|
@@ -269,6 +282,15 @@ module Google
|
|
269
282
|
#
|
270
283
|
attr_reader :iam_policy_client
|
271
284
|
|
285
|
+
##
|
286
|
+
# The logger used for request/response debug logging.
|
287
|
+
#
|
288
|
+
# @return [Logger]
|
289
|
+
#
|
290
|
+
def logger
|
291
|
+
@notebook_service_stub.logger
|
292
|
+
end
|
293
|
+
|
272
294
|
# Service calls
|
273
295
|
|
274
296
|
##
|
@@ -354,7 +376,6 @@ module Google
|
|
354
376
|
|
355
377
|
@notebook_service_stub.list_instances request, options do |result, operation|
|
356
378
|
yield result, operation if block_given?
|
357
|
-
return result
|
358
379
|
end
|
359
380
|
rescue ::Gapic::Rest::Error => e
|
360
381
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -434,7 +455,6 @@ module Google
|
|
434
455
|
|
435
456
|
@notebook_service_stub.get_instance request, options do |result, operation|
|
436
457
|
yield result, operation if block_given?
|
437
|
-
return result
|
438
458
|
end
|
439
459
|
rescue ::Gapic::Rest::Error => e
|
440
460
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -526,7 +546,7 @@ module Google
|
|
526
546
|
@notebook_service_stub.create_instance request, options do |result, operation|
|
527
547
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
528
548
|
yield result, operation if block_given?
|
529
|
-
|
549
|
+
throw :response, result
|
530
550
|
end
|
531
551
|
rescue ::Gapic::Rest::Error => e
|
532
552
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -622,7 +642,7 @@ module Google
|
|
622
642
|
@notebook_service_stub.register_instance request, options do |result, operation|
|
623
643
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
624
644
|
yield result, operation if block_given?
|
625
|
-
|
645
|
+
throw :response, result
|
626
646
|
end
|
627
647
|
rescue ::Gapic::Rest::Error => e
|
628
648
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -717,7 +737,7 @@ module Google
|
|
717
737
|
@notebook_service_stub.set_instance_accelerator request, options do |result, operation|
|
718
738
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
719
739
|
yield result, operation if block_given?
|
720
|
-
|
740
|
+
throw :response, result
|
721
741
|
end
|
722
742
|
rescue ::Gapic::Rest::Error => e
|
723
743
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -808,7 +828,7 @@ module Google
|
|
808
828
|
@notebook_service_stub.set_instance_machine_type request, options do |result, operation|
|
809
829
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
810
830
|
yield result, operation if block_given?
|
811
|
-
|
831
|
+
throw :response, result
|
812
832
|
end
|
813
833
|
rescue ::Gapic::Rest::Error => e
|
814
834
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -898,7 +918,7 @@ module Google
|
|
898
918
|
@notebook_service_stub.update_instance_config request, options do |result, operation|
|
899
919
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
900
920
|
yield result, operation if block_given?
|
901
|
-
|
921
|
+
throw :response, result
|
902
922
|
end
|
903
923
|
rescue ::Gapic::Rest::Error => e
|
904
924
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -988,7 +1008,7 @@ module Google
|
|
988
1008
|
@notebook_service_stub.update_shielded_instance_config request, options do |result, operation|
|
989
1009
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
990
1010
|
yield result, operation if block_given?
|
991
|
-
|
1011
|
+
throw :response, result
|
992
1012
|
end
|
993
1013
|
rescue ::Gapic::Rest::Error => e
|
994
1014
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1079,7 +1099,7 @@ module Google
|
|
1079
1099
|
@notebook_service_stub.set_instance_labels request, options do |result, operation|
|
1080
1100
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1081
1101
|
yield result, operation if block_given?
|
1082
|
-
|
1102
|
+
throw :response, result
|
1083
1103
|
end
|
1084
1104
|
rescue ::Gapic::Rest::Error => e
|
1085
1105
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1161,7 +1181,6 @@ module Google
|
|
1161
1181
|
|
1162
1182
|
@notebook_service_stub.update_instance_metadata_items request, options do |result, operation|
|
1163
1183
|
yield result, operation if block_given?
|
1164
|
-
return result
|
1165
1184
|
end
|
1166
1185
|
rescue ::Gapic::Rest::Error => e
|
1167
1186
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1249,7 +1268,7 @@ module Google
|
|
1249
1268
|
@notebook_service_stub.delete_instance request, options do |result, operation|
|
1250
1269
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1251
1270
|
yield result, operation if block_given?
|
1252
|
-
|
1271
|
+
throw :response, result
|
1253
1272
|
end
|
1254
1273
|
rescue ::Gapic::Rest::Error => e
|
1255
1274
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1337,7 +1356,7 @@ module Google
|
|
1337
1356
|
@notebook_service_stub.start_instance request, options do |result, operation|
|
1338
1357
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1339
1358
|
yield result, operation if block_given?
|
1340
|
-
|
1359
|
+
throw :response, result
|
1341
1360
|
end
|
1342
1361
|
rescue ::Gapic::Rest::Error => e
|
1343
1362
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1425,7 +1444,7 @@ module Google
|
|
1425
1444
|
@notebook_service_stub.stop_instance request, options do |result, operation|
|
1426
1445
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1427
1446
|
yield result, operation if block_given?
|
1428
|
-
|
1447
|
+
throw :response, result
|
1429
1448
|
end
|
1430
1449
|
rescue ::Gapic::Rest::Error => e
|
1431
1450
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1513,7 +1532,7 @@ module Google
|
|
1513
1532
|
@notebook_service_stub.reset_instance request, options do |result, operation|
|
1514
1533
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1515
1534
|
yield result, operation if block_given?
|
1516
|
-
|
1535
|
+
throw :response, result
|
1517
1536
|
end
|
1518
1537
|
rescue ::Gapic::Rest::Error => e
|
1519
1538
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1610,7 +1629,7 @@ module Google
|
|
1610
1629
|
@notebook_service_stub.report_instance_info request, options do |result, operation|
|
1611
1630
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1612
1631
|
yield result, operation if block_given?
|
1613
|
-
|
1632
|
+
throw :response, result
|
1614
1633
|
end
|
1615
1634
|
rescue ::Gapic::Rest::Error => e
|
1616
1635
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1693,7 +1712,6 @@ module Google
|
|
1693
1712
|
|
1694
1713
|
@notebook_service_stub.is_instance_upgradeable request, options do |result, operation|
|
1695
1714
|
yield result, operation if block_given?
|
1696
|
-
return result
|
1697
1715
|
end
|
1698
1716
|
rescue ::Gapic::Rest::Error => e
|
1699
1717
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1773,7 +1791,6 @@ module Google
|
|
1773
1791
|
|
1774
1792
|
@notebook_service_stub.get_instance_health request, options do |result, operation|
|
1775
1793
|
yield result, operation if block_given?
|
1776
|
-
return result
|
1777
1794
|
end
|
1778
1795
|
rescue ::Gapic::Rest::Error => e
|
1779
1796
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1864,7 +1881,7 @@ module Google
|
|
1864
1881
|
@notebook_service_stub.upgrade_instance request, options do |result, operation|
|
1865
1882
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1866
1883
|
yield result, operation if block_given?
|
1867
|
-
|
1884
|
+
throw :response, result
|
1868
1885
|
end
|
1869
1886
|
rescue ::Gapic::Rest::Error => e
|
1870
1887
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1955,7 +1972,7 @@ module Google
|
|
1955
1972
|
@notebook_service_stub.rollback_instance request, options do |result, operation|
|
1956
1973
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1957
1974
|
yield result, operation if block_given?
|
1958
|
-
|
1975
|
+
throw :response, result
|
1959
1976
|
end
|
1960
1977
|
rescue ::Gapic::Rest::Error => e
|
1961
1978
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2045,7 +2062,7 @@ module Google
|
|
2045
2062
|
@notebook_service_stub.diagnose_instance request, options do |result, operation|
|
2046
2063
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2047
2064
|
yield result, operation if block_given?
|
2048
|
-
|
2065
|
+
throw :response, result
|
2049
2066
|
end
|
2050
2067
|
rescue ::Gapic::Rest::Error => e
|
2051
2068
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2140,7 +2157,7 @@ module Google
|
|
2140
2157
|
@notebook_service_stub.upgrade_instance_internal request, options do |result, operation|
|
2141
2158
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2142
2159
|
yield result, operation if block_given?
|
2143
|
-
|
2160
|
+
throw :response, result
|
2144
2161
|
end
|
2145
2162
|
rescue ::Gapic::Rest::Error => e
|
2146
2163
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2228,7 +2245,6 @@ module Google
|
|
2228
2245
|
|
2229
2246
|
@notebook_service_stub.list_environments request, options do |result, operation|
|
2230
2247
|
yield result, operation if block_given?
|
2231
|
-
return result
|
2232
2248
|
end
|
2233
2249
|
rescue ::Gapic::Rest::Error => e
|
2234
2250
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2308,7 +2324,6 @@ module Google
|
|
2308
2324
|
|
2309
2325
|
@notebook_service_stub.get_environment request, options do |result, operation|
|
2310
2326
|
yield result, operation if block_given?
|
2311
|
-
return result
|
2312
2327
|
end
|
2313
2328
|
rescue ::Gapic::Rest::Error => e
|
2314
2329
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2402,7 +2417,7 @@ module Google
|
|
2402
2417
|
@notebook_service_stub.create_environment request, options do |result, operation|
|
2403
2418
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2404
2419
|
yield result, operation if block_given?
|
2405
|
-
|
2420
|
+
throw :response, result
|
2406
2421
|
end
|
2407
2422
|
rescue ::Gapic::Rest::Error => e
|
2408
2423
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2490,7 +2505,7 @@ module Google
|
|
2490
2505
|
@notebook_service_stub.delete_environment request, options do |result, operation|
|
2491
2506
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2492
2507
|
yield result, operation if block_given?
|
2493
|
-
|
2508
|
+
throw :response, result
|
2494
2509
|
end
|
2495
2510
|
rescue ::Gapic::Rest::Error => e
|
2496
2511
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2583,7 +2598,6 @@ module Google
|
|
2583
2598
|
|
2584
2599
|
@notebook_service_stub.list_schedules request, options do |result, operation|
|
2585
2600
|
yield result, operation if block_given?
|
2586
|
-
return result
|
2587
2601
|
end
|
2588
2602
|
rescue ::Gapic::Rest::Error => e
|
2589
2603
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2663,7 +2677,6 @@ module Google
|
|
2663
2677
|
|
2664
2678
|
@notebook_service_stub.get_schedule request, options do |result, operation|
|
2665
2679
|
yield result, operation if block_given?
|
2666
|
-
return result
|
2667
2680
|
end
|
2668
2681
|
rescue ::Gapic::Rest::Error => e
|
2669
2682
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2751,7 +2764,7 @@ module Google
|
|
2751
2764
|
@notebook_service_stub.delete_schedule request, options do |result, operation|
|
2752
2765
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2753
2766
|
yield result, operation if block_given?
|
2754
|
-
|
2767
|
+
throw :response, result
|
2755
2768
|
end
|
2756
2769
|
rescue ::Gapic::Rest::Error => e
|
2757
2770
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2843,7 +2856,7 @@ module Google
|
|
2843
2856
|
@notebook_service_stub.create_schedule request, options do |result, operation|
|
2844
2857
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2845
2858
|
yield result, operation if block_given?
|
2846
|
-
|
2859
|
+
throw :response, result
|
2847
2860
|
end
|
2848
2861
|
rescue ::Gapic::Rest::Error => e
|
2849
2862
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2931,7 +2944,7 @@ module Google
|
|
2931
2944
|
@notebook_service_stub.trigger_schedule request, options do |result, operation|
|
2932
2945
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2933
2946
|
yield result, operation if block_given?
|
2934
|
-
|
2947
|
+
throw :response, result
|
2935
2948
|
end
|
2936
2949
|
rescue ::Gapic::Rest::Error => e
|
2937
2950
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3026,7 +3039,6 @@ module Google
|
|
3026
3039
|
|
3027
3040
|
@notebook_service_stub.list_executions request, options do |result, operation|
|
3028
3041
|
yield result, operation if block_given?
|
3029
|
-
return result
|
3030
3042
|
end
|
3031
3043
|
rescue ::Gapic::Rest::Error => e
|
3032
3044
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3106,7 +3118,6 @@ module Google
|
|
3106
3118
|
|
3107
3119
|
@notebook_service_stub.get_execution request, options do |result, operation|
|
3108
3120
|
yield result, operation if block_given?
|
3109
|
-
return result
|
3110
3121
|
end
|
3111
3122
|
rescue ::Gapic::Rest::Error => e
|
3112
3123
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3194,7 +3205,7 @@ module Google
|
|
3194
3205
|
@notebook_service_stub.delete_execution request, options do |result, operation|
|
3195
3206
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
3196
3207
|
yield result, operation if block_given?
|
3197
|
-
|
3208
|
+
throw :response, result
|
3198
3209
|
end
|
3199
3210
|
rescue ::Gapic::Rest::Error => e
|
3200
3211
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3286,7 +3297,7 @@ module Google
|
|
3286
3297
|
@notebook_service_stub.create_execution request, options do |result, operation|
|
3287
3298
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
3288
3299
|
yield result, operation if block_given?
|
3289
|
-
|
3300
|
+
throw :response, result
|
3290
3301
|
end
|
3291
3302
|
rescue ::Gapic::Rest::Error => e
|
3292
3303
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3366,6 +3377,11 @@ module Google
|
|
3366
3377
|
# default endpoint URL. The default value of nil uses the environment
|
3367
3378
|
# universe (usually the default "googleapis.com" universe).
|
3368
3379
|
# @return [::String,nil]
|
3380
|
+
# @!attribute [rw] logger
|
3381
|
+
# A custom logger to use for request/response debug logging, or the value
|
3382
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
3383
|
+
# explicitly disable logging.
|
3384
|
+
# @return [::Logger,:default,nil]
|
3369
3385
|
#
|
3370
3386
|
class Configuration
|
3371
3387
|
extend ::Gapic::Config
|
@@ -3394,6 +3410,7 @@ module Google
|
|
3394
3410
|
# by the host service.
|
3395
3411
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
3396
3412
|
config_attr :bindings_override, {}, ::Hash, nil
|
3413
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
3397
3414
|
|
3398
3415
|
# @private
|
3399
3416
|
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
|
##
|