google-cloud-bare_metal_solution-v2 0.8.1 → 0.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09b55e8acafbcf64a65f479610b56582b774b2ae2e69a8bc41e665f07bace913'
4
- data.tar.gz: a4e4476f403a8c7afb9bac113fbec2961e0d6db3503dad2c0301aaf4ed9cce45
3
+ metadata.gz: a890ccd7da5fbd131017305e097324e2f1d38bdb88cadb216d82c50cd671ddcc
4
+ data.tar.gz: 14b6786d179b60850fd29f954ed76b1c747e64f5fb99518c3377f5ac22646c2d
5
5
  SHA512:
6
- metadata.gz: e6632cc7912b1649f8daab045abfa6c61e8acc2dfcf14d0bc7e56c67f1279f513a19bd8ff7a0a083996927438102c7594622a3c16ebbc039c0650a331bc0b493
7
- data.tar.gz: 7ae7b16bdcf8d31dbc7a73020638c516dc16b11e59f3f02f1763a63ab79a79f482b466585a81379874ceb7fbabdfa2d0e887cc5148212fb344318d0206fa43ce
6
+ metadata.gz: b63ff6d8b77b5ee6bc606fa9e72d9cc1b264089c4d97e4747b5d6e7ee2ae3dc29f3acb5dedb4fb029d2b8731ffeae22631a4e38fe7ba9b86de0d176f5fd33503
7
+ data.tar.gz: 5c2b8e3e7378601c46eeed683215e150a4a31e7d9f511d2801ab0b9ce0aeac6e542c4623012dcebe8f5d7444a5ecc0e10c1b814e9a0dc6d959aa5f45600bc844
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/bare-metal/)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
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:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/bare_metal_solution/v2"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -175,14 +175,26 @@ module Google
175
175
  universe_domain: @config.universe_domain,
176
176
  channel_args: @config.channel_args,
177
177
  interceptors: @config.interceptors,
178
- channel_pool_config: @config.channel_pool
178
+ channel_pool_config: @config.channel_pool,
179
+ logger: @config.logger
179
180
  )
180
181
 
182
+ @bare_metal_solution_stub.stub_logger&.info do |entry|
183
+ entry.set_system_name
184
+ entry.set_service
185
+ entry.message = "Created client for #{entry.service}"
186
+ entry.set_credentials_fields credentials
187
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
188
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
189
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
190
+ end
191
+
181
192
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
182
193
  config.credentials = credentials
183
194
  config.quota_project = @quota_project_id
184
195
  config.endpoint = @bare_metal_solution_stub.endpoint
185
196
  config.universe_domain = @bare_metal_solution_stub.universe_domain
197
+ config.logger = @bare_metal_solution_stub.logger if config.respond_to? :logger=
186
198
  end
187
199
 
188
200
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
@@ -190,6 +202,7 @@ module Google
190
202
  config.quota_project = @quota_project_id
191
203
  config.endpoint = @bare_metal_solution_stub.endpoint
192
204
  config.universe_domain = @bare_metal_solution_stub.universe_domain
205
+ config.logger = @bare_metal_solution_stub.logger if config.respond_to? :logger=
193
206
  end
194
207
  end
195
208
 
@@ -214,6 +227,15 @@ module Google
214
227
  #
215
228
  attr_reader :iam_policy_client
216
229
 
230
+ ##
231
+ # The logger used for request/response debug logging.
232
+ #
233
+ # @return [Logger]
234
+ #
235
+ def logger
236
+ @bare_metal_solution_stub.logger
237
+ end
238
+
217
239
  # Service calls
218
240
 
219
241
  ##
@@ -308,7 +330,7 @@ module Google
308
330
  @bare_metal_solution_stub.call_rpc :list_instances, request, options: options do |response, operation|
309
331
  response = ::Gapic::PagedEnumerable.new @bare_metal_solution_stub, :list_instances, request, response, operation, options
310
332
  yield response, operation if block_given?
311
- return response
333
+ throw :response, response
312
334
  end
313
335
  rescue ::GRPC::BadStatus => e
314
336
  raise ::Google::Cloud::Error.from_error(e)
