google-cloud-oracle_database-v1 0.1.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4bef47254d2bcbd5d575b77a5dc47c076a56e78544d2965533b2f36061c620db
4
- data.tar.gz: a007d657046020080128b83986c596ed7110a9551f121929af54ebeea3809a44
3
+ metadata.gz: 050b52c4b0010dd073faa5e9a2ac2df909ee76528e0a1baa9a3929470694d8da
4
+ data.tar.gz: 67acf2e98dc8716b8d94700d3813c36066df447446bbb22424a43a854ba92b17
5
5
  SHA512:
6
- metadata.gz: 49473fa253df7f550909ba80880e25810b34b2f0a576b44135d3bacb348c73c197c8eb78bf73a9f3ca6db843178170f7fa5883ce35d3f4b6c016a9b3a7743705
7
- data.tar.gz: '0833cf5c8ffdeb6ff789005aadb854991b64dea3cf8ccdf58890f4cc990ddc3cb5ef732f7f4f42c4e7b4f7f01672325e51b9f08e4820d19ef203f00174019331'
6
+ metadata.gz: 1322ec3a6abef24baf880800d6741e8aac0c6e8645628d969f0a1f20ed081cfd378e865df02152e21ca7ede7e35ff5c27659ad1e52871412aba23dae4f3e8d0f
7
+ data.tar.gz: 3668ee1577f5881c05d757863a420d8201e8d00bcda64add3dd9fcf90e70cae9dc1d5a17cb43d4a7dcea07f34084c1343d93e081d9b172dca26ade027dca85dc
data/README.md CHANGED
@@ -43,6 +43,42 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/oracle/database/docs)
44
44
  for general usage information.
45
45
 
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
73
+
74
+ ```ruby
75
+ require "google/cloud/oracle_database/v1"
76
+ require "logger"
77
+
78
+ client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Rest::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
80
+ end
81
+ ```
46
82
 
47
83
  ## Google Cloud Samples
48
84
 
@@ -230,15 +230,27 @@ module Google
230
230
  endpoint: @config.endpoint,
231
231
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
232
232
  universe_domain: @config.universe_domain,
233
- credentials: credentials
233
+ credentials: credentials,
234
+ logger: @config.logger
234
235
  )
235
236
 
237
+ @oracle_database_stub.logger(stub: true)&.info do |entry|
238
+ entry.set_system_name
239
+ entry.set_service
240
+ entry.message = "Created client for #{entry.service}"
241
+ entry.set_credentials_fields credentials
242
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
243
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
244
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
245
+ end
246
+
236
247
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
237
248
  config.credentials = credentials
238
249
  config.quota_project = @quota_project_id
239
250
  config.endpoint = @oracle_database_stub.endpoint
240
251
  config.universe_domain = @oracle_database_stub.universe_domain
241
252
  config.bindings_override = @config.bindings_override
253
+ config.logger = @oracle_database_stub.logger if config.respond_to? :logger=
242
254
  end
243
255
  end
244
256
 
@@ -256,6 +268,15 @@ module Google
256
268
  #
257
269
  attr_reader :location_client
258
270
 
271
+ ##
272
+ # The logger used for request/response debug logging.
273
+ #
274
+ # @return [Logger]
275
+ #
276
+ def logger
277
+ @oracle_database_stub.logger
278
+ end
279
+
259
280
  # Service calls
260
281
 
261
282
  ##
@@ -343,7 +364,7 @@ module Google
343
364
  @oracle_database_stub.list_cloud_exadata_infrastructures request, options do |result, operation|
344
365
  result = ::Gapic::Rest::PagedEnumerable.new @oracle_database_stub, :list_cloud_exadata_infrastructures, "cloud_exadata_infrastructures", request, result, options
345
366
  yield result, operation if block_given?
346
- return result
367
+ throw :response, result
347
368
  end
348
369
  rescue ::Gapic::Rest::Error => e
349
370
  raise ::Google::Cloud::Error.from_error(e)
@@ -424,7 +445,6 @@ module Google
424
445
 
