google-cloud-dataflow-v1beta3 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +30 -20
- data/lib/google/cloud/dataflow/v1beta3/flex_templates_service/client.rb +27 -2
- data/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/client.rb +27 -2
- data/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/service_stub.rb +22 -8
- data/lib/google/cloud/dataflow/v1beta3/jobs/client.rb +29 -8
- data/lib/google/cloud/dataflow/v1beta3/jobs/rest/client.rb +27 -7
- data/lib/google/cloud/dataflow/v1beta3/jobs/rest/service_stub.rb +62 -38
- data/lib/google/cloud/dataflow/v1beta3/messages/client.rb +28 -2
- data/lib/google/cloud/dataflow/v1beta3/messages/rest/client.rb +27 -2
- data/lib/google/cloud/dataflow/v1beta3/messages/rest/service_stub.rb +22 -8
- data/lib/google/cloud/dataflow/v1beta3/metrics/client.rb +29 -4
- data/lib/google/cloud/dataflow/v1beta3/metrics/rest/client.rb +29 -4
- data/lib/google/cloud/dataflow/v1beta3/metrics/rest/service_stub.rb +38 -20
- data/lib/google/cloud/dataflow/v1beta3/snapshots/client.rb +27 -4
- data/lib/google/cloud/dataflow/v1beta3/snapshots/rest/client.rb +27 -4
- data/lib/google/cloud/dataflow/v1beta3/snapshots/rest/service_stub.rb +38 -20
- data/lib/google/cloud/dataflow/v1beta3/templates_service/client.rb +27 -4
- data/lib/google/cloud/dataflow/v1beta3/templates_service/rest/client.rb +27 -4
- data/lib/google/cloud/dataflow/v1beta3/templates_service/rest/service_stub.rb +38 -20
- data/lib/google/cloud/dataflow/v1beta3/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- metadata +5 -5
@@ -158,8 +158,28 @@ module Google
|
|
158
158
|
universe_domain: @config.universe_domain,
|
159
159
|
channel_args: @config.channel_args,
|
160
160
|
interceptors: @config.interceptors,
|
161
|
-
channel_pool_config: @config.channel_pool
|
161
|
+
channel_pool_config: @config.channel_pool,
|
162
|
+
logger: @config.logger
|
162
163
|
)
|
164
|
+
|
165
|
+
@messages_stub.stub_logger&.info do |entry|
|
166
|
+
entry.set_system_name
|
167
|
+
entry.set_service
|
168
|
+
entry.message = "Created client for #{entry.service}"
|
169
|
+
entry.set_credentials_fields credentials
|
170
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
171
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
172
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
##
|
177
|
+
# The logger used for request/response debug logging.
|
178
|
+
#
|
179
|
+
# @return [Logger]
|
180
|
+
#
|
181
|
+
def logger
|
182
|
+
@messages_stub.logger
|
163
183
|
end
|
164
184
|
|
165
185
|
# Service calls
|
@@ -283,7 +303,7 @@ module Google
|
|
283
303
|
@messages_stub.call_rpc :list_job_messages, request, options: options do |response, operation|
|
284
304
|
response = ::Gapic::PagedEnumerable.new @messages_stub, :list_job_messages, request, response, operation, options
|
285
305
|
yield response, operation if block_given?
|
286
|
-
|
306
|
+
throw :response, response
|
287
307
|
end
|
288
308
|
rescue ::GRPC::BadStatus => e
|
289
309
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -372,6 +392,11 @@ module Google
|
|
372
392
|
# default endpoint URL. The default value of nil uses the environment
|
373
393
|
# universe (usually the default "googleapis.com" universe).
|
374
394
|
# @return [::String,nil]
|
395
|
+
# @!attribute [rw] logger
|
396
|
+
# A custom logger to use for request/response debug logging, or the value
|
397
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
398
|
+
# explicitly disable logging.
|
399
|
+
# @return [::Logger,:default,nil]
|
375
400
|
#
|
376
401
|
class Configuration
|
377
402
|
extend ::Gapic::Config
|
@@ -396,6 +421,7 @@ module Google
|
|
396
421
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
397
422
|
config_attr :quota_project, nil, ::String, nil
|
398
423
|
config_attr :universe_domain, nil, ::String, nil
|
424
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
399
425
|
|
400
426
|
# @private
|
401
427
|
def initialize parent_config = nil
|
@@ -151,8 +151,28 @@ module Google
|
|
151
151
|
endpoint: @config.endpoint,
|
152
152
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
153
153
|
universe_domain: @config.universe_domain,
|
154
|
-
credentials: credentials
|
154
|
+
credentials: credentials,
|
155
|
+
logger: @config.logger
|
155
156
|
)
|
157
|
+
|
158
|
+
@messages_stub.logger(stub: true)&.info do |entry|
|
159
|
+
entry.set_system_name
|
160
|
+
entry.set_service
|
161
|
+
entry.message = "Created client for #{entry.service}"
|
162
|
+
entry.set_credentials_fields credentials
|
163
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
164
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
165
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
##
|
170
|
+
# The logger used for request/response debug logging.
|
171
|
+
#
|
172
|
+
# @return [Logger]
|
173
|
+
#
|
174
|
+
def logger
|
175
|
+
@messages_stub.logger
|
156
176
|
end
|
157
177
|
|
158
178
|
# Service calls
|
@@ -262,7 +282,6 @@ module Google
|
|
262
282
|
|
263
283
|
@messages_stub.list_job_messages request, options do |result, operation|
|
264
284
|
yield result, operation if block_given?
|
265
|
-
return result
|
266
285
|
end
|
267
286
|
rescue ::Gapic::Rest::Error => e
|
268
287
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -342,6 +361,11 @@ module Google
|
|
342
361
|
# default endpoint URL. The default value of nil uses the environment
|
343
362
|
# universe (usually the default "googleapis.com" universe).
|
344
363
|
# @return [::String,nil]
|
364
|
+
# @!attribute [rw] logger
|
365
|
+
# A custom logger to use for request/response debug logging, or the value
|
366
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
367
|
+
# explicitly disable logging.
|
368
|
+
# @return [::Logger,:default,nil]
|
345
369
|
#
|
346
370
|
class Configuration
|
347
371
|
extend ::Gapic::Config
|
@@ -363,6 +387,7 @@ module Google
|
|
363
387
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
364
388
|
config_attr :quota_project, nil, ::String, nil
|
365
389
|
config_attr :universe_domain, nil, ::String, nil
|
390
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
366
391
|
|
367
392
|
# @private
|
368
393
|
def initialize parent_config = nil
|
@@ -30,7 +30,8 @@ module Google
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
31
31
|
#
|
32
32
|
class ServiceStub
|
33
|
-
|
33
|
+
# @private
|
34
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
|
34
35
|
# These require statements are intentionally placed here to initialize
|
35
36
|
# the REST modules only when it's required.
|
36
37
|
require "gapic/rest"
|
@@ -40,7 +41,9 @@ module Google
|
|
40
41
|
universe_domain: universe_domain,
|
41
42
|
credentials: credentials,
|
42
43
|
numeric_enums: true,
|
43
|
-
|
44
|
+
service_name: self.class,
|
45
|
+
raise_faraday_errors: false,
|
46
|
+
logger: logger
|
44
47
|
end
|
45
48
|
|
46
49
|
##
|
@@ -61,6 +64,15 @@ module Google
|
|
61
64
|
@client_stub.endpoint
|
62
65
|
end
|
63
66
|
|
67
|
+
##
|
68
|
+
# The logger used for request/response debug logging.
|
69
|
+
#
|
70
|
+
# @return [Logger]
|
71
|
+
#
|
72
|
+
def logger stub: false
|
73
|
+
stub ? @client_stub.stub_logger : @client_stub.logger
|
74
|
+
end
|
75
|
+
|
64
76
|
##
|
65
77
|
# Baseline implementation for the list_job_messages REST call
|
66
78
|
#
|
@@ -87,16 +99,18 @@ module Google
|
|
87
99
|
|
88
100
|
response = @client_stub.make_http_request(
|
89
101
|
verb,
|
90
|
-
uri:
|
91
|
-
body:
|
92
|
-
params:
|
102
|
+
uri: uri,
|
103
|
+
body: body || "",
|
104
|
+
params: query_string_params,
|
105
|
+
method_name: "list_job_messages",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::Dataflow::V1beta3::ListJobMessagesResponse.decode_json response.body, ignore_unknown_fields: true
|
97
|
-
|
98
|
-
|
99
|
-
|
110
|
+
catch :response do
|
111
|
+
yield result, operation if block_given?
|
112
|
+
result
|
113
|
+
end
|
100
114
|
end
|
101
115
|
|
102
116
|
##
|
@@ -158,8 +158,28 @@ module Google
|
|
158
158
|
universe_domain: @config.universe_domain,
|
159
159
|
channel_args: @config.channel_args,
|
160
160
|
interceptors: @config.interceptors,
|
161
|
-
channel_pool_config: @config.channel_pool
|
161
|
+
channel_pool_config: @config.channel_pool,
|
162
|
+
logger: @config.logger
|
162
163
|
)
|
164
|
+
|
165
|
+
@metrics_stub.stub_logger&.info do |entry|
|
166
|
+
entry.set_system_name
|
167
|
+
entry.set_service
|
168
|
+
entry.message = "Created client for #{entry.service}"
|
169
|
+
entry.set_credentials_fields credentials
|
170
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
171
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
172
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
##
|
177
|
+
# The logger used for request/response debug logging.
|
178
|
+
#
|
179
|
+
# @return [Logger]
|
180
|
+
#
|
181
|
+
def logger
|
182
|
+
@metrics_stub.logger
|
163
183
|
end
|
164
184
|
|
165
185
|
# Service calls
|
@@ -265,7 +285,6 @@ module Google
|
|
265
285
|
|
266
286
|
@metrics_stub.call_rpc :get_job_metrics, request, options: options do |response, operation|
|
267
287
|
yield response, operation if block_given?
|
268
|
-
return response
|
269
288
|
end
|
270
289
|
rescue ::GRPC::BadStatus => e
|
271
290
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -378,7 +397,7 @@ module Google
|
|
378
397
|
@metrics_stub.call_rpc :get_job_execution_details, request, options: options do |response, operation|
|
379
398
|
response = ::Gapic::PagedEnumerable.new @metrics_stub, :get_job_execution_details, request, response, operation, options
|
380
399
|
yield response, operation if block_given?
|
381
|
-
|
400
|
+
throw :response, response
|
382
401
|
end
|
383
402
|
rescue ::GRPC::BadStatus => e
|
384
403
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -501,7 +520,7 @@ module Google
|
|
501
520
|
@metrics_stub.call_rpc :get_stage_execution_details, request, options: options do |response, operation|
|
502
521
|
response = ::Gapic::PagedEnumerable.new @metrics_stub, :get_stage_execution_details, request, response, operation, options
|
503
522
|
yield response, operation if block_given?
|
504
|
-
|
523
|
+
throw :response, response
|
505
524
|
end
|
506
525
|
rescue ::GRPC::BadStatus => e
|
507
526
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -590,6 +609,11 @@ module Google
|
|
590
609
|
# default endpoint URL. The default value of nil uses the environment
|
591
610
|
# universe (usually the default "googleapis.com" universe).
|
592
611
|
# @return [::String,nil]
|
612
|
+
# @!attribute [rw] logger
|
613
|
+
# A custom logger to use for request/response debug logging, or the value
|
614
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
615
|
+
# explicitly disable logging.
|
616
|
+
# @return [::Logger,:default,nil]
|
593
617
|
#
|
594
618
|
class Configuration
|
595
619
|
extend ::Gapic::Config
|
@@ -614,6 +638,7 @@ module Google
|
|
614
638
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
615
639
|
config_attr :quota_project, nil, ::String, nil
|
616
640
|
config_attr :universe_domain, nil, ::String, nil
|
641
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
617
642
|
|
618
643
|
# @private
|
619
644
|
def initialize parent_config = nil
|
@@ -151,8 +151,28 @@ module Google
|
|
151
151
|
endpoint: @config.endpoint,
|
152
152
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
153
153
|
universe_domain: @config.universe_domain,
|
154
|
-
credentials: credentials
|
154
|
+
credentials: credentials,
|
155
|
+
logger: @config.logger
|
155
156
|
)
|
157
|
+
|
158
|
+
@metrics_stub.logger(stub: true)&.info do |entry|
|
159
|
+
entry.set_system_name
|
160
|
+
entry.set_service
|
161
|
+
entry.message = "Created client for #{entry.service}"
|
162
|
+
entry.set_credentials_fields credentials
|
163
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
164
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
165
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
##
|
170
|
+
# The logger used for request/response debug logging.
|
171
|
+
#
|
172
|
+
# @return [Logger]
|
173
|
+
#
|
174
|
+
def logger
|
175
|
+
@metrics_stub.logger
|
156
176
|
end
|
157
177
|
|
158
178
|
# Service calls
|
@@ -245,7 +265,6 @@ module Google
|
|
245
265
|
|
246
266
|
@metrics_stub.get_job_metrics request, options do |result, operation|
|
247
267
|
yield result, operation if block_given?
|
248
|
-
return result
|
249
268
|
end
|
250
269
|
rescue ::Gapic::Rest::Error => e
|
251
270
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -345,7 +364,7 @@ module Google
|
|
345
364
|
@metrics_stub.get_job_execution_details request, options do |result, operation|
|
346
365
|
result = ::Gapic::Rest::PagedEnumerable.new @metrics_stub, :get_job_execution_details, "stages", request, result, options
|
347
366
|
yield result, operation if block_given?
|
348
|
-
|
367
|
+
throw :response, result
|
349
368
|
end
|
350
369
|
rescue ::Gapic::Rest::Error => e
|
351
370
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -452,7 +471,7 @@ module Google
|
|
452
471
|
@metrics_stub.get_stage_execution_details request, options do |result, operation|
|
453
472
|
result = ::Gapic::Rest::PagedEnumerable.new @metrics_stub, :get_stage_execution_details, "workers", request, result, options
|
454
473
|
yield result, operation if block_given?
|
455
|
-
|
474
|
+
throw :response, result
|
456
475
|
end
|
457
476
|
rescue ::Gapic::Rest::Error => e
|
458
477
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -532,6 +551,11 @@ module Google
|
|
532
551
|
# default endpoint URL. The default value of nil uses the environment
|
533
552
|
# universe (usually the default "googleapis.com" universe).
|
534
553
|
# @return [::String,nil]
|
554
|
+
# @!attribute [rw] logger
|
555
|
+
# A custom logger to use for request/response debug logging, or the value
|
556
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
557
|
+
# explicitly disable logging.
|
558
|
+
# @return [::Logger,:default,nil]
|
535
559
|
#
|
536
560
|
class Configuration
|
537
561
|
extend ::Gapic::Config
|
@@ -553,6 +577,7 @@ module Google
|
|
553
577
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
554
578
|
config_attr :quota_project, nil, ::String, nil
|
555
579
|
config_attr :universe_domain, nil, ::String, nil
|
580
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
556
581
|
|
557
582
|
# @private
|
558
583
|
def initialize parent_config = nil
|
@@ -30,7 +30,8 @@ module Google
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
31
31
|
#
|
32
32
|
class ServiceStub
|
33
|
-
|
33
|
+
# @private
|
34
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
|
34
35
|
# These require statements are intentionally placed here to initialize
|
35
36
|
# the REST modules only when it's required.
|
36
37
|
require "gapic/rest"
|
@@ -40,7 +41,9 @@ module Google
|
|
40
41
|
universe_domain: universe_domain,
|
41
42
|
credentials: credentials,
|
42
43
|
numeric_enums: true,
|
43
|
-
|
44
|
+
service_name: self.class,
|
45
|
+
raise_faraday_errors: false,
|
46
|
+
logger: logger
|
44
47
|
end
|
45
48
|
|
46
49
|
##
|
@@ -61,6 +64,15 @@ module Google
|
|
61
64
|
@client_stub.endpoint
|
62
65
|
end
|
63
66
|
|
67
|
+
##
|
68
|
+
# The logger used for request/response debug logging.
|
69
|
+
#
|
70
|
+
# @return [Logger]
|
71
|
+
#
|
72
|
+
def logger stub: false
|
73
|
+
stub ? @client_stub.stub_logger : @client_stub.logger
|
74
|
+
end
|
75
|
+
|
64
76
|
##
|
65
77
|
# Baseline implementation for the get_job_metrics REST call
|
66
78
|
#
|
@@ -87,16 +99,18 @@ module Google
|
|
87
99
|
|
88
100
|
response = @client_stub.make_http_request(
|
89
101
|
verb,
|
90
|
-
uri:
|
91
|
-
body:
|
92
|
-
params:
|
102
|
+
uri: uri,
|
103
|
+
body: body || "",
|
104
|
+
params: query_string_params,
|
105
|
+
method_name: "get_job_metrics",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::Dataflow::V1beta3::JobMetrics.decode_json response.body, ignore_unknown_fields: true
|
97
|
-
|
98
|
-
|
99
|
-
|
110
|
+
catch :response do
|
111
|
+
yield result, operation if block_given?
|
112
|
+
result
|
113
|
+
end
|
100
114
|
end
|
101
115
|
|
102
116
|
##
|
@@ -125,16 +139,18 @@ module Google
|
|
125
139
|
|
126
140
|
response = @client_stub.make_http_request(
|
127
141
|
verb,
|
128
|
-
uri:
|
129
|
-
body:
|
130
|
-
params:
|
142
|
+
uri: uri,
|
143
|
+
body: body || "",
|
144
|
+
params: query_string_params,
|
145
|
+
method_name: "get_job_execution_details",
|
131
146
|
options: options
|
132
147
|
)
|
133
148
|
operation = ::Gapic::Rest::TransportOperation.new response
|
134
149
|
result = ::Google::Cloud::Dataflow::V1beta3::JobExecutionDetails.decode_json response.body, ignore_unknown_fields: true
|
135
|
-
|
136
|
-
|
137
|
-
|
150
|
+
catch :response do
|
151
|
+
yield result, operation if block_given?
|
152
|
+
result
|
153
|
+
end
|
138
154
|
end
|
139
155
|
|
140
156
|
##
|
@@ -163,16 +179,18 @@ module Google
|
|
163
179
|
|
164
180
|
response = @client_stub.make_http_request(
|
165
181
|
verb,
|
166
|
-
uri:
|
167
|
-
body:
|
168
|
-
params:
|
182
|
+
uri: uri,
|
183
|
+
body: body || "",
|
184
|
+
params: query_string_params,
|
185
|
+
method_name: "get_stage_execution_details",
|
169
186
|
options: options
|
170
187
|
)
|
171
188
|
operation = ::Gapic::Rest::TransportOperation.new response
|
172
189
|
result = ::Google::Cloud::Dataflow::V1beta3::StageExecutionDetails.decode_json response.body, ignore_unknown_fields: true
|
173
|
-
|
174
|
-
|
175
|
-
|
190
|
+
catch :response do
|
191
|
+
yield result, operation if block_given?
|
192
|
+
result
|
193
|
+
end
|
176
194
|
end
|
177
195
|
|
178
196
|
##
|
@@ -157,8 +157,28 @@ module Google
|
|
157
157
|
universe_domain: @config.universe_domain,
|
158
158
|
channel_args: @config.channel_args,
|
159
159
|
interceptors: @config.interceptors,
|
160
|
-
channel_pool_config: @config.channel_pool
|
160
|
+
channel_pool_config: @config.channel_pool,
|
161
|
+
logger: @config.logger
|
161
162
|
)
|
163
|
+
|
164
|
+
@snapshots_stub.stub_logger&.info do |entry|
|
165
|
+
entry.set_system_name
|
166
|
+
entry.set_service
|
167
|
+
entry.message = "Created client for #{entry.service}"
|
168
|
+
entry.set_credentials_fields credentials
|
169
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
170
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
171
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
##
|
176
|
+
# The logger used for request/response debug logging.
|
177
|
+
#
|
178
|
+
# @return [Logger]
|
179
|
+
#
|
180
|
+
def logger
|
181
|
+
@snapshots_stub.logger
|
162
182
|
end
|
163
183
|
|
164
184
|
# Service calls
|
@@ -253,7 +273,6 @@ module Google
|
|
253
273
|
|
254
274
|
@snapshots_stub.call_rpc :get_snapshot, request, options: options do |response, operation|
|
255
275
|
yield response, operation if block_given?
|
256
|
-
return response
|
257
276
|
end
|
258
277
|
rescue ::GRPC::BadStatus => e
|
259
278
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -349,7 +368,6 @@ module Google
|
|
349
368
|
|
350
369
|
@snapshots_stub.call_rpc :delete_snapshot, request, options: options do |response, operation|
|
351
370
|
yield response, operation if block_given?
|
352
|
-
return response
|
353
371
|
end
|
354
372
|
rescue ::GRPC::BadStatus => e
|
355
373
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -445,7 +463,6 @@ module Google
|
|
445
463
|
|
446
464
|
@snapshots_stub.call_rpc :list_snapshots, request, options: options do |response, operation|
|
447
465
|
yield response, operation if block_given?
|
448
|
-
return response
|
449
466
|
end
|
450
467
|
rescue ::GRPC::BadStatus => e
|
451
468
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -534,6 +551,11 @@ module Google
|
|
534
551
|
# default endpoint URL. The default value of nil uses the environment
|
535
552
|
# universe (usually the default "googleapis.com" universe).
|
536
553
|
# @return [::String,nil]
|
554
|
+
# @!attribute [rw] logger
|
555
|
+
# A custom logger to use for request/response debug logging, or the value
|
556
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
557
|
+
# explicitly disable logging.
|
558
|
+
# @return [::Logger,:default,nil]
|
537
559
|
#
|
538
560
|
class Configuration
|
539
561
|
extend ::Gapic::Config
|
@@ -558,6 +580,7 @@ module Google
|
|
558
580
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
559
581
|
config_attr :quota_project, nil, ::String, nil
|
560
582
|
config_attr :universe_domain, nil, ::String, nil
|
583
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
561
584
|
|
562
585
|
# @private
|
563
586
|
def initialize parent_config = nil
|
@@ -150,8 +150,28 @@ module Google
|
|
150
150
|
endpoint: @config.endpoint,
|
151
151
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
152
152
|
universe_domain: @config.universe_domain,
|
153
|
-
credentials: credentials
|
153
|
+
credentials: credentials,
|
154
|
+
logger: @config.logger
|
154
155
|
)
|
156
|
+
|
157
|
+
@snapshots_stub.logger(stub: true)&.info do |entry|
|
158
|
+
entry.set_system_name
|
159
|
+
entry.set_service
|
160
|
+
entry.message = "Created client for #{entry.service}"
|
161
|
+
entry.set_credentials_fields credentials
|
162
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
163
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
164
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
##
|
169
|
+
# The logger used for request/response debug logging.
|
170
|
+
#
|
171
|
+
# @return [Logger]
|
172
|
+
#
|
173
|
+
def logger
|
174
|
+
@snapshots_stub.logger
|
155
175
|
end
|
156
176
|
|
157
177
|
# Service calls
|
@@ -233,7 +253,6 @@ module Google
|
|
233
253
|
|
234
254
|
@snapshots_stub.get_snapshot request, options do |result, operation|
|
235
255
|
yield result, operation if block_given?
|
236
|
-
return result
|
237
256
|
end
|
238
257
|
rescue ::Gapic::Rest::Error => e
|
239
258
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -316,7 +335,6 @@ module Google
|
|
316
335
|
|
317
336
|
@snapshots_stub.delete_snapshot request, options do |result, operation|
|
318
337
|
yield result, operation if block_given?
|
319
|
-
return result
|
320
338
|
end
|
321
339
|
rescue ::Gapic::Rest::Error => e
|
322
340
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -399,7 +417,6 @@ module Google
|
|
399
417
|
|
400
418
|
@snapshots_stub.list_snapshots request, options do |result, operation|
|
401
419
|
yield result, operation if block_given?
|
402
|
-
return result
|
403
420
|
end
|
404
421
|
rescue ::Gapic::Rest::Error => e
|
405
422
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -479,6 +496,11 @@ module Google
|
|
479
496
|
# default endpoint URL. The default value of nil uses the environment
|
480
497
|
# universe (usually the default "googleapis.com" universe).
|
481
498
|
# @return [::String,nil]
|
499
|
+
# @!attribute [rw] logger
|
500
|
+
# A custom logger to use for request/response debug logging, or the value
|
501
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
502
|
+
# explicitly disable logging.
|
503
|
+
# @return [::Logger,:default,nil]
|
482
504
|
#
|
483
505
|
class Configuration
|
484
506
|
extend ::Gapic::Config
|
@@ -500,6 +522,7 @@ module Google
|
|
500
522
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
501
523
|
config_attr :quota_project, nil, ::String, nil
|
502
524
|
config_attr :universe_domain, nil, ::String, nil
|
525
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
503
526
|
|
504
527
|
# @private
|
505
528
|
def initialize parent_config = nil
|