@@ -394,7 +416,6 @@ module Google
394
416
 
395
417
  @bare_metal_solution_stub.call_rpc :get_instance, request, options: options do |response, operation|
396
418
  yield response, operation if block_given?
397
- return response
398
419
  end
399
420
  rescue ::GRPC::BadStatus => e
400
421
  raise ::Google::Cloud::Error.from_error(e)
@@ -497,7 +518,7 @@ module Google
497
518
  @bare_metal_solution_stub.call_rpc :update_instance, request, options: options do |response, operation|
498
519
  response = ::Gapic::Operation.new response, @operations_client, options: options
499
520
  yield response, operation if block_given?
500
- return response
521
+ throw :response, response
501
522
  end
502
523
  rescue ::GRPC::BadStatus => e
503
524
  raise ::Google::Cloud::Error.from_error(e)
@@ -587,7 +608,6 @@ module Google
587
608
 
588
609
  @bare_metal_solution_stub.call_rpc :rename_instance, request, options: options do |response, operation|
589
610
  yield response, operation if block_given?
590
- return response
591
611
  end
592
612
  rescue ::GRPC::BadStatus => e
593
613
  raise ::Google::Cloud::Error.from_error(e)
@@ -682,7 +702,7 @@ module Google
682
702
  @bare_metal_solution_stub.call_rpc :reset_instance, request, options: options do |response, operation|
683
703
  response = ::Gapic::Operation.new response, @operations_client, options: options
684
704
  yield response, operation if block_given?
685
- return response
705
+ throw :response, response
686
706
  end
687
707
  rescue ::GRPC::BadStatus => e
688
708
  raise ::Google::Cloud::Error.from_error(e)
@@ -776,7 +796,7 @@ module Google
776
796
  @bare_metal_solution_stub.call_rpc :start_instance, request, options: options do |response, operation|
777
797
  response = ::Gapic::Operation.new response, @operations_client, options: options
778
798
  yield response, operation if block_given?
779
- return response
799
+ throw :response, response
780
800
  end
781
801
  rescue ::GRPC::BadStatus => e
782
802
  raise ::Google::Cloud::Error.from_error(e)
@@ -870,7 +890,7 @@ module Google
870
890
  @bare_metal_solution_stub.call_rpc :stop_instance, request, options: options do |response, operation|
871
891
  response = ::Gapic::Operation.new response, @operations_client, options: options
872
892
  yield response, operation if block_given?
873
- return response
893
+ throw :response, response
874
894
  end
875
895
  rescue ::GRPC::BadStatus => e
876
896
  raise ::Google::Cloud::Error.from_error(e)
@@ -964,7 +984,7 @@ module Google
964
984
  @bare_metal_solution_stub.call_rpc :enable_interactive_serial_console, request, options: options do |response, operation|
965
985
  response = ::Gapic::Operation.new response, @operations_client, options: options
966
986
  yield response, operation if block_given?
967
- return response
987
+ throw :response, response
968
988
  end
969
989
  rescue ::GRPC::BadStatus => e
970
990
  raise ::Google::Cloud::Error.from_error(e)
@@ -1058,7 +1078,7 @@ module Google
1058
1078
  @bare_metal_solution_stub.call_rpc :disable_interactive_serial_console, request, options: options do |response, operation|
1059
1079
  response = ::Gapic::Operation.new response, @operations_client, options: options
1060
1080
  yield response, operation if block_given?
1061
- return response
1081
+ throw :response, response
1062
1082
  end
1063
1083
  rescue ::GRPC::BadStatus => e
1064
1084
  raise ::Google::Cloud::Error.from_error(e)
@@ -1156,7 +1176,7 @@ module Google
1156
1176
  @bare_metal_solution_stub.call_rpc :detach_lun, request, options: options do |response, operation|
1157
1177
  response = ::Gapic::Operation.new response, @operations_client, options: options
1158
1178
  yield response, operation if block_given?
1159
- return response
1179
+ throw :response, response
1160
1180
  end
1161
1181
  rescue ::GRPC::BadStatus => e
1162
1182
  raise ::Google::Cloud::Error.from_error(e)