425
446
  @oracle_database_stub.get_cloud_exadata_infrastructure request, options do |result, operation|
426
447
  yield result, operation if block_given?
427
- return result
428
448
  end
429
449
  rescue ::Gapic::Rest::Error => e
430
450
  raise ::Google::Cloud::Error.from_error(e)
@@ -528,7 +548,7 @@ module Google
528
548
  @oracle_database_stub.create_cloud_exadata_infrastructure request, options do |result, operation|
529
549
  result = ::Gapic::Operation.new result, @operations_client, options: options
530
550
  yield result, operation if block_given?
531
- return result
551
+ throw :response, result
532
552
  end
533
553
  rescue ::Gapic::Rest::Error => e
534
554
  raise ::Google::Cloud::Error.from_error(e)
@@ -630,7 +650,7 @@ module Google
630
650
  @oracle_database_stub.delete_cloud_exadata_infrastructure request, options do |result, operation|
631
651
  result = ::Gapic::Operation.new result, @operations_client, options: options
632
652
  yield result, operation if block_given?
633
- return result
653
+ throw :response, result
634
654
  end
635
655
  rescue ::Gapic::Rest::Error => e
636
656
  raise ::Google::Cloud::Error.from_error(e)
@@ -723,7 +743,7 @@ module Google
723
743
  @oracle_database_stub.list_cloud_vm_clusters request, options do |result, operation|
724
744
  result = ::Gapic::Rest::PagedEnumerable.new @oracle_database_stub, :list_cloud_vm_clusters, "cloud_vm_clusters", request, result, options
725
745
  yield result, operation if block_given?
726
- return result
746
+ throw :response, result
727
747
  end
728
748
  rescue ::Gapic::Rest::Error => e
729
749
  raise ::Google::Cloud::Error.from_error(e)
@@ -803,7 +823,6 @@ module Google
803
823
 
804
824
  @oracle_database_stub.get_cloud_vm_cluster request, options do |result, operation|
805
825
  yield result, operation if block_given?
806
- return result
807
826
  end
808
827
  rescue ::Gapic::Rest::Error => e
809
828
  raise ::Google::Cloud::Error.from_error(e)
@@ -907,7 +926,7 @@ module Google
907
926
  @oracle_database_stub.create_cloud_vm_cluster request, options do |result, operation|
908
927
  result = ::Gapic::Operation.new result, @operations_client, options: options
909
928
  yield result, operation if block_given?
910
- return result
929
+ throw :response, result
911
930
  end
912
931
  rescue ::Gapic::Rest::Error => e
913
932
  raise ::Google::Cloud::Error.from_error(e)
@@ -1008,7 +1027,7 @@ module Google
1008
1027
  @oracle_database_stub.delete_cloud_vm_cluster request, options do |result, operation|
1009
1028
  result = ::Gapic::Operation.new result, @operations_client, options: options
1010
1029
  yield result, operation if block_given?
1011
- return result
1030
+ throw :response, result
1012
1031
  end
1013
1032
  rescue ::Gapic::Rest::Error => e
1014
1033
  raise ::Google::Cloud::Error.from_error(e)
@@ -1099,7 +1118,7 @@ module Google
1099
1118
  @oracle_database_stub.list_entitlements request, options do |result, operation|
1100
1119
  result = ::Gapic::Rest::PagedEnumerable.new @oracle_database_stub, :list_entitlements, "entitlements", request, result, options
1101
1120
  yield result, operation if block_given?
1102
- return result
1121
+ throw :response, result
1103
1122
  end
1104
1123
  rescue ::Gapic::Rest::Error => e
1105
1124
  raise ::Google::Cloud::Error.from_error(e)
@@ -1190,7 +1209,7 @@ module Google
1190
1209
  @oracle_database_stub.list_db_servers request, options do |result, operation|
1191
1210
  result = ::Gapic::Rest::PagedEnumerable.new @oracle_database_stub, :list_db_servers, "db_servers", request, result, options
1192
1211
  yield result, operation if block_given?
1193
- return result
1212
+ throw :response, result
1194
1213
  end
