google-cloud-alloy_db-v1alpha 0.8.0 → 0.9.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 +31 -21
- data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/client.rb +54 -36
- data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/operations.rb +12 -15
- data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/rest/client.rb +50 -36
- data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/rest/operations.rb +43 -38
- data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/rest/service_stub.rb +294 -212
- data/lib/google/cloud/alloy_db/v1alpha/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
@@ -216,15 +216,27 @@ module Google
|
|
216
216
|
endpoint: @config.endpoint,
|
217
217
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
218
218
|
universe_domain: @config.universe_domain,
|
219
|
-
credentials: credentials
|
219
|
+
credentials: credentials,
|
220
|
+
logger: @config.logger
|
220
221
|
)
|
221
222
|
|
223
|
+
@alloy_db_admin_stub.logger(stub: true)&.info do |entry|
|
224
|
+
entry.set_system_name
|
225
|
+
entry.set_service
|
226
|
+
entry.message = "Created client for #{entry.service}"
|
227
|
+
entry.set_credentials_fields credentials
|
228
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
229
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
230
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
231
|
+
end
|
232
|
+
|
222
233
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
223
234
|
config.credentials = credentials
|
224
235
|
config.quota_project = @quota_project_id
|
225
236
|
config.endpoint = @alloy_db_admin_stub.endpoint
|
226
237
|
config.universe_domain = @alloy_db_admin_stub.universe_domain
|
227
238
|
config.bindings_override = @config.bindings_override
|
239
|
+
config.logger = @alloy_db_admin_stub.logger if config.respond_to? :logger=
|
228
240
|
end
|
229
241
|
|
230
242
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
@@ -232,6 +244,7 @@ module Google
|
|
232
244
|
config.quota_project = @quota_project_id
|
233
245
|
config.endpoint = @alloy_db_admin_stub.endpoint
|
234
246
|
config.universe_domain = @alloy_db_admin_stub.universe_domain
|
247
|
+
config.logger = @alloy_db_admin_stub.logger if config.respond_to? :logger=
|
235
248
|
end
|
236
249
|
end
|
237
250
|
|
@@ -256,6 +269,15 @@ module Google
|
|
256
269
|
#
|
257
270
|
attr_reader :iam_policy_client
|
258
271
|
|
272
|
+
##
|
273
|
+
# The logger used for request/response debug logging.
|
274
|
+
#
|
275
|
+
# @return [Logger]
|
276
|
+
#
|
277
|
+
def logger
|
278
|
+
@alloy_db_admin_stub.logger
|
279
|
+
end
|
280
|
+
|
259
281
|
# Service calls
|
260
282
|
|
261
283
|
##
|
@@ -347,7 +369,6 @@ module Google
|
|
347
369
|
|
348
370
|
@alloy_db_admin_stub.list_clusters request, options do |result, operation|
|
349
371
|
yield result, operation if block_given?
|
350
|
-
return result
|
351
372
|
end
|
352
373
|
rescue ::Gapic::Rest::Error => e
|
353
374
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -430,7 +451,6 @@ module Google
|
|
430
451
|
|
431
452
|
@alloy_db_admin_stub.get_cluster request, options do |result, operation|
|
432
453
|
yield result, operation if block_given?
|
433
|
-
return result
|
434
454
|
end
|
435
455
|
rescue ::Gapic::Rest::Error => e
|
436
456
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -540,7 +560,7 @@ module Google
|
|
540
560
|
@alloy_db_admin_stub.create_cluster request, options do |result, operation|
|
541
561
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
542
562
|
yield result, operation if block_given?
|
543
|
-
|
563
|
+
throw :response, result
|
544
564
|
end
|
545
565
|
rescue ::Gapic::Rest::Error => e
|
546
566
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -654,7 +674,7 @@ module Google
|
|
654
674
|
@alloy_db_admin_stub.update_cluster request, options do |result, operation|
|
655
675
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
656
676
|
yield result, operation if block_given?
|
657
|
-
|
677
|
+
throw :response, result
|
658
678
|
end
|
659
679
|
rescue ::Gapic::Rest::Error => e
|
660
680
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -766,7 +786,7 @@ module Google
|
|
766
786
|
@alloy_db_admin_stub.upgrade_cluster request, options do |result, operation|
|
767
787
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
768
788
|
yield result, operation if block_given?
|
769
|
-
|
789
|
+
throw :response, result
|
770
790
|
end
|
771
791
|
rescue ::Gapic::Rest::Error => e
|
772
792
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -878,7 +898,7 @@ module Google
|
|
878
898
|
@alloy_db_admin_stub.delete_cluster request, options do |result, operation|
|
879
899
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
880
900
|
yield result, operation if block_given?
|
881
|
-
|
901
|
+
throw :response, result
|
882
902
|
end
|
883
903
|
rescue ::Gapic::Rest::Error => e
|
884
904
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -991,7 +1011,7 @@ module Google
|
|
991
1011
|
@alloy_db_admin_stub.promote_cluster request, options do |result, operation|
|
992
1012
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
993
1013
|
yield result, operation if block_given?
|
994
|
-
|
1014
|
+
throw :response, result
|
995
1015
|
end
|
996
1016
|
rescue ::Gapic::Rest::Error => e
|
997
1017
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1099,7 +1119,7 @@ module Google
|
|
1099
1119
|
@alloy_db_admin_stub.switchover_cluster request, options do |result, operation|
|
1100
1120
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1101
1121
|
yield result, operation if block_given?
|
1102
|
-
|
1122
|
+
throw :response, result
|
1103
1123
|
end
|
1104
1124
|
rescue ::Gapic::Rest::Error => e
|
1105
1125
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1216,7 +1236,7 @@ module Google
|
|
1216
1236
|
@alloy_db_admin_stub.restore_cluster request, options do |result, operation|
|
1217
1237
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1218
1238
|
yield result, operation if block_given?
|
1219
|
-
|
1239
|
+
throw :response, result
|
1220
1240
|
end
|
1221
1241
|
rescue ::Gapic::Rest::Error => e
|
1222
1242
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1327,7 +1347,7 @@ module Google
|
|
1327
1347
|
@alloy_db_admin_stub.create_secondary_cluster request, options do |result, operation|
|
1328
1348
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1329
1349
|
yield result, operation if block_given?
|
1330
|
-
|
1350
|
+
throw :response, result
|
1331
1351
|
end
|
1332
1352
|
rescue ::Gapic::Rest::Error => e
|
1333
1353
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1424,7 +1444,6 @@ module Google
|
|
1424
1444
|
|
1425
1445
|
@alloy_db_admin_stub.list_instances request, options do |result, operation|
|
1426
1446
|
yield result, operation if block_given?
|
1427
|
-
return result
|
1428
1447
|
end
|
1429
1448
|
rescue ::Gapic::Rest::Error => e
|
1430
1449
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1506,7 +1525,6 @@ module Google
|
|
1506
1525
|
|
1507
1526
|
@alloy_db_admin_stub.get_instance request, options do |result, operation|
|
1508
1527
|
yield result, operation if block_given?
|
1509
|
-
return result
|
1510
1528
|
end
|
1511
1529
|
rescue ::Gapic::Rest::Error => e
|
1512
1530
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1616,7 +1634,7 @@ module Google
|
|
1616
1634
|
@alloy_db_admin_stub.create_instance request, options do |result, operation|
|
1617
1635
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1618
1636
|
yield result, operation if block_given?
|
1619
|
-
|
1637
|
+
throw :response, result
|
1620
1638
|
end
|
1621
1639
|
rescue ::Gapic::Rest::Error => e
|
1622
1640
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1726,7 +1744,7 @@ module Google
|
|
1726
1744
|
@alloy_db_admin_stub.create_secondary_instance request, options do |result, operation|
|
1727
1745
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1728
1746
|
yield result, operation if block_given?
|
1729
|
-
|
1747
|
+
throw :response, result
|
1730
1748
|
end
|
1731
1749
|
rescue ::Gapic::Rest::Error => e
|
1732
1750
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1838,7 +1856,7 @@ module Google
|
|
1838
1856
|
@alloy_db_admin_stub.batch_create_instances request, options do |result, operation|
|
1839
1857
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1840
1858
|
yield result, operation if block_given?
|
1841
|
-
|
1859
|
+
throw :response, result
|
1842
1860
|
end
|
1843
1861
|
rescue ::Gapic::Rest::Error => e
|
1844
1862
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1952,7 +1970,7 @@ module Google
|
|
1952
1970
|
@alloy_db_admin_stub.update_instance request, options do |result, operation|
|
1953
1971
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1954
1972
|
yield result, operation if block_given?
|
1955
|
-
|
1973
|
+
throw :response, result
|
1956
1974
|
end
|
1957
1975
|
rescue ::Gapic::Rest::Error => e
|
1958
1976
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2062,7 +2080,7 @@ module Google
|
|
2062
2080
|
@alloy_db_admin_stub.delete_instance request, options do |result, operation|
|
2063
2081
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2064
2082
|
yield result, operation if block_given?
|
2065
|
-
|
2083
|
+
throw :response, result
|
2066
2084
|
end
|
2067
2085
|
rescue ::Gapic::Rest::Error => e
|
2068
2086
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2170,7 +2188,7 @@ module Google
|
|
2170
2188
|
@alloy_db_admin_stub.failover_instance request, options do |result, operation|
|
2171
2189
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2172
2190
|
yield result, operation if block_given?
|
2173
|
-
|
2191
|
+
throw :response, result
|
2174
2192
|
end
|
2175
2193
|
rescue ::Gapic::Rest::Error => e
|
2176
2194
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2279,7 +2297,7 @@ module Google
|
|
2279
2297
|
@alloy_db_admin_stub.inject_fault request, options do |result, operation|
|
2280
2298
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2281
2299
|
yield result, operation if block_given?
|
2282
|
-
|
2300
|
+
throw :response, result
|
2283
2301
|
end
|
2284
2302
|
rescue ::Gapic::Rest::Error => e
|
2285
2303
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2389,7 +2407,7 @@ module Google
|
|
2389
2407
|
@alloy_db_admin_stub.restart_instance request, options do |result, operation|
|
2390
2408
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2391
2409
|
yield result, operation if block_given?
|
2392
|
-
|
2410
|
+
throw :response, result
|
2393
2411
|
end
|
2394
2412
|
rescue ::Gapic::Rest::Error => e
|
2395
2413
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2482,7 +2500,6 @@ module Google
|
|
2482
2500
|
|
2483
2501
|
@alloy_db_admin_stub.execute_sql request, options do |result, operation|
|
2484
2502
|
yield result, operation if block_given?
|
2485
|
-
return result
|
2486
2503
|
end
|
2487
2504
|
rescue ::Gapic::Rest::Error => e
|
2488
2505
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2574,7 +2591,6 @@ module Google
|
|
2574
2591
|
|
2575
2592
|
@alloy_db_admin_stub.list_backups request, options do |result, operation|
|
2576
2593
|
yield result, operation if block_given?
|
2577
|
-
return result
|
2578
2594
|
end
|
2579
2595
|
rescue ::Gapic::Rest::Error => e
|
2580
2596
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2653,7 +2669,6 @@ module Google
|
|
2653
2669
|
|
2654
2670
|
@alloy_db_admin_stub.get_backup request, options do |result, operation|
|
2655
2671
|
yield result, operation if block_given?
|
2656
|
-
return result
|
2657
2672
|
end
|
2658
2673
|
rescue ::Gapic::Rest::Error => e
|
2659
2674
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2761,7 +2776,7 @@ module Google
|
|
2761
2776
|
@alloy_db_admin_stub.create_backup request, options do |result, operation|
|
2762
2777
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2763
2778
|
yield result, operation if block_given?
|
2764
|
-
|
2779
|
+
throw :response, result
|
2765
2780
|
end
|
2766
2781
|
rescue ::Gapic::Rest::Error => e
|
2767
2782
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2874,7 +2889,7 @@ module Google
|
|
2874
2889
|
@alloy_db_admin_stub.update_backup request, options do |result, operation|
|
2875
2890
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2876
2891
|
yield result, operation if block_given?
|
2877
|
-
|
2892
|
+
throw :response, result
|
2878
2893
|
end
|
2879
2894
|
rescue ::Gapic::Rest::Error => e
|
2880
2895
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2983,7 +2998,7 @@ module Google
|
|
2983
2998
|
@alloy_db_admin_stub.delete_backup request, options do |result, operation|
|
2984
2999
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2985
3000
|
yield result, operation if block_given?
|
2986
|
-
|
3001
|
+
throw :response, result
|
2987
3002
|
end
|
2988
3003
|
rescue ::Gapic::Rest::Error => e
|
2989
3004
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3078,7 +3093,7 @@ module Google
|
|
3078
3093
|
@alloy_db_admin_stub.list_supported_database_flags request, options do |result, operation|
|
3079
3094
|
result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_admin_stub, :list_supported_database_flags, "supported_database_flags", request, result, options
|
3080
3095
|
yield result, operation if block_given?
|
3081
|
-
|
3096
|
+
throw :response, result
|
3082
3097
|
end
|
3083
3098
|
rescue ::Gapic::Rest::Error => e
|
3084
3099
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3191,7 +3206,6 @@ module Google
|
|
3191
3206
|
|
3192
3207
|
@alloy_db_admin_stub.generate_client_certificate request, options do |result, operation|
|
3193
3208
|
yield result, operation if block_given?
|
3194
|
-
return result
|
3195
3209
|
end
|
3196
3210
|
rescue ::Gapic::Rest::Error => e
|
3197
3211
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3285,7 +3299,6 @@ module Google
|
|
3285
3299
|
|
3286
3300
|
@alloy_db_admin_stub.get_connection_info request, options do |result, operation|
|
3287
3301
|
yield result, operation if block_given?
|
3288
|
-
return result
|
3289
3302
|
end
|
3290
3303
|
rescue ::Gapic::Rest::Error => e
|
3291
3304
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3377,7 +3390,6 @@ module Google
|
|
3377
3390
|
|
3378
3391
|
@alloy_db_admin_stub.list_users request, options do |result, operation|
|
3379
3392
|
yield result, operation if block_given?
|
3380
|
-
return result
|
3381
3393
|
end
|
3382
3394
|
rescue ::Gapic::Rest::Error => e
|
3383
3395
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3457,7 +3469,6 @@ module Google
|
|
3457
3469
|
|
3458
3470
|
@alloy_db_admin_stub.get_user request, options do |result, operation|
|
3459
3471
|
yield result, operation if block_given?
|
3460
|
-
return result
|
3461
3472
|
end
|
3462
3473
|
rescue ::Gapic::Rest::Error => e
|
3463
3474
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3557,7 +3568,6 @@ module Google
|
|
3557
3568
|
|
3558
3569
|
@alloy_db_admin_stub.create_user request, options do |result, operation|
|
3559
3570
|
yield result, operation if block_given?
|
3560
|
-
return result
|
3561
3571
|
end
|
3562
3572
|
rescue ::Gapic::Rest::Error => e
|
3563
3573
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3661,7 +3671,6 @@ module Google
|
|
3661
3671
|
|
3662
3672
|
@alloy_db_admin_stub.update_user request, options do |result, operation|
|
3663
3673
|
yield result, operation if block_given?
|
3664
|
-
return result
|
3665
3674
|
end
|
3666
3675
|
rescue ::Gapic::Rest::Error => e
|
3667
3676
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3758,7 +3767,6 @@ module Google
|
|
3758
3767
|
|
3759
3768
|
@alloy_db_admin_stub.delete_user request, options do |result, operation|
|
3760
3769
|
yield result, operation if block_given?
|
3761
|
-
return result
|
3762
3770
|
end
|
3763
3771
|
rescue ::Gapic::Rest::Error => e
|
3764
3772
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3854,7 +3862,7 @@ module Google
|
|
3854
3862
|
@alloy_db_admin_stub.list_databases request, options do |result, operation|
|
3855
3863
|
result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_admin_stub, :list_databases, "databases", request, result, options
|
3856
3864
|
yield result, operation if block_given?
|
3857
|
-
|
3865
|
+
throw :response, result
|
3858
3866
|
end
|
3859
3867
|
rescue ::Gapic::Rest::Error => e
|
3860
3868
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3934,6 +3942,11 @@ module Google
|
|
3934
3942
|
# default endpoint URL. The default value of nil uses the environment
|
3935
3943
|
# universe (usually the default "googleapis.com" universe).
|
3936
3944
|
# @return [::String,nil]
|
3945
|
+
# @!attribute [rw] logger
|
3946
|
+
# A custom logger to use for request/response debug logging, or the value
|
3947
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
3948
|
+
# explicitly disable logging.
|
3949
|
+
# @return [::Logger,:default,nil]
|
3937
3950
|
#
|
3938
3951
|
class Configuration
|
3939
3952
|
extend ::Gapic::Config
|
@@ -3962,6 +3975,7 @@ module Google
|
|
3962
3975
|
# by the host service.
|
3963
3976
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
3964
3977
|
config_attr :bindings_override, {}, ::Hash, nil
|
3978
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
3965
3979
|
|
3966
3980
|
# @private
|
3967
3981
|
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
|
##
|