@@ -1253,7 +1273,7 @@ module Google
1253
1273
  @bare_metal_solution_stub.call_rpc :list_ssh_keys, request, options: options do |response, operation|
1254
1274
  response = ::Gapic::PagedEnumerable.new @bare_metal_solution_stub, :list_ssh_keys, request, response, operation, options
1255
1275
  yield response, operation if block_given?
1256
- return response
1276
+ throw :response, response
1257
1277
  end
1258
1278
  rescue ::GRPC::BadStatus => e
1259
1279
  raise ::Google::Cloud::Error.from_error(e)
@@ -1348,7 +1368,6 @@ module Google
1348
1368
 
1349
1369
  @bare_metal_solution_stub.call_rpc :create_ssh_key, request, options: options do |response, operation|
1350
1370
  yield response, operation if block_given?
1351
- return response
1352
1371
  end
1353
1372
  rescue ::GRPC::BadStatus => e
1354
1373
  raise ::Google::Cloud::Error.from_error(e)
@@ -1435,7 +1454,6 @@ module Google
1435
1454
 
1436
1455
  @bare_metal_solution_stub.call_rpc :delete_ssh_key, request, options: options do |response, operation|
1437
1456
  yield response, operation if block_given?
1438
- return response
1439
1457
  end
1440
1458
  rescue ::GRPC::BadStatus => e
1441
1459
  raise ::Google::Cloud::Error.from_error(e)
@@ -1533,7 +1551,7 @@ module Google
1533
1551
  @bare_metal_solution_stub.call_rpc :list_volumes, request, options: options do |response, operation|
1534
1552
  response = ::Gapic::PagedEnumerable.new @bare_metal_solution_stub, :list_volumes, request, response, operation, options
1535
1553
  yield response, operation if block_given?
1536
- return response
1554
+ throw :response, response
1537
1555
  end
1538
1556
  rescue ::GRPC::BadStatus => e
1539
1557
  raise ::Google::Cloud::Error.from_error(e)
@@ -1619,7 +1637,6 @@ module Google
1619
1637
 
1620
1638
  @bare_metal_solution_stub.call_rpc :get_volume, request, options: options do |response, operation|
1621
1639
  yield response, operation if block_given?
1622
- return response
1623
1640
  end
1624
1641
  rescue ::GRPC::BadStatus => e
1625
1642
  raise ::Google::Cloud::Error.from_error(e)
@@ -1720,7 +1737,7 @@ module Google
1720
1737
  @bare_metal_solution_stub.call_rpc :update_volume, request, options: options do |response, operation|
1721
1738
  response = ::Gapic::Operation.new response, @operations_client, options: options
1722
1739
  yield response, operation if block_given?
1723
- return response
1740
+ throw :response, response
1724
1741
  end
1725
1742
  rescue ::GRPC::BadStatus => e
1726
1743
  raise ::Google::Cloud::Error.from_error(e)
@@ -1810,7 +1827,6 @@ module Google
1810
1827
 
1811
1828
  @bare_metal_solution_stub.call_rpc :rename_volume, request, options: options do |response, operation|
1812
1829
  yield response, operation if block_given?
1813
- return response
1814
1830
  end
1815
1831
  rescue ::GRPC::BadStatus => e
1816
1832
  raise ::Google::Cloud::Error.from_error(e)
@@ -1905,7 +1921,7 @@ module Google
1905
1921
  @bare_metal_solution_stub.call_rpc :evict_volume, request, options: options do |response, operation|
1906
1922
  response = ::Gapic::Operation.new response, @operations_client, options: options
1907
1923
  yield response, operation if block_given?
1908
- return response
1924
+ throw :response, response
1909
1925
  end
1910
1926
  rescue ::GRPC::BadStatus => e
1911
1927
  raise ::Google::Cloud::Error.from_error(e)
@@ -2001,7 +2017,7 @@ module Google
2001
2017
  @bare_metal_solution_stub.call_rpc :resize_volume, request, options: options do |response, operation|
2002
2018
  response = ::Gapic::Operation.new response, @operations_client, options: options