1195
1214
  rescue ::Gapic::Rest::Error => e
1196
1215
  raise ::Google::Cloud::Error.from_error(e)
@@ -1281,7 +1300,7 @@ module Google
1281
1300
  @oracle_database_stub.list_db_nodes request, options do |result, operation|
1282
1301
  result = ::Gapic::Rest::PagedEnumerable.new @oracle_database_stub, :list_db_nodes, "db_nodes", request, result, options
1283
1302
  yield result, operation if block_given?
1284
- return result
1303
+ throw :response, result
1285
1304
  end
1286
1305
  rescue ::Gapic::Rest::Error => e
1287
1306
  raise ::Google::Cloud::Error.from_error(e)
@@ -1374,7 +1393,7 @@ module Google
1374
1393
  @oracle_database_stub.list_gi_versions request, options do |result, operation|
1375
1394
  result = ::Gapic::Rest::PagedEnumerable.new @oracle_database_stub, :list_gi_versions, "gi_versions", request, result, options
1376
1395
  yield result, operation if block_given?
1377
- return result
1396
+ throw :response, result
1378
1397
  end
1379
1398
  rescue ::Gapic::Rest::Error => e
1380
1399
  raise ::Google::Cloud::Error.from_error(e)
@@ -1465,7 +1484,7 @@ module Google
1465
1484
  @oracle_database_stub.list_db_system_shapes request, options do |result, operation|
1466
1485
  result = ::Gapic::Rest::PagedEnumerable.new @oracle_database_stub, :list_db_system_shapes, "db_system_shapes", request, result, options
1467
1486
  yield result, operation if block_given?
1468
- return result
1487
+ throw :response, result
1469
1488
  end
1470
1489
  rescue ::Gapic::Rest::Error => e
1471
1490
  raise ::Google::Cloud::Error.from_error(e)
@@ -1560,7 +1579,7 @@ module Google
1560
1579
  @oracle_database_stub.list_autonomous_databases request, options do |result, operation|
1561
1580
  result = ::Gapic::Rest::PagedEnumerable.new @oracle_database_stub, :list_autonomous_databases, "autonomous_databases", request, result, options
1562
1581
  yield result, operation if block_given?
1563
- return result
1582
+ throw :response, result
1564
1583
  end
1565
1584
  rescue ::Gapic::Rest::Error => e
1566
1585
  raise ::Google::Cloud::Error.from_error(e)
@@ -1640,7 +1659,6 @@ module Google
1640
1659
 
1641
1660
  @oracle_database_stub.get_autonomous_database request, options do |result, operation|
1642
1661
  yield result, operation if block_given?
1643
- return result
1644
1662
  end
1645
1663
  rescue ::Gapic::Rest::Error => e
1646
1664
  raise ::Google::Cloud::Error.from_error(e)
@@ -1744,7 +1762,7 @@ module Google
1744
1762
  @oracle_database_stub.create_autonomous_database request, options do |result, operation|
1745
1763
  result = ::Gapic::Operation.new result, @operations_client, options: options
1746
1764
  yield result, operation if block_given?
1747
- return result
1765
+ throw :response, result
1748
1766
  end
1749
1767
  rescue ::Gapic::Rest::Error => e
1750
1768
  raise ::Google::Cloud::Error.from_error(e)
@@ -1841,7 +1859,7 @@ module Google
1841
1859
  @oracle_database_stub.delete_autonomous_database request, options do |result, operation|
1842
1860
  result = ::Gapic::Operation.new result, @operations_client, options: options
1843
1861
  yield result, operation if block_given?
1844
- return result
1862
+ throw :response, result
1845
1863
  end
1846
1864
  rescue ::Gapic::Rest::Error => e
1847
1865
  raise ::Google::Cloud::Error.from_error(e)
@@ -1931,7 +1949,7 @@ module Google
1931
1949
  @oracle_database_stub.restore_autonomous_database request, options do |result, operation|
1932
1950
  result = ::Gapic::Operation.new result, @operations_client, options: options
1933
1951
  yield result, operation if block_given?
