google-cloud-dataflow-v1beta3 0.9.1 → 0.11.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 +31 -21
- data/lib/google/cloud/dataflow/v1beta3/flex_templates_service/client.rb +34 -2
- data/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/client.rb +34 -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 +36 -8
- data/lib/google/cloud/dataflow/v1beta3/jobs/rest/client.rb +34 -7
- data/lib/google/cloud/dataflow/v1beta3/jobs/rest/service_stub.rb +62 -38
- data/lib/google/cloud/dataflow/v1beta3/messages/client.rb +35 -2
- data/lib/google/cloud/dataflow/v1beta3/messages/rest/client.rb +34 -2
- data/lib/google/cloud/dataflow/v1beta3/messages/rest/service_stub.rb +22 -8
- data/lib/google/cloud/dataflow/v1beta3/metrics/client.rb +36 -4
- data/lib/google/cloud/dataflow/v1beta3/metrics/rest/client.rb +36 -4
- data/lib/google/cloud/dataflow/v1beta3/metrics/rest/service_stub.rb +38 -20
- data/lib/google/cloud/dataflow/v1beta3/snapshots/client.rb +34 -4
- data/lib/google/cloud/dataflow/v1beta3/snapshots/rest/client.rb +34 -4
- data/lib/google/cloud/dataflow/v1beta3/snapshots/rest/service_stub.rb +38 -20
- data/lib/google/cloud/dataflow/v1beta3/templates_service/client.rb +38 -4
- data/lib/google/cloud/dataflow/v1beta3/templates_service/rest/client.rb +38 -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
- data/proto_docs/google/dataflow/v1beta3/jobs.rb +14 -0
- data/proto_docs/google/dataflow/v1beta3/streaming.rb +8 -0
- data/proto_docs/google/dataflow/v1beta3/templates.rb +8 -0
- data/proto_docs/google/protobuf/struct.rb +12 -0
- metadata +6 -9
@@ -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 create_job 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: "create_job",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::Dataflow::V1beta3::Job.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",
|
131
146
|
options: options
|
132
147
|
)
|
133
148
|
operation = ::Gapic::Rest::TransportOperation.new response
|
134
149
|
result = ::Google::Cloud::Dataflow::V1beta3::Job.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: "update_job",
|
169
186
|
options: options
|
170
187
|
)
|
171
188
|
operation = ::Gapic::Rest::TransportOperation.new response
|
172
189
|
result = ::Google::Cloud::Dataflow::V1beta3::Job.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
|
##
|
@@ -201,16 +219,18 @@ module Google
|
|
201
219
|
|
202
220
|
response = @client_stub.make_http_request(
|
203
221
|
verb,
|
204
|
-
uri:
|
205
|
-
body:
|
206
|
-
params:
|
222
|
+
uri: uri,
|
223
|
+
body: body || "",
|
224
|
+
params: query_string_params,
|
225
|
+
method_name: "list_jobs",
|
207
226
|
options: options
|
208
227
|
)
|
209
228
|
operation = ::Gapic::Rest::TransportOperation.new response
|
210
229
|
result = ::Google::Cloud::Dataflow::V1beta3::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true
|
211
|
-
|
212
|
-
|
213
|
-
|
230
|
+
catch :response do
|
231
|
+
yield result, operation if block_given?
|
232
|
+
result
|
233
|
+
end
|
214
234
|
end
|
215
235
|
|
216
236
|
##
|
@@ -239,16 +259,18 @@ module Google
|
|
239
259
|
|
240
260
|
response = @client_stub.make_http_request(
|
241
261
|
verb,
|
242
|
-
uri:
|
243
|
-
body:
|
244
|
-
params:
|
262
|
+
uri: uri,
|
263
|
+
body: body || "",
|
264
|
+
params: query_string_params,
|
265
|
+
method_name: "aggregated_list_jobs",
|
245
266
|
options: options
|
246
267
|
)
|
247
268
|
operation = ::Gapic::Rest::TransportOperation.new response
|
248
269
|
result = ::Google::Cloud::Dataflow::V1beta3::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true
|
249
|
-
|
250
|
-
|
251
|
-
|
270
|
+
catch :response do
|
271
|
+
yield result, operation if block_given?
|
272
|
+
result
|
273
|
+
end
|
252
274
|
end
|
253
275
|
|
254
276
|
##
|
@@ -277,16 +299,18 @@ module Google
|
|
277
299
|
|
278
300
|
response = @client_stub.make_http_request(
|
279
301
|
verb,
|
280
|
-
uri:
|
281
|
-
body:
|
282
|
-
params:
|
302
|
+
uri: uri,
|
303
|
+
body: body || "",
|
304
|
+
params: query_string_params,
|
305
|
+
method_name: "snapshot_job",
|
283
306
|
options: options
|
284
307
|
)
|
285
308
|
operation = ::Gapic::Rest::TransportOperation.new response
|
286
309
|
result = ::Google::Cloud::Dataflow::V1beta3::Snapshot.decode_json response.body, ignore_unknown_fields: true
|
287
|
-
|
288
|
-
|
289
|
-
|
310
|
+
catch :response do
|
311
|
+
yield result, operation if block_given?
|
312
|
+
result
|
313
|
+
end
|
290
314
|
end
|
291
315
|
|
292
316
|
##
|
@@ -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)
|
@@ -333,6 +353,13 @@ module Google
|
|
333
353
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
334
354
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
335
355
|
# * (`nil`) indicating no credentials
|
356
|
+
#
|
357
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
358
|
+
# external source for authentication to Google Cloud, you must validate it before
|
359
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
360
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
361
|
+
# For more information, refer to [Validate credential configurations from external
|
362
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
336
363
|
# @return [::Object]
|
337
364
|
# @!attribute [rw] scope
|
338
365
|
# The OAuth scopes
|
@@ -372,6 +399,11 @@ module Google
|
|
372
399
|
# default endpoint URL. The default value of nil uses the environment
|
373
400
|
# universe (usually the default "googleapis.com" universe).
|
374
401
|
# @return [::String,nil]
|
402
|
+
# @!attribute [rw] logger
|
403
|
+
# A custom logger to use for request/response debug logging, or the value
|
404
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
405
|
+
# explicitly disable logging.
|
406
|
+
# @return [::Logger,:default,nil]
|
375
407
|
#
|
376
408
|
class Configuration
|
377
409
|
extend ::Gapic::Config
|
@@ -396,6 +428,7 @@ module Google
|
|
396
428
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
397
429
|
config_attr :quota_project, nil, ::String, nil
|
398
430
|
config_attr :universe_domain, nil, ::String, nil
|
431
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
399
432
|
|
400
433
|
# @private
|
401
434
|
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)
|
@@ -310,6 +329,13 @@ module Google
|
|
310
329
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
311
330
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
312
331
|
# * (`nil`) indicating no credentials
|
332
|
+
#
|
333
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
334
|
+
# external source for authentication to Google Cloud, you must validate it before
|
335
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
336
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
337
|
+
# For more information, refer to [Validate credential configurations from external
|
338
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
313
339
|
# @return [::Object]
|
314
340
|
# @!attribute [rw] scope
|
315
341
|
# The OAuth scopes
|
@@ -342,6 +368,11 @@ module Google
|
|
342
368
|
# default endpoint URL. The default value of nil uses the environment
|
343
369
|
# universe (usually the default "googleapis.com" universe).
|
344
370
|
# @return [::String,nil]
|
371
|
+
# @!attribute [rw] logger
|
372
|
+
# A custom logger to use for request/response debug logging, or the value
|
373
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
374
|
+
# explicitly disable logging.
|
375
|
+
# @return [::Logger,:default,nil]
|
345
376
|
#
|
346
377
|
class Configuration
|
347
378
|
extend ::Gapic::Config
|
@@ -363,6 +394,7 @@ module Google
|
|
363
394
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
364
395
|
config_attr :quota_project, nil, ::String, nil
|
365
396
|
config_attr :universe_domain, nil, ::String, nil
|
397
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
366
398
|
|
367
399
|
# @private
|
368
400
|
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)
|
@@ -551,6 +570,13 @@ module Google
|
|
551
570
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
552
571
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
553
572
|
# * (`nil`) indicating no credentials
|
573
|
+
#
|
574
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
575
|
+
# external source for authentication to Google Cloud, you must validate it before
|
576
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
577
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
578
|
+
# For more information, refer to [Validate credential configurations from external
|
579
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
554
580
|
# @return [::Object]
|
555
581
|
# @!attribute [rw] scope
|
556
582
|
# The OAuth scopes
|
@@ -590,6 +616,11 @@ module Google
|
|
590
616
|
# default endpoint URL. The default value of nil uses the environment
|
591
617
|
# universe (usually the default "googleapis.com" universe).
|
592
618
|
# @return [::String,nil]
|
619
|
+
# @!attribute [rw] logger
|
620
|
+
# A custom logger to use for request/response debug logging, or the value
|
621
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
622
|
+
# explicitly disable logging.
|
623
|
+
# @return [::Logger,:default,nil]
|
593
624
|
#
|
594
625
|
class Configuration
|
595
626
|
extend ::Gapic::Config
|
@@ -614,6 +645,7 @@ module Google
|
|
614
645
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
615
646
|
config_attr :quota_project, nil, ::String, nil
|
616
647
|
config_attr :universe_domain, nil, ::String, nil
|
648
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
617
649
|
|
618
650
|
# @private
|
619
651
|
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)
|
@@ -500,6 +519,13 @@ module Google
|
|
500
519
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
501
520
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
502
521
|
# * (`nil`) indicating no credentials
|
522
|
+
#
|
523
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
524
|
+
# external source for authentication to Google Cloud, you must validate it before
|
525
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
526
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
527
|
+
# For more information, refer to [Validate credential configurations from external
|
528
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
503
529
|
# @return [::Object]
|
504
530
|
# @!attribute [rw] scope
|
505
531
|
# The OAuth scopes
|
@@ -532,6 +558,11 @@ module Google
|
|
532
558
|
# default endpoint URL. The default value of nil uses the environment
|
533
559
|
# universe (usually the default "googleapis.com" universe).
|
534
560
|
# @return [::String,nil]
|
561
|
+
# @!attribute [rw] logger
|
562
|
+
# A custom logger to use for request/response debug logging, or the value
|
563
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
564
|
+
# explicitly disable logging.
|
565
|
+
# @return [::Logger,:default,nil]
|
535
566
|
#
|
536
567
|
class Configuration
|
537
568
|
extend ::Gapic::Config
|
@@ -553,6 +584,7 @@ module Google
|
|
553
584
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
554
585
|
config_attr :quota_project, nil, ::String, nil
|
555
586
|
config_attr :universe_domain, nil, ::String, nil
|
587
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
556
588
|
|
557
589
|
# @private
|
558
590
|
def initialize parent_config = nil
|