2003
2019
  yield response, operation if block_given?
2004
- return response
2020
+ throw :response, response
2005
2021
  end
2006
2022
  rescue ::GRPC::BadStatus => e
2007
2023
  raise ::Google::Cloud::Error.from_error(e)
@@ -2099,7 +2115,7 @@ module Google
2099
2115
  @bare_metal_solution_stub.call_rpc :list_networks, request, options: options do |response, operation|
2100
2116
  response = ::Gapic::PagedEnumerable.new @bare_metal_solution_stub, :list_networks, request, response, operation, options
2101
2117
  yield response, operation if block_given?
2102
- return response
2118
+ throw :response, response
2103
2119
  end
2104
2120
  rescue ::GRPC::BadStatus => e
2105
2121
  raise ::Google::Cloud::Error.from_error(e)
@@ -2186,7 +2202,6 @@ module Google
2186
2202
 
2187
2203
  @bare_metal_solution_stub.call_rpc :list_network_usage, request, options: options do |response, operation|
2188
2204
  yield response, operation if block_given?
2189
- return response
2190
2205
  end
2191
2206
  rescue ::GRPC::BadStatus => e
2192
2207
  raise ::Google::Cloud::Error.from_error(e)
@@ -2272,7 +2287,6 @@ module Google
2272
2287
 
2273
2288
  @bare_metal_solution_stub.call_rpc :get_network, request, options: options do |response, operation|
2274
2289
  yield response, operation if block_given?
2275
- return response
2276
2290
  end
2277
2291
  rescue ::GRPC::BadStatus => e
2278
2292
  raise ::Google::Cloud::Error.from_error(e)
@@ -2373,7 +2387,7 @@ module Google
2373
2387
  @bare_metal_solution_stub.call_rpc :update_network, request, options: options do |response, operation|
2374
2388
  response = ::Gapic::Operation.new response, @operations_client, options: options
2375
2389
  yield response, operation if block_given?
2376
- return response
2390
+ throw :response, response
2377
2391
  end
2378
2392
  rescue ::GRPC::BadStatus => e
2379
2393
  raise ::Google::Cloud::Error.from_error(e)
@@ -2462,7 +2476,6 @@ module Google
2462
2476
 
2463
2477
  @bare_metal_solution_stub.call_rpc :create_volume_snapshot, request, options: options do |response, operation|
2464
2478
  yield response, operation if block_given?
2465
- return response
2466
2479
  end
2467
2480
  rescue ::GRPC::BadStatus => e
2468
2481
  raise ::Google::Cloud::Error.from_error(e)
@@ -2558,7 +2571,7 @@ module Google
2558
2571
  @bare_metal_solution_stub.call_rpc :restore_volume_snapshot, request, options: options do |response, operation|
2559
2572
  response = ::Gapic::Operation.new response, @operations_client, options: options
2560
2573
  yield response, operation if block_given?
2561
- return response
2574
+ throw :response, response
2562
2575
  end
2563
2576
  rescue ::GRPC::BadStatus => e
2564
2577
  raise ::Google::Cloud::Error.from_error(e)
@@ -2645,7 +2658,6 @@ module Google
2645
2658
 
2646
2659
  @bare_metal_solution_stub.call_rpc :delete_volume_snapshot, request, options: options do |response, operation|
2647
2660
  yield response, operation if block_given?
2648
- return response
2649
2661
  end
2650
2662
  rescue ::GRPC::BadStatus => e
2651
2663
  raise ::Google::Cloud::Error.from_error(e)
@@ -2732,7 +2744,6 @@ module Google
2732
2744
 
2733
2745
  @bare_metal_solution_stub.call_rpc :get_volume_snapshot, request, options: options do |response, operation|
2734
2746
  yield response, operation if block_given?
2735
- return response
2736
2747
  end
2737
2748
  rescue ::GRPC::BadStatus => e
2738
2749
  raise ::Google::Cloud::Error.from_error(e)
@@ -2830,7 +2841,7 @@ module Google
2830
2841
  @bare_metal_solution_stub.call_rpc :list_volume_snapshots, request, options: options do |response, operation|
