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 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)
|
@@ -495,6 +512,13 @@ module Google
|
|
495
512
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
496
513
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
497
514
|
# * (`nil`) indicating no credentials
|
515
|
+
#
|
516
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
517
|
+
# external source for authentication to Google Cloud, you must validate it before
|
518
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
519
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
520
|
+
# For more information, refer to [Validate credential configurations from external
|
521
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
498
522
|
# @return [::Object]
|
499
523
|
# @!attribute [rw] scope
|
500
524
|
# The OAuth scopes
|
@@ -534,6 +558,11 @@ module Google
|
|
534
558
|
# default endpoint URL. The default value of nil uses the environment
|
535
559
|
# universe (usually the default "googleapis.com" universe).
|
536
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]
|
537
566
|
#
|
538
567
|
class Configuration
|
539
568
|
extend ::Gapic::Config
|
@@ -558,6 +587,7 @@ module Google
|
|
558
587
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
559
588
|
config_attr :quota_project, nil, ::String, nil
|
560
589
|
config_attr :universe_domain, nil, ::String, nil
|
590
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
561
591
|
|
562
592
|
# @private
|
563
593
|
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)
|
@@ -447,6 +464,13 @@ module Google
|
|
447
464
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
448
465
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
449
466
|
# * (`nil`) indicating no credentials
|
467
|
+
#
|
468
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
469
|
+
# external source for authentication to Google Cloud, you must validate it before
|
470
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
471
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
472
|
+
# For more information, refer to [Validate credential configurations from external
|
473
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
450
474
|
# @return [::Object]
|
451
475
|
# @!attribute [rw] scope
|
452
476
|
# The OAuth scopes
|
@@ -479,6 +503,11 @@ module Google
|
|
479
503
|
# default endpoint URL. The default value of nil uses the environment
|
480
504
|
# universe (usually the default "googleapis.com" universe).
|
481
505
|
# @return [::String,nil]
|
506
|
+
# @!attribute [rw] logger
|
507
|
+
# A custom logger to use for request/response debug logging, or the value
|
508
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
509
|
+
# explicitly disable logging.
|
510
|
+
# @return [::Logger,:default,nil]
|
482
511
|
#
|
483
512
|
class Configuration
|
484
513
|
extend ::Gapic::Config
|
@@ -500,6 +529,7 @@ module Google
|
|
500
529
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
501
530
|
config_attr :quota_project, nil, ::String, nil
|
502
531
|
config_attr :universe_domain, nil, ::String, nil
|
532
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
503
533
|
|
504
534
|
# @private
|
505
535
|
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_snapshot 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_snapshot",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::Dataflow::V1beta3::Snapshot.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: "delete_snapshot",
|
131
146
|
options: options
|
132
147
|
)
|
133
148
|
operation = ::Gapic::Rest::TransportOperation.new response
|
134
149
|
result = ::Google::Cloud::Dataflow::V1beta3::DeleteSnapshotResponse.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: "list_snapshots",
|
169
186
|
options: options
|
170
187
|
)
|
171
188
|
operation = ::Gapic::Rest::TransportOperation.new response
|
172
189
|
result = ::Google::Cloud::Dataflow::V1beta3::ListSnapshotsResponse.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
|
+
@templates_service_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
|
+
@templates_service_stub.logger
|
162
182
|
end
|
163
183
|
|
164
184
|
# Service calls
|
@@ -260,7 +280,6 @@ module Google
|
|
260
280
|
|
261
281
|
@templates_service_stub.call_rpc :create_job_from_template, request, options: options do |response, operation|
|
262
282
|
yield response, operation if block_given?
|
263
|
-
return response
|
264
283
|
end
|
265
284
|
rescue ::GRPC::BadStatus => e
|
266
285
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -293,8 +312,12 @@ module Google
|
|
293
312
|
# A Cloud Storage path to the template from which to create
|
294
313
|
# the job.
|
295
314
|
# Must be valid Cloud Storage URL, beginning with 'gs://'.
|
315
|
+
#
|
316
|
+
# Note: The following fields are mutually exclusive: `gcs_path`, `dynamic_template`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
296
317
|
# @param dynamic_template [::Google::Cloud::Dataflow::V1beta3::DynamicTemplateLaunchParams, ::Hash]
|
297
318
|
# Params for launching a dynamic template.
|
319
|
+
#
|
320
|
+
# Note: The following fields are mutually exclusive: `dynamic_template`, `gcs_path`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
298
321
|
# @param launch_parameters [::Google::Cloud::Dataflow::V1beta3::LaunchTemplateParameters, ::Hash]
|
299
322
|
# The parameters of the template to launch. This should be part of the
|
300
323
|
# body of the POST request.
|
@@ -365,7 +388,6 @@ module Google
|
|
365
388
|
|
366
389
|
@templates_service_stub.call_rpc :launch_template, request, options: options do |response, operation|
|
367
390
|
yield response, operation if block_given?
|
368
|
-
return response
|
369
391
|
end
|
370
392
|
rescue ::GRPC::BadStatus => e
|
371
393
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -464,7 +486,6 @@ module Google
|
|
464
486
|
|
465
487
|
@templates_service_stub.call_rpc :get_template, request, options: options do |response, operation|
|
466
488
|
yield response, operation if block_given?
|
467
|
-
return response
|
468
489
|
end
|
469
490
|
rescue ::GRPC::BadStatus => e
|
470
491
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -514,6 +535,13 @@ module Google
|
|
514
535
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
515
536
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
516
537
|
# * (`nil`) indicating no credentials
|
538
|
+
#
|
539
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
540
|
+
# external source for authentication to Google Cloud, you must validate it before
|
541
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
542
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
543
|
+
# For more information, refer to [Validate credential configurations from external
|
544
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
517
545
|
# @return [::Object]
|
518
546
|
# @!attribute [rw] scope
|
519
547
|
# The OAuth scopes
|
@@ -553,6 +581,11 @@ module Google
|
|
553
581
|
# default endpoint URL. The default value of nil uses the environment
|
554
582
|
# universe (usually the default "googleapis.com" universe).
|
555
583
|
# @return [::String,nil]
|
584
|
+
# @!attribute [rw] logger
|
585
|
+
# A custom logger to use for request/response debug logging, or the value
|
586
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
587
|
+
# explicitly disable logging.
|
588
|
+
# @return [::Logger,:default,nil]
|
556
589
|
#
|
557
590
|
class Configuration
|
558
591
|
extend ::Gapic::Config
|
@@ -577,6 +610,7 @@ module Google
|
|
577
610
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
578
611
|
config_attr :quota_project, nil, ::String, nil
|
579
612
|
config_attr :universe_domain, nil, ::String, nil
|
613
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
580
614
|
|
581
615
|
# @private
|
582
616
|
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
|
+
@templates_service_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
|
+
@templates_service_stub.logger
|
155
175
|
end
|
156
176
|
|
157
177
|
# Service calls
|
@@ -243,7 +263,6 @@ module Google
|
|
243
263
|
|
244
264
|
@templates_service_stub.create_job_from_template request, options do |result, operation|
|
245
265
|
yield result, operation if block_given?
|
246
|
-
return result
|
247
266
|
end
|
248
267
|
rescue ::Gapic::Rest::Error => e
|
249
268
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -276,8 +295,12 @@ module Google
|
|
276
295
|
# A Cloud Storage path to the template from which to create
|
277
296
|
# the job.
|
278
297
|
# Must be valid Cloud Storage URL, beginning with 'gs://'.
|
298
|
+
#
|
299
|
+
# Note: The following fields are mutually exclusive: `gcs_path`, `dynamic_template`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
279
300
|
# @param dynamic_template [::Google::Cloud::Dataflow::V1beta3::DynamicTemplateLaunchParams, ::Hash]
|
280
301
|
# Params for launching a dynamic template.
|
302
|
+
#
|
303
|
+
# Note: The following fields are mutually exclusive: `dynamic_template`, `gcs_path`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
281
304
|
# @param launch_parameters [::Google::Cloud::Dataflow::V1beta3::LaunchTemplateParameters, ::Hash]
|
282
305
|
# The parameters of the template to launch. This should be part of the
|
283
306
|
# body of the POST request.
|
@@ -338,7 +361,6 @@ module Google
|
|
338
361
|
|
339
362
|
@templates_service_stub.launch_template request, options do |result, operation|
|
340
363
|
yield result, operation if block_given?
|
341
|
-
return result
|
342
364
|
end
|
343
365
|
rescue ::Gapic::Rest::Error => e
|
344
366
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -427,7 +449,6 @@ module Google
|
|
427
449
|
|
428
450
|
@templates_service_stub.get_template request, options do |result, operation|
|
429
451
|
yield result, operation if block_given?
|
430
|
-
return result
|
431
452
|
end
|
432
453
|
rescue ::Gapic::Rest::Error => e
|
433
454
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -475,6 +496,13 @@ module Google
|
|
475
496
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
476
497
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
477
498
|
# * (`nil`) indicating no credentials
|
499
|
+
#
|
500
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
501
|
+
# external source for authentication to Google Cloud, you must validate it before
|
502
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
503
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
504
|
+
# For more information, refer to [Validate credential configurations from external
|
505
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
478
506
|
# @return [::Object]
|
479
507
|
# @!attribute [rw] scope
|
480
508
|
# The OAuth scopes
|
@@ -507,6 +535,11 @@ module Google
|
|
507
535
|
# default endpoint URL. The default value of nil uses the environment
|
508
536
|
# universe (usually the default "googleapis.com" universe).
|
509
537
|
# @return [::String,nil]
|
538
|
+
# @!attribute [rw] logger
|
539
|
+
# A custom logger to use for request/response debug logging, or the value
|
540
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
541
|
+
# explicitly disable logging.
|
542
|
+
# @return [::Logger,:default,nil]
|
510
543
|
#
|
511
544
|
class Configuration
|
512
545
|
extend ::Gapic::Config
|
@@ -528,6 +561,7 @@ module Google
|
|
528
561
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
529
562
|
config_attr :quota_project, nil, ::String, nil
|
530
563
|
config_attr :universe_domain, nil, ::String, nil
|
564
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
531
565
|
|
532
566
|
# @private
|
533
567
|
def initialize parent_config = nil
|