google-cloud-alloy_db-v1beta 0.10.0 → 0.11.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 +31 -21
- data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb +54 -36
- data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/operations.rb +12 -15
- data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb +50 -36
- data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/operations.rb +43 -38
- data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb +294 -212
- data/lib/google/cloud/alloy_db/v1beta/version.rb +1 -1
- data/proto_docs/google/api/client.rb +19 -0
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +6 -6
@@ -221,15 +221,27 @@ module Google
|
|
221
221
|
endpoint: @config.endpoint,
|
222
222
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
223
223
|
universe_domain: @config.universe_domain,
|
224
|
-
credentials: credentials
|
224
|
+
credentials: credentials,
|
225
|
+
logger: @config.logger
|
225
226
|
)
|
226
227
|
|
228
|
+
@alloy_db_admin_stub.logger(stub: true)&.info do |entry|
|
229
|
+
entry.set_system_name
|
230
|
+
entry.set_service
|
231
|
+
entry.message = "Created client for #{entry.service}"
|
232
|
+
entry.set_credentials_fields credentials
|
233
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
234
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
235
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
236
|
+
end
|
237
|
+
|
227
238
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
228
239
|
config.credentials = credentials
|
229
240
|
config.quota_project = @quota_project_id
|
230
241
|
config.endpoint = @alloy_db_admin_stub.endpoint
|
231
242
|
config.universe_domain = @alloy_db_admin_stub.universe_domain
|
232
243
|
config.bindings_override = @config.bindings_override
|
244
|
+
config.logger = @alloy_db_admin_stub.logger if config.respond_to? :logger=
|
233
245
|
end
|
234
246
|
|
235
247
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
@@ -237,6 +249,7 @@ module Google
|
|
237
249
|
config.quota_project = @quota_project_id
|
238
250
|
config.endpoint = @alloy_db_admin_stub.endpoint
|
239
251
|
config.universe_domain = @alloy_db_admin_stub.universe_domain
|
252
|
+
config.logger = @alloy_db_admin_stub.logger if config.respond_to? :logger=
|
240
253
|
end
|
241
254
|
end
|
242
255
|
|
@@ -261,6 +274,15 @@ module Google
|
|
261
274
|
#
|
262
275
|
attr_reader :iam_policy_client
|
263
276
|
|
277
|
+
##
|
278
|
+
# The logger used for request/response debug logging.
|
279
|
+
#
|
280
|
+
# @return [Logger]
|
281
|
+
#
|
282
|
+
def logger
|
283
|
+
@alloy_db_admin_stub.logger
|
284
|
+
end
|
285
|
+
|
264
286
|
# Service calls
|
265
287
|
|
266
288
|
##
|
@@ -352,7 +374,6 @@ module Google
|
|
352
374
|
|
353
375
|
@alloy_db_admin_stub.list_clusters request, options do |result, operation|
|
354
376
|
yield result, operation if block_given?
|
355
|
-
return result
|
356
377
|
end
|
357
378
|
rescue ::Gapic::Rest::Error => e
|
358
379
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -435,7 +456,6 @@ module Google
|
|
435
456
|
|
436
457
|
@alloy_db_admin_stub.get_cluster request, options do |result, operation|
|
437
458
|
yield result, operation if block_given?
|
438
|
-
return result
|
439
459
|
end
|
440
460
|
rescue ::Gapic::Rest::Error => e
|
441
461
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -545,7 +565,7 @@ module Google
|
|
545
565
|
@alloy_db_admin_stub.create_cluster request, options do |result, operation|
|
546
566
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
547
567
|
yield result, operation if block_given?
|
548
|
-
|
568
|
+
throw :response, result
|
549
569
|
end
|
550
570
|
rescue ::Gapic::Rest::Error => e
|
551
571
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -659,7 +679,7 @@ module Google
|
|
659
679
|
@alloy_db_admin_stub.update_cluster request, options do |result, operation|
|
660
680
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
661
681
|
yield result, operation if block_given?
|
662
|
-
|
682
|
+
throw :response, result
|
663
683
|
end
|
664
684
|
rescue ::Gapic::Rest::Error => e
|
665
685
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -771,7 +791,7 @@ module Google
|
|
771
791
|
@alloy_db_admin_stub.upgrade_cluster request, options do |result, operation|
|
772
792
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
773
793
|
yield result, operation if block_given?
|
774
|
-
|
794
|
+
throw :response, result
|
775
795
|
end
|
776
796
|
rescue ::Gapic::Rest::Error => e
|
777
797
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -883,7 +903,7 @@ module Google
|
|
883
903
|
@alloy_db_admin_stub.delete_cluster request, options do |result, operation|
|
884
904
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
885
905
|
yield result, operation if block_given?
|
886
|
-
|
906
|
+
throw :response, result
|
887
907
|
end
|
888
908
|
rescue ::Gapic::Rest::Error => e
|
889
909
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -996,7 +1016,7 @@ module Google
|
|
996
1016
|
@alloy_db_admin_stub.promote_cluster request, options do |result, operation|
|
997
1017
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
998
1018
|
yield result, operation if block_given?
|
999
|
-
|
1019
|
+
throw :response, result
|
1000
1020
|
end
|
1001
1021
|
rescue ::Gapic::Rest::Error => e
|
1002
1022
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1104,7 +1124,7 @@ module Google
|
|
1104
1124
|
@alloy_db_admin_stub.switchover_cluster request, options do |result, operation|
|
1105
1125
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1106
1126
|
yield result, operation if block_given?
|
1107
|
-
|
1127
|
+
throw :response, result
|
1108
1128
|
end
|
1109
1129
|
rescue ::Gapic::Rest::Error => e
|
1110
1130
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1221,7 +1241,7 @@ module Google
|
|
1221
1241
|
@alloy_db_admin_stub.restore_cluster request, options do |result, operation|
|
1222
1242
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1223
1243
|
yield result, operation if block_given?
|
1224
|
-
|
1244
|
+
throw :response, result
|
1225
1245
|
end
|
1226
1246
|
rescue ::Gapic::Rest::Error => e
|
1227
1247
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1332,7 +1352,7 @@ module Google
|
|
1332
1352
|
@alloy_db_admin_stub.create_secondary_cluster request, options do |result, operation|
|
1333
1353
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1334
1354
|
yield result, operation if block_given?
|
1335
|
-
|
1355
|
+
throw :response, result
|
1336
1356
|
end
|
1337
1357
|
rescue ::Gapic::Rest::Error => e
|
1338
1358
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1429,7 +1449,6 @@ module Google
|
|
1429
1449
|
|
1430
1450
|
@alloy_db_admin_stub.list_instances request, options do |result, operation|
|
1431
1451
|
yield result, operation if block_given?
|
1432
|
-
return result
|
1433
1452
|
end
|
1434
1453
|
rescue ::Gapic::Rest::Error => e
|
1435
1454
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1511,7 +1530,6 @@ module Google
|
|
1511
1530
|
|
1512
1531
|
@alloy_db_admin_stub.get_instance request, options do |result, operation|
|
1513
1532
|
yield result, operation if block_given?
|
1514
|
-
return result
|
1515
1533
|
end
|
1516
1534
|
rescue ::Gapic::Rest::Error => e
|
1517
1535
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1621,7 +1639,7 @@ module Google
|
|
1621
1639
|
@alloy_db_admin_stub.create_instance request, options do |result, operation|
|
1622
1640
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1623
1641
|
yield result, operation if block_given?
|
1624
|
-
|
1642
|
+
throw :response, result
|
1625
1643
|
end
|
1626
1644
|
rescue ::Gapic::Rest::Error => e
|
1627
1645
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1731,7 +1749,7 @@ module Google
|
|
1731
1749
|
@alloy_db_admin_stub.create_secondary_instance request, options do |result, operation|
|
1732
1750
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1733
1751
|
yield result, operation if block_given?
|
1734
|
-
|
1752
|
+
throw :response, result
|
1735
1753
|
end
|
1736
1754
|
rescue ::Gapic::Rest::Error => e
|
1737
1755
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1843,7 +1861,7 @@ module Google
|
|
1843
1861
|
@alloy_db_admin_stub.batch_create_instances request, options do |result, operation|
|
1844
1862
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1845
1863
|
yield result, operation if block_given?
|
1846
|
-
|
1864
|
+
throw :response, result
|
1847
1865
|
end
|
1848
1866
|
rescue ::Gapic::Rest::Error => e
|
1849
1867
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1957,7 +1975,7 @@ module Google
|
|
1957
1975
|
@alloy_db_admin_stub.update_instance request, options do |result, operation|
|
1958
1976
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1959
1977
|
yield result, operation if block_given?
|
1960
|
-
|
1978
|
+
throw :response, result
|
1961
1979
|
end
|
1962
1980
|
rescue ::Gapic::Rest::Error => e
|
1963
1981
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2067,7 +2085,7 @@ module Google
|
|
2067
2085
|
@alloy_db_admin_stub.delete_instance request, options do |result, operation|
|
2068
2086
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2069
2087
|
yield result, operation if block_given?
|
2070
|
-
|
2088
|
+
throw :response, result
|
2071
2089
|
end
|
2072
2090
|
rescue ::Gapic::Rest::Error => e
|
2073
2091
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2175,7 +2193,7 @@ module Google
|
|
2175
2193
|
@alloy_db_admin_stub.failover_instance request, options do |result, operation|
|
2176
2194
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2177
2195
|
yield result, operation if block_given?
|
2178
|
-
|
2196
|
+
throw :response, result
|
2179
2197
|
end
|
2180
2198
|
rescue ::Gapic::Rest::Error => e
|
2181
2199
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2284,7 +2302,7 @@ module Google
|
|
2284
2302
|
@alloy_db_admin_stub.inject_fault request, options do |result, operation|
|
2285
2303
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2286
2304
|
yield result, operation if block_given?
|
2287
|
-
|
2305
|
+
throw :response, result
|
2288
2306
|
end
|
2289
2307
|
rescue ::Gapic::Rest::Error => e
|
2290
2308
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2394,7 +2412,7 @@ module Google
|
|
2394
2412
|
@alloy_db_admin_stub.restart_instance request, options do |result, operation|
|
2395
2413
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2396
2414
|
yield result, operation if block_given?
|
2397
|
-
|
2415
|
+
throw :response, result
|
2398
2416
|
end
|
2399
2417
|
rescue ::Gapic::Rest::Error => e
|
2400
2418
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2487,7 +2505,6 @@ module Google
|
|
2487
2505
|
|
2488
2506
|
@alloy_db_admin_stub.execute_sql request, options do |result, operation|
|
2489
2507
|
yield result, operation if block_given?
|
2490
|
-
return result
|
2491
2508
|
end
|
2492
2509
|
rescue ::Gapic::Rest::Error => e
|
2493
2510
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2579,7 +2596,6 @@ module Google
|
|
2579
2596
|
|
2580
2597
|
@alloy_db_admin_stub.list_backups request, options do |result, operation|
|
2581
2598
|
yield result, operation if block_given?
|
2582
|
-
return result
|
2583
2599
|
end
|
2584
2600
|
rescue ::Gapic::Rest::Error => e
|
2585
2601
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2658,7 +2674,6 @@ module Google
|
|
2658
2674
|
|
2659
2675
|
@alloy_db_admin_stub.get_backup request, options do |result, operation|
|
2660
2676
|
yield result, operation if block_given?
|
2661
|
-
return result
|
2662
2677
|
end
|
2663
2678
|
rescue ::Gapic::Rest::Error => e
|
2664
2679
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2766,7 +2781,7 @@ module Google
|
|
2766
2781
|
@alloy_db_admin_stub.create_backup request, options do |result, operation|
|
2767
2782
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2768
2783
|
yield result, operation if block_given?
|
2769
|
-
|
2784
|
+
throw :response, result
|
2770
2785
|
end
|
2771
2786
|
rescue ::Gapic::Rest::Error => e
|
2772
2787
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2879,7 +2894,7 @@ module Google
|
|
2879
2894
|
@alloy_db_admin_stub.update_backup request, options do |result, operation|
|
2880
2895
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2881
2896
|
yield result, operation if block_given?
|
2882
|
-
|
2897
|
+
throw :response, result
|
2883
2898
|
end
|
2884
2899
|
rescue ::Gapic::Rest::Error => e
|
2885
2900
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2988,7 +3003,7 @@ module Google
|
|
2988
3003
|
@alloy_db_admin_stub.delete_backup request, options do |result, operation|
|
2989
3004
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2990
3005
|
yield result, operation if block_given?
|
2991
|
-
|
3006
|
+
throw :response, result
|
2992
3007
|
end
|
2993
3008
|
rescue ::Gapic::Rest::Error => e
|
2994
3009
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3083,7 +3098,7 @@ module Google
|
|
3083
3098
|
@alloy_db_admin_stub.list_supported_database_flags request, options do |result, operation|
|
3084
3099
|
result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_admin_stub, :list_supported_database_flags, "supported_database_flags", request, result, options
|
3085
3100
|
yield result, operation if block_given?
|
3086
|
-
|
3101
|
+
throw :response, result
|
3087
3102
|
end
|
3088
3103
|
rescue ::Gapic::Rest::Error => e
|
3089
3104
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3196,7 +3211,6 @@ module Google
|
|
3196
3211
|
|
3197
3212
|
@alloy_db_admin_stub.generate_client_certificate request, options do |result, operation|
|
3198
3213
|
yield result, operation if block_given?
|
3199
|
-
return result
|
3200
3214
|
end
|
3201
3215
|
rescue ::Gapic::Rest::Error => e
|
3202
3216
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3290,7 +3304,6 @@ module Google
|
|
3290
3304
|
|
3291
3305
|
@alloy_db_admin_stub.get_connection_info request, options do |result, operation|
|
3292
3306
|
yield result, operation if block_given?
|
3293
|
-
return result
|
3294
3307
|
end
|
3295
3308
|
rescue ::Gapic::Rest::Error => e
|
3296
3309
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3382,7 +3395,6 @@ module Google
|
|
3382
3395
|
|
3383
3396
|
@alloy_db_admin_stub.list_users request, options do |result, operation|
|
3384
3397
|
yield result, operation if block_given?
|
3385
|
-
return result
|
3386
3398
|
end
|
3387
3399
|
rescue ::Gapic::Rest::Error => e
|
3388
3400
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3462,7 +3474,6 @@ module Google
|
|
3462
3474
|
|
3463
3475
|
@alloy_db_admin_stub.get_user request, options do |result, operation|
|
3464
3476
|
yield result, operation if block_given?
|
3465
|
-
return result
|
3466
3477
|
end
|
3467
3478
|
rescue ::Gapic::Rest::Error => e
|
3468
3479
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3562,7 +3573,6 @@ module Google
|
|
3562
3573
|
|
3563
3574
|
@alloy_db_admin_stub.create_user request, options do |result, operation|
|
3564
3575
|
yield result, operation if block_given?
|
3565
|
-
return result
|
3566
3576
|
end
|
3567
3577
|
rescue ::Gapic::Rest::Error => e
|
3568
3578
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3666,7 +3676,6 @@ module Google
|
|
3666
3676
|
|
3667
3677
|
@alloy_db_admin_stub.update_user request, options do |result, operation|
|
3668
3678
|
yield result, operation if block_given?
|
3669
|
-
return result
|
3670
3679
|
end
|
3671
3680
|
rescue ::Gapic::Rest::Error => e
|
3672
3681
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3763,7 +3772,6 @@ module Google
|
|
3763
3772
|
|
3764
3773
|
@alloy_db_admin_stub.delete_user request, options do |result, operation|
|
3765
3774
|
yield result, operation if block_given?
|
3766
|
-
return result
|
3767
3775
|
end
|
3768
3776
|
rescue ::Gapic::Rest::Error => e
|
3769
3777
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3859,7 +3867,7 @@ module Google
|
|
3859
3867
|
@alloy_db_admin_stub.list_databases request, options do |result, operation|
|
3860
3868
|
result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_admin_stub, :list_databases, "databases", request, result, options
|
3861
3869
|
yield result, operation if block_given?
|
3862
|
-
|
3870
|
+
throw :response, result
|
3863
3871
|
end
|
3864
3872
|
rescue ::Gapic::Rest::Error => e
|
3865
3873
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3939,6 +3947,11 @@ module Google
|
|
3939
3947
|
# default endpoint URL. The default value of nil uses the environment
|
3940
3948
|
# universe (usually the default "googleapis.com" universe).
|
3941
3949
|
# @return [::String,nil]
|
3950
|
+
# @!attribute [rw] logger
|
3951
|
+
# A custom logger to use for request/response debug logging, or the value
|
3952
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
3953
|
+
# explicitly disable logging.
|
3954
|
+
# @return [::Logger,:default,nil]
|
3942
3955
|
#
|
3943
3956
|
class Configuration
|
3944
3957
|
extend ::Gapic::Config
|
@@ -3967,6 +3980,7 @@ module Google
|
|
3967
3980
|
# by the host service.
|
3968
3981
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
3969
3982
|
config_attr :bindings_override, {}, ::Hash, nil
|
3983
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
3970
3984
|
|
3971
3985
|
# @private
|
3972
3986
|
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
|
##
|