2831
2842
  response = ::Gapic::PagedEnumerable.new @bare_metal_solution_stub, :list_volume_snapshots, request, response, operation, options
2832
2843
  yield response, operation if block_given?
2833
- return response
2844
+ throw :response, response
2834
2845
  end
2835
2846
  rescue ::GRPC::BadStatus => e
2836
2847
  raise ::Google::Cloud::Error.from_error(e)
@@ -2916,7 +2927,6 @@ module Google
2916
2927
 
2917
2928
  @bare_metal_solution_stub.call_rpc :get_lun, request, options: options do |response, operation|
2918
2929
  yield response, operation if block_given?
2919
- return response
2920
2930
  end
2921
2931
  rescue ::GRPC::BadStatus => e
2922
2932
  raise ::Google::Cloud::Error.from_error(e)
@@ -3012,7 +3022,7 @@ module Google
3012
3022
  @bare_metal_solution_stub.call_rpc :list_luns, request, options: options do |response, operation|
3013
3023
  response = ::Gapic::PagedEnumerable.new @bare_metal_solution_stub, :list_luns, request, response, operation, options
3014
3024
  yield response, operation if block_given?
3015
- return response
3025
+ throw :response, response
3016
3026
  end
3017
3027
  rescue ::GRPC::BadStatus => e
3018
3028
  raise ::Google::Cloud::Error.from_error(e)
@@ -3107,7 +3117,7 @@ module Google
3107
3117
  @bare_metal_solution_stub.call_rpc :evict_lun, request, options: options do |response, operation|
3108
3118
  response = ::Gapic::Operation.new response, @operations_client, options: options
3109
3119
  yield response, operation if block_given?
3110
- return response
3120
+ throw :response, response
3111
3121
  end
3112
3122
  rescue ::GRPC::BadStatus => e
3113
3123
  raise ::Google::Cloud::Error.from_error(e)
@@ -3193,7 +3203,6 @@ module Google
3193
3203
 
3194
3204
  @bare_metal_solution_stub.call_rpc :get_nfs_share, request, options: options do |response, operation|
3195
3205
  yield response, operation if block_given?
3196
- return response
3197
3206
  end
3198
3207
  rescue ::GRPC::BadStatus => e
3199
3208
  raise ::Google::Cloud::Error.from_error(e)
@@ -3291,7 +3300,7 @@ module Google
3291
3300
  @bare_metal_solution_stub.call_rpc :list_nfs_shares, request, options: options do |response, operation|
3292
3301
  response = ::Gapic::PagedEnumerable.new @bare_metal_solution_stub, :list_nfs_shares, request, response, operation, options
3293
3302
  yield response, operation if block_given?
3294
- return response
3303
+ throw :response, response
3295
3304
  end
3296
3305
  rescue ::GRPC::BadStatus => e
3297
3306
  raise ::Google::Cloud::Error.from_error(e)
@@ -3393,7 +3402,7 @@ module Google
3393
3402
  @bare_metal_solution_stub.call_rpc :update_nfs_share, request, options: options do |response, operation|
3394
3403
  response = ::Gapic::Operation.new response, @operations_client, options: options
3395
3404
  yield response, operation if block_given?
3396
- return response
3405
+ throw :response, response
3397
3406
  end
3398
3407
  rescue ::GRPC::BadStatus => e
3399
3408
  raise ::Google::Cloud::Error.from_error(e)
@@ -3489,7 +3498,7 @@ module Google
3489
3498
  @bare_metal_solution_stub.call_rpc :create_nfs_share, request, options: options do |response, operation|
3490
3499
  response = ::Gapic::Operation.new response, @operations_client, options: options
3491
3500
  yield response, operation if block_given?
3492
- return response
3501
+ throw :response, response
3493
3502
  end
3494
3503
  rescue ::GRPC::BadStatus => e
3495
3504
  raise ::Google::Cloud::Error.from_error(e)
@@ -3579,7 +3588,6 @@ module Google
3579
3588
 
3580
3589
  @bare_metal_solution_stub.call_rpc :rename_nfs_share, request, options: options do |response, operation|
3581
3590
  yield response, operation if block_given?
