google-cloud-notebooks-v2 0.4.2 → 0.6.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/notebooks/v2/notebook_service/client.rb +46 -13
- data/lib/google/cloud/notebooks/v2/notebook_service/operations.rb +19 -15
- data/lib/google/cloud/notebooks/v2/notebook_service/rest/client.rb +45 -13
- data/lib/google/cloud/notebooks/v2/notebook_service/rest/operations.rb +50 -38
- data/lib/google/cloud/notebooks/v2/notebook_service/rest/service_stub.rb +110 -74
- data/lib/google/cloud/notebooks/v2/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/cloud/notebooks/v2/gce_setup.rb +8 -0
- data/proto_docs/google/longrunning/operations.rb +23 -14
- metadata +6 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef1e484b9ec595a0e3f50af9c211430213816f8f56eee53cb8d925b0114761dd
|
4
|
+
data.tar.gz: 4739a3ec93032dafdc4294e9e97c1e31024f169ee79b4046b83c99d00097d766
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5e19028ef90dfb00140ece4b6c99eb897962067a4dc7aca87052fed8b80e93e1a68b8df4853eb1d7d689502573c737ebdb4408f0c704ffc70811156cddc1fa4
|
7
|
+
data.tar.gz: 5de823a4cfa734d7343e9ad52b6f9da907a431333b8a7e19b880c8f63c7f50d9c8583ea0f4163142129e5c1fff09b52eff24abc95dba37a7918149ce67adec3b
|
data/README.md
CHANGED
@@ -42,40 +42,50 @@ for class and method documentation.
|
|
42
42
|
See also the [Product Documentation](https://cloud.google.com/vertex-ai/docs/workbench/instances/introduction)
|
43
43
|
for general usage information.
|
44
44
|
|
45
|
-
##
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
45
|
+
## Debug Logging
|
46
|
+
|
47
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
48
|
+
your application's integration with the API. When logging is activated, key
|
49
|
+
events such as requests and responses, along with data payloads and metadata
|
50
|
+
such as headers and client configuration, are logged to the standard error
|
51
|
+
stream.
|
52
|
+
|
53
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
54
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
55
|
+
customers, private keys, or other security data that could be compromising if
|
56
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
57
|
+
the principle of least access. Google also recommends that Client Library Debug
|
58
|
+
Logging be enabled only temporarily during active debugging, and not used
|
59
|
+
permanently in production.
|
60
|
+
|
61
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
62
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
63
|
+
list of client library gem names. This will select the default logging behavior,
|
64
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
65
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
66
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
67
|
+
results in logs appearing alongside your application logs in the
|
68
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
69
|
+
|
70
|
+
You can customize logging by modifying the `logger` configuration when
|
71
|
+
constructing a client object. For example:
|
54
72
|
|
55
73
|
```ruby
|
74
|
+
require "google/cloud/notebooks/v2"
|
56
75
|
require "logger"
|
57
76
|
|
58
|
-
|
59
|
-
|
60
|
-
def logger
|
61
|
-
LOGGER
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
66
|
-
module GRPC
|
67
|
-
extend MyLogger
|
77
|
+
client = ::Google::Cloud::Notebooks::V2::NotebookService::Client.new do |config|
|
78
|
+
config.logger = Logger.new "my-app.log"
|
68
79
|
end
|
69
80
|
```
|
70
81
|
|
71
|
-
|
72
82
|
## Google Cloud Samples
|
73
83
|
|
74
84
|
To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
|
75
85
|
|
76
86
|
## Supported Ruby Versions
|
77
87
|
|
78
|
-
This library is supported on Ruby
|
88
|
+
This library is supported on Ruby 3.0+.
|
79
89
|
|
80
90
|
Google provides official support for Ruby versions that are actively supported
|
81
91
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
@@ -189,14 +189,26 @@ module Google
|
|
189
189
|
universe_domain: @config.universe_domain,
|
190
190
|
channel_args: @config.channel_args,
|
191
191
|
interceptors: @config.interceptors,
|
192
|
-
channel_pool_config: @config.channel_pool
|
192
|
+
channel_pool_config: @config.channel_pool,
|
193
|
+
logger: @config.logger
|
193
194
|
)
|
194
195
|
|
196
|
+
@notebook_service_stub.stub_logger&.info do |entry|
|
197
|
+
entry.set_system_name
|
198
|
+
entry.set_service
|
199
|
+
entry.message = "Created client for #{entry.service}"
|
200
|
+
entry.set_credentials_fields credentials
|
201
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
202
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
203
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
204
|
+
end
|
205
|
+
|
195
206
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
196
207
|
config.credentials = credentials
|
197
208
|
config.quota_project = @quota_project_id
|
198
209
|
config.endpoint = @notebook_service_stub.endpoint
|
199
210
|
config.universe_domain = @notebook_service_stub.universe_domain
|
211
|
+
config.logger = @notebook_service_stub.logger if config.respond_to? :logger=
|
200
212
|
end
|
201
213
|
|
202
214
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
@@ -204,6 +216,7 @@ module Google
|
|
204
216
|
config.quota_project = @quota_project_id
|
205
217
|
config.endpoint = @notebook_service_stub.endpoint
|
206
218
|
config.universe_domain = @notebook_service_stub.universe_domain
|
219
|
+
config.logger = @notebook_service_stub.logger if config.respond_to? :logger=
|
207
220
|
end
|
208
221
|
end
|
209
222
|
|
@@ -228,6 +241,15 @@ module Google
|
|
228
241
|
#
|
229
242
|
attr_reader :iam_policy_client
|
230
243
|
|
244
|
+
##
|
245
|
+
# The logger used for request/response debug logging.
|
246
|
+
#
|
247
|
+
# @return [Logger]
|
248
|
+
#
|
249
|
+
def logger
|
250
|
+
@notebook_service_stub.logger
|
251
|
+
end
|
252
|
+
|
231
253
|
# Service calls
|
232
254
|
|
233
255
|
##
|
@@ -326,7 +348,7 @@ module Google
|
|
326
348
|
@notebook_service_stub.call_rpc :list_instances, request, options: options do |response, operation|
|
327
349
|
response = ::Gapic::PagedEnumerable.new @notebook_service_stub, :list_instances, request, response, operation, options
|
328
350
|
yield response, operation if block_given?
|
329
|
-
|
351
|
+
throw :response, response
|
330
352
|
end
|
331
353
|
rescue ::GRPC::BadStatus => e
|
332
354
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -413,7 +435,6 @@ module Google
|
|
413
435
|
|
414
436
|
@notebook_service_stub.call_rpc :get_instance, request, options: options do |response, operation|
|
415
437
|
yield response, operation if block_given?
|
416
|
-
return response
|
417
438
|
end
|
418
439
|
rescue ::GRPC::BadStatus => e
|
419
440
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -514,7 +535,7 @@ module Google
|
|
514
535
|
@notebook_service_stub.call_rpc :create_instance, request, options: options do |response, operation|
|
515
536
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
516
537
|
yield response, operation if block_given?
|
517
|
-
|
538
|
+
throw :response, response
|
518
539
|
end
|
519
540
|
rescue ::GRPC::BadStatus => e
|
520
541
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -612,7 +633,7 @@ module Google
|
|
612
633
|
@notebook_service_stub.call_rpc :update_instance, request, options: options do |response, operation|
|
613
634
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
614
635
|
yield response, operation if block_given?
|
615
|
-
|
636
|
+
throw :response, response
|
616
637
|
end
|
617
638
|
rescue ::GRPC::BadStatus => e
|
618
639
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -709,7 +730,7 @@ module Google
|
|
709
730
|
@notebook_service_stub.call_rpc :delete_instance, request, options: options do |response, operation|
|
710
731
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
711
732
|
yield response, operation if block_given?
|
712
|
-
|
733
|
+
throw :response, response
|
713
734
|
end
|
714
735
|
rescue ::GRPC::BadStatus => e
|
715
736
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -804,7 +825,7 @@ module Google
|
|
804
825
|
@notebook_service_stub.call_rpc :start_instance, request, options: options do |response, operation|
|
805
826
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
806
827
|
yield response, operation if block_given?
|
807
|
-
|
828
|
+
throw :response, response
|
808
829
|
end
|
809
830
|
rescue ::GRPC::BadStatus => e
|
810
831
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -899,7 +920,7 @@ module Google
|
|
899
920
|
@notebook_service_stub.call_rpc :stop_instance, request, options: options do |response, operation|
|
900
921
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
901
922
|
yield response, operation if block_given?
|
902
|
-
|
923
|
+
throw :response, response
|
903
924
|
end
|
904
925
|
rescue ::GRPC::BadStatus => e
|
905
926
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -994,7 +1015,7 @@ module Google
|
|
994
1015
|
@notebook_service_stub.call_rpc :reset_instance, request, options: options do |response, operation|
|
995
1016
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
996
1017
|
yield response, operation if block_given?
|
997
|
-
|
1018
|
+
throw :response, response
|
998
1019
|
end
|
999
1020
|
rescue ::GRPC::BadStatus => e
|
1000
1021
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1081,7 +1102,6 @@ module Google
|
|
1081
1102
|
|
1082
1103
|
@notebook_service_stub.call_rpc :check_instance_upgradability, request, options: options do |response, operation|
|
1083
1104
|
yield response, operation if block_given?
|
1084
|
-
return response
|
1085
1105
|
end
|
1086
1106
|
rescue ::GRPC::BadStatus => e
|
1087
1107
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1176,7 +1196,7 @@ module Google
|
|
1176
1196
|
@notebook_service_stub.call_rpc :upgrade_instance, request, options: options do |response, operation|
|
1177
1197
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1178
1198
|
yield response, operation if block_given?
|
1179
|
-
|
1199
|
+
throw :response, response
|
1180
1200
|
end
|
1181
1201
|
rescue ::GRPC::BadStatus => e
|
1182
1202
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1274,7 +1294,7 @@ module Google
|
|
1274
1294
|
@notebook_service_stub.call_rpc :rollback_instance, request, options: options do |response, operation|
|
1275
1295
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1276
1296
|
yield response, operation if block_given?
|
1277
|
-
|
1297
|
+
throw :response, response
|
1278
1298
|
end
|
1279
1299
|
rescue ::GRPC::BadStatus => e
|
1280
1300
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1373,7 +1393,7 @@ module Google
|
|
1373
1393
|
@notebook_service_stub.call_rpc :diagnose_instance, request, options: options do |response, operation|
|
1374
1394
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1375
1395
|
yield response, operation if block_given?
|
1376
|
-
|
1396
|
+
throw :response, response
|
1377
1397
|
end
|
1378
1398
|
rescue ::GRPC::BadStatus => e
|
1379
1399
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1423,6 +1443,13 @@ module Google
|
|
1423
1443
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
1424
1444
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
1425
1445
|
# * (`nil`) indicating no credentials
|
1446
|
+
#
|
1447
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1448
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1449
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1450
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1451
|
+
# For more information, refer to [Validate credential configurations from external
|
1452
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1426
1453
|
# @return [::Object]
|
1427
1454
|
# @!attribute [rw] scope
|
1428
1455
|
# The OAuth scopes
|
@@ -1462,6 +1489,11 @@ module Google
|
|
1462
1489
|
# default endpoint URL. The default value of nil uses the environment
|
1463
1490
|
# universe (usually the default "googleapis.com" universe).
|
1464
1491
|
# @return [::String,nil]
|
1492
|
+
# @!attribute [rw] logger
|
1493
|
+
# A custom logger to use for request/response debug logging, or the value
|
1494
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1495
|
+
# explicitly disable logging.
|
1496
|
+
# @return [::Logger,:default,nil]
|
1465
1497
|
#
|
1466
1498
|
class Configuration
|
1467
1499
|
extend ::Gapic::Config
|
@@ -1486,6 +1518,7 @@ module Google
|
|
1486
1518
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1487
1519
|
config_attr :quota_project, nil, ::String, nil
|
1488
1520
|
config_attr :universe_domain, nil, ::String, nil
|
1521
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1489
1522
|
|
1490
1523
|
# @private
|
1491
1524
|
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
|
-
|
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
|
-
|
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
|
425
|
-
# corresponding to
|
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
|
-
|
593
|
+
throw :response, response
|
603
594
|
end
|
604
595
|
rescue ::GRPC::BadStatus => e
|
605
596
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -649,6 +640,13 @@ module Google
|
|
649
640
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
650
641
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
651
642
|
# * (`nil`) indicating no credentials
|
643
|
+
#
|
644
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
645
|
+
# external source for authentication to Google Cloud, you must validate it before
|
646
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
647
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
648
|
+
# For more information, refer to [Validate credential configurations from external
|
649
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
652
650
|
# @return [::Object]
|
653
651
|
# @!attribute [rw] scope
|
654
652
|
# The OAuth scopes
|
@@ -688,6 +686,11 @@ module Google
|
|
688
686
|
# default endpoint URL. The default value of nil uses the environment
|
689
687
|
# universe (usually the default "googleapis.com" universe).
|
690
688
|
# @return [::String,nil]
|
689
|
+
# @!attribute [rw] logger
|
690
|
+
# A custom logger to use for request/response debug logging, or the value
|
691
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
692
|
+
# explicitly disable logging.
|
693
|
+
# @return [::Logger,:default,nil]
|
691
694
|
#
|
692
695
|
class Configuration
|
693
696
|
extend ::Gapic::Config
|
@@ -712,6 +715,7 @@ module Google
|
|
712
715
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
713
716
|
config_attr :quota_project, nil, ::String, nil
|
714
717
|
config_attr :universe_domain, nil, ::String, nil
|
718
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
715
719
|
|
716
720
|
# @private
|
717
721
|
def initialize parent_config = nil
|
@@ -182,15 +182,27 @@ module Google
|
|
182
182
|
endpoint: @config.endpoint,
|
183
183
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
184
184
|
universe_domain: @config.universe_domain,
|
185
|
-
credentials: credentials
|
185
|
+
credentials: credentials,
|
186
|
+
logger: @config.logger
|
186
187
|
)
|
187
188
|
|
189
|
+
@notebook_service_stub.logger(stub: true)&.info do |entry|
|
190
|
+
entry.set_system_name
|
191
|
+
entry.set_service
|
192
|
+
entry.message = "Created client for #{entry.service}"
|
193
|
+
entry.set_credentials_fields credentials
|
194
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
195
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
196
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
197
|
+
end
|
198
|
+
|
188
199
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
189
200
|
config.credentials = credentials
|
190
201
|
config.quota_project = @quota_project_id
|
191
202
|
config.endpoint = @notebook_service_stub.endpoint
|
192
203
|
config.universe_domain = @notebook_service_stub.universe_domain
|
193
204
|
config.bindings_override = @config.bindings_override
|
205
|
+
config.logger = @notebook_service_stub.logger if config.respond_to? :logger=
|
194
206
|
end
|
195
207
|
|
196
208
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
@@ -199,6 +211,7 @@ module Google
|
|
199
211
|
config.endpoint = @notebook_service_stub.endpoint
|
200
212
|
config.universe_domain = @notebook_service_stub.universe_domain
|
201
213
|
config.bindings_override = @config.bindings_override
|
214
|
+
config.logger = @notebook_service_stub.logger if config.respond_to? :logger=
|
202
215
|
end
|
203
216
|
end
|
204
217
|
|
@@ -223,6 +236,15 @@ module Google
|
|
223
236
|
#
|
224
237
|
attr_reader :iam_policy_client
|
225
238
|
|
239
|
+
##
|
240
|
+
# The logger used for request/response debug logging.
|
241
|
+
#
|
242
|
+
# @return [Logger]
|
243
|
+
#
|
244
|
+
def logger
|
245
|
+
@notebook_service_stub.logger
|
246
|
+
end
|
247
|
+
|
226
248
|
# Service calls
|
227
249
|
|
228
250
|
##
|
@@ -313,7 +335,6 @@ module Google
|
|
313
335
|
|
314
336
|
@notebook_service_stub.list_instances request, options do |result, operation|
|
315
337
|
yield result, operation if block_given?
|
316
|
-
return result
|
317
338
|
end
|
318
339
|
rescue ::Gapic::Rest::Error => e
|
319
340
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -393,7 +414,6 @@ module Google
|
|
393
414
|
|
394
415
|
@notebook_service_stub.get_instance request, options do |result, operation|
|
395
416
|
yield result, operation if block_given?
|
396
|
-
return result
|
397
417
|
end
|
398
418
|
rescue ::Gapic::Rest::Error => e
|
399
419
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -487,7 +507,7 @@ module Google
|
|
487
507
|
@notebook_service_stub.create_instance request, options do |result, operation|
|
488
508
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
489
509
|
yield result, operation if block_given?
|
490
|
-
|
510
|
+
throw :response, result
|
491
511
|
end
|
492
512
|
rescue ::Gapic::Rest::Error => e
|
493
513
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -578,7 +598,7 @@ module Google
|
|
578
598
|
@notebook_service_stub.update_instance request, options do |result, operation|
|
579
599
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
580
600
|
yield result, operation if block_given?
|
581
|
-
|
601
|
+
throw :response, result
|
582
602
|
end
|
583
603
|
rescue ::Gapic::Rest::Error => e
|
584
604
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -668,7 +688,7 @@ module Google
|
|
668
688
|
@notebook_service_stub.delete_instance request, options do |result, operation|
|
669
689
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
670
690
|
yield result, operation if block_given?
|
671
|
-
|
691
|
+
throw :response, result
|
672
692
|
end
|
673
693
|
rescue ::Gapic::Rest::Error => e
|
674
694
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -756,7 +776,7 @@ module Google
|
|
756
776
|
@notebook_service_stub.start_instance request, options do |result, operation|
|
757
777
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
758
778
|
yield result, operation if block_given?
|
759
|
-
|
779
|
+
throw :response, result
|
760
780
|
end
|
761
781
|
rescue ::Gapic::Rest::Error => e
|
762
782
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -844,7 +864,7 @@ module Google
|
|
844
864
|
@notebook_service_stub.stop_instance request, options do |result, operation|
|
845
865
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
846
866
|
yield result, operation if block_given?
|
847
|
-
|
867
|
+
throw :response, result
|
848
868
|
end
|
849
869
|
rescue ::Gapic::Rest::Error => e
|
850
870
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -932,7 +952,7 @@ module Google
|
|
932
952
|
@notebook_service_stub.reset_instance request, options do |result, operation|
|
933
953
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
934
954
|
yield result, operation if block_given?
|
935
|
-
|
955
|
+
throw :response, result
|
936
956
|
end
|
937
957
|
rescue ::Gapic::Rest::Error => e
|
938
958
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1012,7 +1032,6 @@ module Google
|
|
1012
1032
|
|
1013
1033
|
@notebook_service_stub.check_instance_upgradability request, options do |result, operation|
|
1014
1034
|
yield result, operation if block_given?
|
1015
|
-
return result
|
1016
1035
|
end
|
1017
1036
|
rescue ::Gapic::Rest::Error => e
|
1018
1037
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1100,7 +1119,7 @@ module Google
|
|
1100
1119
|
@notebook_service_stub.upgrade_instance request, options do |result, operation|
|
1101
1120
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1102
1121
|
yield result, operation if block_given?
|
1103
|
-
|
1122
|
+
throw :response, result
|
1104
1123
|
end
|
1105
1124
|
rescue ::Gapic::Rest::Error => e
|
1106
1125
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1191,7 +1210,7 @@ module Google
|
|
1191
1210
|
@notebook_service_stub.rollback_instance request, options do |result, operation|
|
1192
1211
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1193
1212
|
yield result, operation if block_given?
|
1194
|
-
|
1213
|
+
throw :response, result
|
1195
1214
|
end
|
1196
1215
|
rescue ::Gapic::Rest::Error => e
|
1197
1216
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1283,7 +1302,7 @@ module Google
|
|
1283
1302
|
@notebook_service_stub.diagnose_instance request, options do |result, operation|
|
1284
1303
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1285
1304
|
yield result, operation if block_given?
|
1286
|
-
|
1305
|
+
throw :response, result
|
1287
1306
|
end
|
1288
1307
|
rescue ::Gapic::Rest::Error => e
|
1289
1308
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1331,6 +1350,13 @@ module Google
|
|
1331
1350
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1332
1351
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
1333
1352
|
# * (`nil`) indicating no credentials
|
1353
|
+
#
|
1354
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1355
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1356
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1357
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1358
|
+
# For more information, refer to [Validate credential configurations from external
|
1359
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1334
1360
|
# @return [::Object]
|
1335
1361
|
# @!attribute [rw] scope
|
1336
1362
|
# The OAuth scopes
|
@@ -1363,6 +1389,11 @@ module Google
|
|
1363
1389
|
# default endpoint URL. The default value of nil uses the environment
|
1364
1390
|
# universe (usually the default "googleapis.com" universe).
|
1365
1391
|
# @return [::String,nil]
|
1392
|
+
# @!attribute [rw] logger
|
1393
|
+
# A custom logger to use for request/response debug logging, or the value
|
1394
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1395
|
+
# explicitly disable logging.
|
1396
|
+
# @return [::Logger,:default,nil]
|
1366
1397
|
#
|
1367
1398
|
class Configuration
|
1368
1399
|
extend ::Gapic::Config
|
@@ -1391,6 +1422,7 @@ module Google
|
|
1391
1422
|
# by the host service.
|
1392
1423
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
1393
1424
|
config_attr :bindings_override, {}, ::Hash, nil
|
1425
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1394
1426
|
|
1395
1427
|
# @private
|
1396
1428
|
def initialize parent_config = nil
|