google-cloud-dataflow-v1beta3 0.9.1 → 0.10.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 +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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09f11db329259c8e667f684ddbec84cc5b1c58ac5e25556b3ae38cf5c72efff8'
|
4
|
+
data.tar.gz: 8a523716a4fdf9f25616fb89e813841f02bca5ba87511989306034d9bc9560be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f624cac044680d219f4613569202d41ea8f86224489d3c64910f23c5f9937d86bbbd2002eb369b4332c5959e9939fbfe73cf371926b74894774b533299a7bd68
|
7
|
+
data.tar.gz: a6d83e0b267ec02e591b259942b396e491eb47ab93b8e12dbfb1423346859f3209fcd089493a54667cdc6b1f73cb7385910b27ae94f0cd69b2c71c81e864de2b
|
data/README.md
CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
|
|
43
43
|
See also the [Product Documentation](https://cloud.google.com/dataflow)
|
44
44
|
for general usage information.
|
45
45
|
|
46
|
-
##
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
## Debug Logging
|
47
|
+
|
48
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
49
|
+
your application's integration with the API. When logging is activated, key
|
50
|
+
events such as requests and responses, along with data payloads and metadata
|
51
|
+
such as headers and client configuration, are logged to the standard error
|
52
|
+
stream.
|
53
|
+
|
54
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
55
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
56
|
+
customers, private keys, or other security data that could be compromising if
|
57
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
58
|
+
the principle of least access. Google also recommends that Client Library Debug
|
59
|
+
Logging be enabled only temporarily during active debugging, and not used
|
60
|
+
permanently in production.
|
61
|
+
|
62
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
63
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
64
|
+
list of client library gem names. This will select the default logging behavior,
|
65
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
66
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
67
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
68
|
+
results in logs appearing alongside your application logs in the
|
69
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
70
|
+
|
71
|
+
You can customize logging by modifying the `logger` configuration when
|
72
|
+
constructing a client object. For example:
|
55
73
|
|
56
74
|
```ruby
|
75
|
+
require "google/cloud/dataflow/v1beta3"
|
57
76
|
require "logger"
|
58
77
|
|
59
|
-
|
60
|
-
|
61
|
-
def logger
|
62
|
-
LOGGER
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
67
|
-
module GRPC
|
68
|
-
extend MyLogger
|
78
|
+
client = ::Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new do |config|
|
79
|
+
config.logger = Logger.new "my-app.log"
|
69
80
|
end
|
70
81
|
```
|
71
82
|
|
72
|
-
|
73
83
|
## Google Cloud Samples
|
74
84
|
|
75
85
|
To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
|
@@ -155,8 +155,28 @@ module Google
|
|
155
155
|
universe_domain: @config.universe_domain,
|
156
156
|
channel_args: @config.channel_args,
|
157
157
|
interceptors: @config.interceptors,
|
158
|
-
channel_pool_config: @config.channel_pool
|
158
|
+
channel_pool_config: @config.channel_pool,
|
159
|
+
logger: @config.logger
|
159
160
|
)
|
161
|
+
|
162
|
+
@flex_templates_service_stub.stub_logger&.info do |entry|
|
163
|
+
entry.set_system_name
|
164
|
+
entry.set_service
|
165
|
+
entry.message = "Created client for #{entry.service}"
|
166
|
+
entry.set_credentials_fields credentials
|
167
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
168
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
169
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
##
|
174
|
+
# The logger used for request/response debug logging.
|
175
|
+
#
|
176
|
+
# @return [Logger]
|
177
|
+
#
|
178
|
+
def logger
|
179
|
+
@flex_templates_service_stub.logger
|
160
180
|
end
|
161
181
|
|
162
182
|
# Service calls
|
@@ -253,7 +273,6 @@ module Google
|
|
253
273
|
|
254
274
|
@flex_templates_service_stub.call_rpc :launch_flex_template, 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)
|
@@ -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
|
@@ -366,6 +390,7 @@ module Google
|
|
366
390
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
367
391
|
config_attr :quota_project, nil, ::String, nil
|
368
392
|
config_attr :universe_domain, nil, ::String, nil
|
393
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
369
394
|
|
370
395
|
# @private
|
371
396
|
def initialize parent_config = nil
|
@@ -148,8 +148,28 @@ module Google
|
|
148
148
|
endpoint: @config.endpoint,
|
149
149
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
150
150
|
universe_domain: @config.universe_domain,
|
151
|
-
credentials: credentials
|
151
|
+
credentials: credentials,
|
152
|
+
logger: @config.logger
|
152
153
|
)
|
154
|
+
|
155
|
+
@flex_templates_service_stub.logger(stub: true)&.info do |entry|
|
156
|
+
entry.set_system_name
|
157
|
+
entry.set_service
|
158
|
+
entry.message = "Created client for #{entry.service}"
|
159
|
+
entry.set_credentials_fields credentials
|
160
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
161
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
162
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
##
|
167
|
+
# The logger used for request/response debug logging.
|
168
|
+
#
|
169
|
+
# @return [Logger]
|
170
|
+
#
|
171
|
+
def logger
|
172
|
+
@flex_templates_service_stub.logger
|
153
173
|
end
|
154
174
|
|
155
175
|
# Service calls
|
@@ -236,7 +256,6 @@ module Google
|
|
236
256
|
|
237
257
|
@flex_templates_service_stub.launch_flex_template request, options do |result, operation|
|
238
258
|
yield result, operation if block_given?
|
239
|
-
return result
|
240
259
|
end
|
241
260
|
rescue ::Gapic::Rest::Error => e
|
242
261
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -316,6 +335,11 @@ module Google
|
|
316
335
|
# default endpoint URL. The default value of nil uses the environment
|
317
336
|
# universe (usually the default "googleapis.com" universe).
|
318
337
|
# @return [::String,nil]
|
338
|
+
# @!attribute [rw] logger
|
339
|
+
# A custom logger to use for request/response debug logging, or the value
|
340
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
341
|
+
# explicitly disable logging.
|
342
|
+
# @return [::Logger,:default,nil]
|
319
343
|
#
|
320
344
|
class Configuration
|
321
345
|
extend ::Gapic::Config
|
@@ -337,6 +361,7 @@ module Google
|
|
337
361
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
338
362
|
config_attr :quota_project, nil, ::String, nil
|
339
363
|
config_attr :universe_domain, nil, ::String, nil
|
364
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
340
365
|
|
341
366
|
# @private
|
342
367
|
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 launch_flex_template 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: "launch_flex_template",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateResponse.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
|
+
@jobs_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
|
+
@jobs_stub.logger
|
163
183
|
end
|
164
184
|
|
165
185
|
# Service calls
|
@@ -263,7 +283,6 @@ module Google
|
|
263
283
|
|
264
284
|
@jobs_stub.call_rpc :create_job, request, options: options do |response, operation|
|
265
285
|
yield response, operation if block_given?
|
266
|
-
return response
|
267
286
|
end
|
268
287
|
rescue ::GRPC::BadStatus => e
|
269
288
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -369,7 +388,6 @@ module Google
|
|
369
388
|
|
370
389
|
@jobs_stub.call_rpc :get_job, request, options: options do |response, operation|
|
371
390
|
yield response, operation if block_given?
|
372
|
-
return response
|
373
391
|
end
|
374
392
|
rescue ::GRPC::BadStatus => e
|
375
393
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -476,7 +494,6 @@ module Google
|
|
476
494
|
|
477
495
|
@jobs_stub.call_rpc :update_job, request, options: options do |response, operation|
|
478
496
|
yield response, operation if block_given?
|
479
|
-
return response
|
480
497
|
end
|
481
498
|
rescue ::GRPC::BadStatus => e
|
482
499
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -593,7 +610,7 @@ module Google
|
|
593
610
|
@jobs_stub.call_rpc :list_jobs, request, options: options do |response, operation|
|
594
611
|
response = ::Gapic::PagedEnumerable.new @jobs_stub, :list_jobs, request, response, operation, options
|
595
612
|
yield response, operation if block_given?
|
596
|
-
|
613
|
+
throw :response, response
|
597
614
|
end
|
598
615
|
rescue ::GRPC::BadStatus => e
|
599
616
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -700,7 +717,7 @@ module Google
|
|
700
717
|
@jobs_stub.call_rpc :aggregated_list_jobs, request, options: options do |response, operation|
|
701
718
|
response = ::Gapic::PagedEnumerable.new @jobs_stub, :aggregated_list_jobs, request, response, operation, options
|
702
719
|
yield response, operation if block_given?
|
703
|
-
|
720
|
+
throw :response, response
|
704
721
|
end
|
705
722
|
rescue ::GRPC::BadStatus => e
|
706
723
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -778,7 +795,6 @@ module Google
|
|
778
795
|
|
779
796
|
@jobs_stub.call_rpc :check_active_jobs, request, options: options do |response, operation|
|
780
797
|
yield response, operation if block_given?
|
781
|
-
return response
|
782
798
|
end
|
783
799
|
rescue ::GRPC::BadStatus => e
|
784
800
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -880,7 +896,6 @@ module Google
|
|
880
896
|
|
881
897
|
@jobs_stub.call_rpc :snapshot_job, request, options: options do |response, operation|
|
882
898
|
yield response, operation if block_given?
|
883
|
-
return response
|
884
899
|
end
|
885
900
|
rescue ::GRPC::BadStatus => e
|
886
901
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -969,6 +984,11 @@ module Google
|
|
969
984
|
# default endpoint URL. The default value of nil uses the environment
|
970
985
|
# universe (usually the default "googleapis.com" universe).
|
971
986
|
# @return [::String,nil]
|
987
|
+
# @!attribute [rw] logger
|
988
|
+
# A custom logger to use for request/response debug logging, or the value
|
989
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
990
|
+
# explicitly disable logging.
|
991
|
+
# @return [::Logger,:default,nil]
|
972
992
|
#
|
973
993
|
class Configuration
|
974
994
|
extend ::Gapic::Config
|
@@ -993,6 +1013,7 @@ module Google
|
|
993
1013
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
994
1014
|
config_attr :quota_project, nil, ::String, nil
|
995
1015
|
config_attr :universe_domain, nil, ::String, nil
|
1016
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
996
1017
|
|
997
1018
|
# @private
|
998
1019
|
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
|
+
@jobs_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
|
+
@jobs_stub.logger
|
156
176
|
end
|
157
177
|
|
158
178
|
# Service calls
|
@@ -246,7 +266,6 @@ module Google
|
|
246
266
|
|
247
267
|
@jobs_stub.create_job request, options do |result, operation|
|
248
268
|
yield result, operation if block_given?
|
249
|
-
return result
|
250
269
|
end
|
251
270
|
rescue ::Gapic::Rest::Error => e
|
252
271
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -339,7 +358,6 @@ module Google
|
|
339
358
|
|
340
359
|
@jobs_stub.get_job request, options do |result, operation|
|
341
360
|
yield result, operation if block_given?
|
342
|
-
return result
|
343
361
|
end
|
344
362
|
rescue ::Gapic::Rest::Error => e
|
345
363
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -433,7 +451,6 @@ module Google
|
|
433
451
|
|
434
452
|
@jobs_stub.update_job request, options do |result, operation|
|
435
453
|
yield result, operation if block_given?
|
436
|
-
return result
|
437
454
|
end
|
438
455
|
rescue ::Gapic::Rest::Error => e
|
439
456
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -539,7 +556,6 @@ module Google
|
|
539
556
|
|
540
557
|
@jobs_stub.list_jobs request, options do |result, operation|
|
541
558
|
yield result, operation if block_given?
|
542
|
-
return result
|
543
559
|
end
|
544
560
|
rescue ::Gapic::Rest::Error => e
|
545
561
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -638,7 +654,6 @@ module Google
|
|
638
654
|
|
639
655
|
@jobs_stub.aggregated_list_jobs request, options do |result, operation|
|
640
656
|
yield result, operation if block_given?
|
641
|
-
return result
|
642
657
|
end
|
643
658
|
rescue ::Gapic::Rest::Error => e
|
644
659
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -727,7 +742,6 @@ module Google
|
|
727
742
|
|
728
743
|
@jobs_stub.snapshot_job request, options do |result, operation|
|
729
744
|
yield result, operation if block_given?
|
730
|
-
return result
|
731
745
|
end
|
732
746
|
rescue ::Gapic::Rest::Error => e
|
733
747
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -807,6 +821,11 @@ module Google
|
|
807
821
|
# default endpoint URL. The default value of nil uses the environment
|
808
822
|
# universe (usually the default "googleapis.com" universe).
|
809
823
|
# @return [::String,nil]
|
824
|
+
# @!attribute [rw] logger
|
825
|
+
# A custom logger to use for request/response debug logging, or the value
|
826
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
827
|
+
# explicitly disable logging.
|
828
|
+
# @return [::Logger,:default,nil]
|
810
829
|
#
|
811
830
|
class Configuration
|
812
831
|
extend ::Gapic::Config
|
@@ -828,6 +847,7 @@ module Google
|
|
828
847
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
829
848
|
config_attr :quota_project, nil, ::String, nil
|
830
849
|
config_attr :universe_domain, nil, ::String, nil
|
850
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
831
851
|
|
832
852
|
# @private
|
833
853
|
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 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
|
##
|