3582
- return response
3583
3591
  end
3584
3592
  rescue ::GRPC::BadStatus => e
3585
3593
  raise ::Google::Cloud::Error.from_error(e)
@@ -3673,7 +3681,7 @@ module Google
3673
3681
  @bare_metal_solution_stub.call_rpc :delete_nfs_share, request, options: options do |response, operation|
3674
3682
  response = ::Gapic::Operation.new response, @operations_client, options: options
3675
3683
  yield response, operation if block_given?
3676
- return response
3684
+ throw :response, response
3677
3685
  end
3678
3686
  rescue ::GRPC::BadStatus => e
3679
3687
  raise ::Google::Cloud::Error.from_error(e)
@@ -3771,7 +3779,7 @@ module Google
3771
3779
  @bare_metal_solution_stub.call_rpc :list_provisioning_quotas, request, options: options do |response, operation|
3772
3780
  response = ::Gapic::PagedEnumerable.new @bare_metal_solution_stub, :list_provisioning_quotas, request, response, operation, options
3773
3781
  yield response, operation if block_given?
3774
- return response
3782
+ throw :response, response
3775
3783
  end
3776
3784
  rescue ::GRPC::BadStatus => e
3777
3785
  raise ::Google::Cloud::Error.from_error(e)
@@ -3863,7 +3871,6 @@ module Google
3863
3871
 
3864
3872
  @bare_metal_solution_stub.call_rpc :submit_provisioning_config, request, options: options do |response, operation|
3865
3873
  yield response, operation if block_given?
3866
- return response
3867
3874
  end
3868
3875
  rescue ::GRPC::BadStatus => e
3869
3876
  raise ::Google::Cloud::Error.from_error(e)
@@ -3949,7 +3956,6 @@ module Google
3949
3956
 
3950
3957
  @bare_metal_solution_stub.call_rpc :get_provisioning_config, request, options: options do |response, operation|
3951
3958
  yield response, operation if block_given?
3952
- return response
3953
3959
  end
3954
3960
  rescue ::GRPC::BadStatus => e
3955
3961
  raise ::Google::Cloud::Error.from_error(e)
@@ -4041,7 +4047,6 @@ module Google
4041
4047
 
4042
4048
  @bare_metal_solution_stub.call_rpc :create_provisioning_config, request, options: options do |response, operation|
4043
4049
  yield response, operation if block_given?
4044
- return response
4045
4050
  end
4046
4051
  rescue ::GRPC::BadStatus => e
4047
4052
  raise ::Google::Cloud::Error.from_error(e)
@@ -4132,7 +4137,6 @@ module Google
4132
4137
 
4133
4138
  @bare_metal_solution_stub.call_rpc :update_provisioning_config, request, options: options do |response, operation|
4134
4139
  yield response, operation if block_given?
4135
- return response
4136
4140
  end
4137
4141
  rescue ::GRPC::BadStatus => e
4138
4142
  raise ::Google::Cloud::Error.from_error(e)
@@ -4222,7 +4226,6 @@ module Google
4222
4226
 
4223
4227
  @bare_metal_solution_stub.call_rpc :rename_network, request, options: options do |response, operation|
4224
4228
  yield response, operation if block_given?
4225
- return response
4226
4229
  end
4227
4230
  rescue ::GRPC::BadStatus => e
4228
4231
  raise ::Google::Cloud::Error.from_error(e)
@@ -4320,7 +4323,7 @@ module Google
4320
4323
  @bare_metal_solution_stub.call_rpc :list_os_images, request, options: options do |response, operation|
4321
4324
  response = ::Gapic::PagedEnumerable.new @bare_metal_solution_stub, :list_os_images, request, response, operation, options
4322
4325
  yield response, operation if block_given?
4323
- return response
4326
+ throw :response, response
4324
4327
  end
4325
4328
  rescue ::GRPC::BadStatus => e
4326
4329
  raise ::Google::Cloud::Error.from_error(e)
@@ -4409,6 +4412,11 @@ module Google
4409
4412
  # default endpoint URL. The default value of nil uses the environment
4410
4413
  # universe (usually the default "googleapis.com" universe).