1934
- return result
1952
+ throw :response, result
1935
1953
  end
1936
1954
  rescue ::Gapic::Rest::Error => e
1937
1955
  raise ::Google::Cloud::Error.from_error(e)
@@ -2020,7 +2038,6 @@ module Google
2020
2038
 
2021
2039
  @oracle_database_stub.generate_autonomous_database_wallet request, options do |result, operation|
2022
2040
  yield result, operation if block_given?
2023
- return result
2024
2041
  end
2025
2042
  rescue ::Gapic::Rest::Error => e
2026
2043
  raise ::Google::Cloud::Error.from_error(e)
@@ -2112,7 +2129,7 @@ module Google
2112
2129
  @oracle_database_stub.list_autonomous_db_versions request, options do |result, operation|
2113
2130
  result = ::Gapic::Rest::PagedEnumerable.new @oracle_database_stub, :list_autonomous_db_versions, "autonomous_db_versions", request, result, options
2114
2131
  yield result, operation if block_given?
2115
- return result
2132
+ throw :response, result
2116
2133
  end
2117
2134
  rescue ::Gapic::Rest::Error => e
2118
2135
  raise ::Google::Cloud::Error.from_error(e)
@@ -2208,7 +2225,7 @@ module Google
2208
2225
  @oracle_database_stub.list_autonomous_database_character_sets request, options do |result, operation|
2209
2226
  result = ::Gapic::Rest::PagedEnumerable.new @oracle_database_stub, :list_autonomous_database_character_sets, "autonomous_database_character_sets", request, result, options
2210
2227
  yield result, operation if block_given?
2211
- return result
2228
+ throw :response, result
2212
2229
  end
2213
2230
  rescue ::Gapic::Rest::Error => e
2214
2231
  raise ::Google::Cloud::Error.from_error(e)
@@ -2307,7 +2324,7 @@ module Google
2307
2324
  @oracle_database_stub.list_autonomous_database_backups request, options do |result, operation|
2308
2325
  result = ::Gapic::Rest::PagedEnumerable.new @oracle_database_stub, :list_autonomous_database_backups, "autonomous_database_backups", request, result, options
2309
2326
  yield result, operation if block_given?
2310
- return result
2327
+ throw :response, result
2311
2328
  end
2312
2329
  rescue ::Gapic::Rest::Error => e
2313
2330
  raise ::Google::Cloud::Error.from_error(e)
@@ -2387,6 +2404,11 @@ module Google
2387
2404
  # default endpoint URL. The default value of nil uses the environment
2388
2405
  # universe (usually the default "googleapis.com" universe).
2389
2406
  # @return [::String,nil]
2407
+ # @!attribute [rw] logger
2408
+ # A custom logger to use for request/response debug logging, or the value
2409
+ # `:default` (the default) to construct a default logger, or `nil` to
2410
+ # explicitly disable logging.
2411
+ # @return [::Logger,:default,nil]
2390
2412
  #
2391
2413
  class Configuration
2392
2414
  extend ::Gapic::Config
@@ -2415,6 +2437,7 @@ module Google
2415
2437
  # by the host service.
2416
2438
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
2417
2439
  config_attr :bindings_override, {}, ::Hash, nil
2440
+ config_attr :logger, :default, ::Logger, nil, :default
2418
2441
 
2419
2442
  # @private
2420
2443
  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
- return result
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
- return result
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 {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
394
- # corresponding to `Code.CANCELLED`.
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: uri,
687
- body: body || "",
688
- params: query_string_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
- yield result, operation if block_given?
695
- result
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: uri,
725
- body: body || "",
726
- params: query_string_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
- yield result, operation if block_given?
733
- result
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: uri,
763
- body: body || "",
764
- params: query_string_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
- yield result, operation if block_given?
771
- result
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: uri,
801
- body: body || "",
802
- params: query_string_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
- yield result, operation if block_given?
809
- result
811
+ catch :response do
812
+ yield result, operation if block_given?
813
+ result
814
+ end
810
815
  end
811
816
 
812
817
  ##