4411
4414
  # @return [::String,nil]
4415
+ # @!attribute [rw] logger
4416
+ # A custom logger to use for request/response debug logging, or the value
4417
+ # `:default` (the default) to construct a default logger, or `nil` to
4418
+ # explicitly disable logging.
4419
+ # @return [::Logger,:default,nil]
4412
4420
  #
4413
4421
  class Configuration
4414
4422
  extend ::Gapic::Config
@@ -4433,6 +4441,7 @@ module Google
4433
4441
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
4434
4442
  config_attr :quota_project, nil, ::String, nil
4435
4443
  config_attr :universe_domain, nil, ::String, nil
4444
+ config_attr :logger, :default, ::Logger, nil, :default
4436
4445
 
4437
4446
  # @private
4438
4447
  def initialize parent_config = nil
@@ -124,14 +124,6 @@ module Google
124
124
  # Lists operations that match the specified filter in the request. If the
125
125
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
126
126
  #
127
- # NOTE: the `name` binding allows API services to override the binding
128
- # to use different resource name schemes, such as `users/*/operations`. To
129
- # override the binding, API services can add a binding such as
130
- # `"/v1/{name=users/*}/operations"` to their service configuration.
131
- # For backwards compatibility, the default name includes the operations
132
- # collection id, however overriding users must ensure the name binding
133
- # is the parent resource, without the operations collection id.
134
- #
135
127
  # @overload list_operations(request, options = nil)
136
128
  # Pass arguments to `list_operations` via a request object, either of type
137
129
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -221,7 +213,7 @@ module Google
221
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
222
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
223
215
  yield response, operation if block_given?
224
- return response
216
+ throw :response, response
225
217
  end
226
218
  rescue ::GRPC::BadStatus => e
227
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -317,7 +309,7 @@ module Google
317
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
318
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
319
311
  yield response, operation if block_given?
320
- return response
312
+ throw :response, response
321
313
  end
322
314
  rescue ::GRPC::BadStatus => e
323
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -406,7 +398,6 @@ module Google
406
398
 
407
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
408
400
  yield response, operation if block_given?
409
- return response
410
401
  end
411
402
  rescue ::GRPC::BadStatus => e
412
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -421,8 +412,9 @@ module Google
421
412
  # other methods to check whether the cancellation succeeded or whether the
422
413
  # operation completed despite cancellation. On successful cancellation,
423
414
  # the operation is not deleted; instead, it becomes an operation with
424
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
425
- # corresponding to `Code.CANCELLED`.
415
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
416
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
417
+ # `Code.CANCELLED`.
426
418
  #
427
419
  # @overload cancel_operation(request, options = nil)
428
420
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -501,7 +493,6 @@ module Google
501
493
 
502
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
503
495
  yield response, operation if block_given?
504
- return response
505
496
  end
506
497
  rescue ::GRPC::BadStatus => e
507
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -599,7 +590,7 @@ module Google
599
590
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
600
591
  response = ::Gapic::Operation.new response, @operations_client, options: options
601
592
  yield response, operation if block_given?
602
- return response
593
+ throw :response, response
603
594
  end
604
595
  rescue ::GRPC::BadStatus => e
605
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -688,6 +679,11 @@ module Google
688
679
  # default endpoint URL. The default value of nil uses the environment
689
680
  # universe (usually the default "googleapis.com" universe).
690
681
  # @return [::String,nil]
682
+ # @!attribute [rw] logger
683
+ # A custom logger to use for request/response debug logging, or the value
684
+ # `:default` (the default) to construct a default logger, or `nil` to
685
+ # explicitly disable logging.
686
+ # @return [::Logger,:default,nil]
691
687
  #
692
688
  class Configuration
693
689
  extend ::Gapic::Config
@@ -712,6 +708,7 @@ module Google
712
708
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
713
709
  config_attr :quota_project, nil, ::String, nil
714
710
  config_attr :universe_domain, nil, ::String, nil
711
+ config_attr :logger, :default, ::Logger, nil, :default
715
712
 
716
713
  # @private
717
714
  def initialize parent_config = nil