google-cloud-dataflow-v1beta3 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +2 -2
- data/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/client.rb +351 -0
- data/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/service_stub.rb +109 -0
- data/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest.rb +51 -0
- data/lib/google/cloud/dataflow/v1beta3/flex_templates_service.rb +7 -1
- data/lib/google/cloud/dataflow/v1beta3/jobs/client.rb +8 -12
- data/lib/google/cloud/dataflow/v1beta3/jobs/rest/client.rb +784 -0
- data/lib/google/cloud/dataflow/v1beta3/jobs/rest/service_stub.rb +454 -0
- data/lib/google/cloud/dataflow/v1beta3/jobs/rest.rb +52 -0
- data/lib/google/cloud/dataflow/v1beta3/jobs.rb +7 -1
- data/lib/google/cloud/dataflow/v1beta3/messages/client.rb +4 -6
- data/lib/google/cloud/dataflow/v1beta3/messages/rest/client.rb +373 -0
- data/lib/google/cloud/dataflow/v1beta3/messages/rest/service_stub.rb +117 -0
- data/lib/google/cloud/dataflow/v1beta3/messages/rest.rb +52 -0
- data/lib/google/cloud/dataflow/v1beta3/messages.rb +7 -1
- data/lib/google/cloud/dataflow/v1beta3/metrics/client.rb +8 -12
- data/lib/google/cloud/dataflow/v1beta3/metrics/rest/client.rb +539 -0
- data/lib/google/cloud/dataflow/v1beta3/metrics/rest/service_stub.rb +240 -0
- data/lib/google/cloud/dataflow/v1beta3/metrics/rest.rb +52 -0
- data/lib/google/cloud/dataflow/v1beta3/metrics.rb +7 -1
- data/lib/google/cloud/dataflow/v1beta3/rest.rb +42 -0
- data/lib/google/cloud/dataflow/v1beta3/snapshots/rest/client.rb +494 -0
- data/lib/google/cloud/dataflow/v1beta3/snapshots/rest/service_stub.rb +261 -0
- data/lib/google/cloud/dataflow/v1beta3/snapshots/rest.rb +51 -0
- data/lib/google/cloud/dataflow/v1beta3/snapshots.rb +7 -1
- data/lib/google/cloud/dataflow/v1beta3/templates_service/rest/client.rb +522 -0
- data/lib/google/cloud/dataflow/v1beta3/templates_service/rest/service_stub.rb +253 -0
- data/lib/google/cloud/dataflow/v1beta3/templates_service/rest.rb +51 -0
- data/lib/google/cloud/dataflow/v1beta3/templates_service.rb +7 -1
- data/lib/google/cloud/dataflow/v1beta3/version.rb +1 -1
- data/lib/google/cloud/dataflow/v1beta3.rb +7 -2
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +29 -8
@@ -0,0 +1,784 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/dataflow/v1beta3/jobs_pb"
|
21
|
+
require "google/cloud/dataflow/v1beta3/jobs/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module Dataflow
|
26
|
+
module V1beta3
|
27
|
+
module Jobs
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the Jobs service.
|
31
|
+
#
|
32
|
+
# Provides a method to create and modify Google Cloud Dataflow jobs.
|
33
|
+
# A Job is a multi-stage computation graph run by the Cloud Dataflow service.
|
34
|
+
#
|
35
|
+
class Client
|
36
|
+
# @private
|
37
|
+
attr_reader :jobs_stub
|
38
|
+
|
39
|
+
##
|
40
|
+
# Configure the Jobs Client class.
|
41
|
+
#
|
42
|
+
# See {::Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client::Configuration}
|
43
|
+
# for a description of the configuration fields.
|
44
|
+
#
|
45
|
+
# @example
|
46
|
+
#
|
47
|
+
# # Modify the configuration for all Jobs clients
|
48
|
+
# ::Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client.configure do |config|
|
49
|
+
# config.timeout = 10.0
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# @yield [config] Configure the Client client.
|
53
|
+
# @yieldparam config [Client::Configuration]
|
54
|
+
#
|
55
|
+
# @return [Client::Configuration]
|
56
|
+
#
|
57
|
+
def self.configure
|
58
|
+
@configure ||= begin
|
59
|
+
namespace = ["Google", "Cloud", "Dataflow", "V1beta3"]
|
60
|
+
parent_config = while namespace.any?
|
61
|
+
parent_name = namespace.join "::"
|
62
|
+
parent_const = const_get parent_name
|
63
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
64
|
+
namespace.pop
|
65
|
+
end
|
66
|
+
default_config = Client::Configuration.new parent_config
|
67
|
+
|
68
|
+
default_config.timeout = 60.0
|
69
|
+
|
70
|
+
default_config
|
71
|
+
end
|
72
|
+
yield @configure if block_given?
|
73
|
+
@configure
|
74
|
+
end
|
75
|
+
|
76
|
+
##
|
77
|
+
# Configure the Jobs Client instance.
|
78
|
+
#
|
79
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
80
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
81
|
+
# should be made on {Client.configure}.
|
82
|
+
#
|
83
|
+
# See {::Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client::Configuration}
|
84
|
+
# for a description of the configuration fields.
|
85
|
+
#
|
86
|
+
# @yield [config] Configure the Client client.
|
87
|
+
# @yieldparam config [Client::Configuration]
|
88
|
+
#
|
89
|
+
# @return [Client::Configuration]
|
90
|
+
#
|
91
|
+
def configure
|
92
|
+
yield @config if block_given?
|
93
|
+
@config
|
94
|
+
end
|
95
|
+
|
96
|
+
##
|
97
|
+
# Create a new Jobs REST client object.
|
98
|
+
#
|
99
|
+
# @example
|
100
|
+
#
|
101
|
+
# # Create a client using the default configuration
|
102
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client.new
|
103
|
+
#
|
104
|
+
# # Create a client using a custom configuration
|
105
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client.new do |config|
|
106
|
+
# config.timeout = 10.0
|
107
|
+
# end
|
108
|
+
#
|
109
|
+
# @yield [config] Configure the Jobs client.
|
110
|
+
# @yieldparam config [Client::Configuration]
|
111
|
+
#
|
112
|
+
def initialize
|
113
|
+
# Create the configuration object
|
114
|
+
@config = Configuration.new Client.configure
|
115
|
+
|
116
|
+
# Yield the configuration if needed
|
117
|
+
yield @config if block_given?
|
118
|
+
|
119
|
+
# Create credentials
|
120
|
+
credentials = @config.credentials
|
121
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
122
|
+
# but only if the default endpoint does not have a region prefix.
|
123
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
124
|
+
!@config.endpoint.split(".").first.include?("-")
|
125
|
+
credentials ||= Credentials.default scope: @config.scope,
|
126
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
127
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
128
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
129
|
+
end
|
130
|
+
|
131
|
+
@quota_project_id = @config.quota_project
|
132
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
133
|
+
|
134
|
+
@jobs_stub = ::Google::Cloud::Dataflow::V1beta3::Jobs::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
135
|
+
end
|
136
|
+
|
137
|
+
# Service calls
|
138
|
+
|
139
|
+
##
|
140
|
+
# Creates a Cloud Dataflow job.
|
141
|
+
#
|
142
|
+
# To create a job, we recommend using `projects.locations.jobs.create` with a
|
143
|
+
# [regional endpoint]
|
144
|
+
# (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
|
145
|
+
# `projects.jobs.create` is not recommended, as your job will always start
|
146
|
+
# in `us-central1`.
|
147
|
+
#
|
148
|
+
# @overload create_job(request, options = nil)
|
149
|
+
# Pass arguments to `create_job` via a request object, either of type
|
150
|
+
# {::Google::Cloud::Dataflow::V1beta3::CreateJobRequest} or an equivalent Hash.
|
151
|
+
#
|
152
|
+
# @param request [::Google::Cloud::Dataflow::V1beta3::CreateJobRequest, ::Hash]
|
153
|
+
# A request object representing the call parameters. Required. To specify no
|
154
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
155
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
156
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
157
|
+
#
|
158
|
+
# @overload create_job(project_id: nil, job: nil, view: nil, replace_job_id: nil, location: nil)
|
159
|
+
# Pass arguments to `create_job` via keyword arguments. Note that at
|
160
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
161
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
162
|
+
#
|
163
|
+
# @param project_id [::String]
|
164
|
+
# The ID of the Cloud Platform project that the job belongs to.
|
165
|
+
# @param job [::Google::Cloud::Dataflow::V1beta3::Job, ::Hash]
|
166
|
+
# The job to create.
|
167
|
+
# @param view [::Google::Cloud::Dataflow::V1beta3::JobView]
|
168
|
+
# The level of information requested in response.
|
169
|
+
# @param replace_job_id [::String]
|
170
|
+
# Deprecated. This field is now in the Job message.
|
171
|
+
# @param location [::String]
|
172
|
+
# The [regional endpoint]
|
173
|
+
# (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
|
174
|
+
# contains this job.
|
175
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
176
|
+
# @yieldparam result [::Google::Cloud::Dataflow::V1beta3::Job]
|
177
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
178
|
+
#
|
179
|
+
# @return [::Google::Cloud::Dataflow::V1beta3::Job]
|
180
|
+
#
|
181
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
182
|
+
def create_job request, options = nil
|
183
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
184
|
+
|
185
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataflow::V1beta3::CreateJobRequest
|
186
|
+
|
187
|
+
# Converts hash and nil to an options object
|
188
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
189
|
+
|
190
|
+
# Customize the options with defaults
|
191
|
+
call_metadata = @config.rpcs.create_job.metadata.to_h
|
192
|
+
|
193
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
194
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
195
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
196
|
+
gapic_version: ::Google::Cloud::Dataflow::V1beta3::VERSION,
|
197
|
+
transports_version_send: [:rest]
|
198
|
+
|
199
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
200
|
+
|
201
|
+
options.apply_defaults timeout: @config.rpcs.create_job.timeout,
|
202
|
+
metadata: call_metadata,
|
203
|
+
retry_policy: @config.rpcs.create_job.retry_policy
|
204
|
+
|
205
|
+
options.apply_defaults timeout: @config.timeout,
|
206
|
+
metadata: @config.metadata,
|
207
|
+
retry_policy: @config.retry_policy
|
208
|
+
|
209
|
+
@jobs_stub.create_job request, options do |result, operation|
|
210
|
+
yield result, operation if block_given?
|
211
|
+
return result
|
212
|
+
end
|
213
|
+
rescue ::Gapic::Rest::Error => e
|
214
|
+
raise ::Google::Cloud::Error.from_error(e)
|
215
|
+
end
|
216
|
+
|
217
|
+
##
|
218
|
+
# Gets the state of the specified Cloud Dataflow job.
|
219
|
+
#
|
220
|
+
# To get the state of a job, we recommend using `projects.locations.jobs.get`
|
221
|
+
# with a [regional endpoint]
|
222
|
+
# (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
|
223
|
+
# `projects.jobs.get` is not recommended, as you can only get the state of
|
224
|
+
# jobs that are running in `us-central1`.
|
225
|
+
#
|
226
|
+
# @overload get_job(request, options = nil)
|
227
|
+
# Pass arguments to `get_job` via a request object, either of type
|
228
|
+
# {::Google::Cloud::Dataflow::V1beta3::GetJobRequest} or an equivalent Hash.
|
229
|
+
#
|
230
|
+
# @param request [::Google::Cloud::Dataflow::V1beta3::GetJobRequest, ::Hash]
|
231
|
+
# A request object representing the call parameters. Required. To specify no
|
232
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
233
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
234
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
235
|
+
#
|
236
|
+
# @overload get_job(project_id: nil, job_id: nil, view: nil, location: nil)
|
237
|
+
# Pass arguments to `get_job` via keyword arguments. Note that at
|
238
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
239
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
240
|
+
#
|
241
|
+
# @param project_id [::String]
|
242
|
+
# The ID of the Cloud Platform project that the job belongs to.
|
243
|
+
# @param job_id [::String]
|
244
|
+
# The job ID.
|
245
|
+
# @param view [::Google::Cloud::Dataflow::V1beta3::JobView]
|
246
|
+
# The level of information requested in response.
|
247
|
+
# @param location [::String]
|
248
|
+
# The [regional endpoint]
|
249
|
+
# (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
|
250
|
+
# contains this job.
|
251
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
252
|
+
# @yieldparam result [::Google::Cloud::Dataflow::V1beta3::Job]
|
253
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
254
|
+
#
|
255
|
+
# @return [::Google::Cloud::Dataflow::V1beta3::Job]
|
256
|
+
#
|
257
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
258
|
+
def get_job request, options = nil
|
259
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
260
|
+
|
261
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataflow::V1beta3::GetJobRequest
|
262
|
+
|
263
|
+
# Converts hash and nil to an options object
|
264
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
265
|
+
|
266
|
+
# Customize the options with defaults
|
267
|
+
call_metadata = @config.rpcs.get_job.metadata.to_h
|
268
|
+
|
269
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
270
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
271
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
272
|
+
gapic_version: ::Google::Cloud::Dataflow::V1beta3::VERSION,
|
273
|
+
transports_version_send: [:rest]
|
274
|
+
|
275
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
276
|
+
|
277
|
+
options.apply_defaults timeout: @config.rpcs.get_job.timeout,
|
278
|
+
metadata: call_metadata,
|
279
|
+
retry_policy: @config.rpcs.get_job.retry_policy
|
280
|
+
|
281
|
+
options.apply_defaults timeout: @config.timeout,
|
282
|
+
metadata: @config.metadata,
|
283
|
+
retry_policy: @config.retry_policy
|
284
|
+
|
285
|
+
@jobs_stub.get_job request, options do |result, operation|
|
286
|
+
yield result, operation if block_given?
|
287
|
+
return result
|
288
|
+
end
|
289
|
+
rescue ::Gapic::Rest::Error => e
|
290
|
+
raise ::Google::Cloud::Error.from_error(e)
|
291
|
+
end
|
292
|
+
|
293
|
+
##
|
294
|
+
# Updates the state of an existing Cloud Dataflow job.
|
295
|
+
#
|
296
|
+
# To update the state of an existing job, we recommend using
|
297
|
+
# `projects.locations.jobs.update` with a [regional endpoint]
|
298
|
+
# (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
|
299
|
+
# `projects.jobs.update` is not recommended, as you can only update the state
|
300
|
+
# of jobs that are running in `us-central1`.
|
301
|
+
#
|
302
|
+
# @overload update_job(request, options = nil)
|
303
|
+
# Pass arguments to `update_job` via a request object, either of type
|
304
|
+
# {::Google::Cloud::Dataflow::V1beta3::UpdateJobRequest} or an equivalent Hash.
|
305
|
+
#
|
306
|
+
# @param request [::Google::Cloud::Dataflow::V1beta3::UpdateJobRequest, ::Hash]
|
307
|
+
# A request object representing the call parameters. Required. To specify no
|
308
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
309
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
310
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
311
|
+
#
|
312
|
+
# @overload update_job(project_id: nil, job_id: nil, job: nil, location: nil)
|
313
|
+
# Pass arguments to `update_job` via keyword arguments. Note that at
|
314
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
315
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
316
|
+
#
|
317
|
+
# @param project_id [::String]
|
318
|
+
# The ID of the Cloud Platform project that the job belongs to.
|
319
|
+
# @param job_id [::String]
|
320
|
+
# The job ID.
|
321
|
+
# @param job [::Google::Cloud::Dataflow::V1beta3::Job, ::Hash]
|
322
|
+
# The updated job.
|
323
|
+
# Only the job state is updatable; other fields will be ignored.
|
324
|
+
# @param location [::String]
|
325
|
+
# The [regional endpoint]
|
326
|
+
# (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
|
327
|
+
# contains this job.
|
328
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
329
|
+
# @yieldparam result [::Google::Cloud::Dataflow::V1beta3::Job]
|
330
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
331
|
+
#
|
332
|
+
# @return [::Google::Cloud::Dataflow::V1beta3::Job]
|
333
|
+
#
|
334
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
335
|
+
def update_job request, options = nil
|
336
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
337
|
+
|
338
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataflow::V1beta3::UpdateJobRequest
|
339
|
+
|
340
|
+
# Converts hash and nil to an options object
|
341
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
342
|
+
|
343
|
+
# Customize the options with defaults
|
344
|
+
call_metadata = @config.rpcs.update_job.metadata.to_h
|
345
|
+
|
346
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
347
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
348
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
349
|
+
gapic_version: ::Google::Cloud::Dataflow::V1beta3::VERSION,
|
350
|
+
transports_version_send: [:rest]
|
351
|
+
|
352
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
353
|
+
|
354
|
+
options.apply_defaults timeout: @config.rpcs.update_job.timeout,
|
355
|
+
metadata: call_metadata,
|
356
|
+
retry_policy: @config.rpcs.update_job.retry_policy
|
357
|
+
|
358
|
+
options.apply_defaults timeout: @config.timeout,
|
359
|
+
metadata: @config.metadata,
|
360
|
+
retry_policy: @config.retry_policy
|
361
|
+
|
362
|
+
@jobs_stub.update_job request, options do |result, operation|
|
363
|
+
yield result, operation if block_given?
|
364
|
+
return result
|
365
|
+
end
|
366
|
+
rescue ::Gapic::Rest::Error => e
|
367
|
+
raise ::Google::Cloud::Error.from_error(e)
|
368
|
+
end
|
369
|
+
|
370
|
+
##
|
371
|
+
# List the jobs of a project.
|
372
|
+
#
|
373
|
+
# To list the jobs of a project in a region, we recommend using
|
374
|
+
# `projects.locations.jobs.list` with a [regional endpoint]
|
375
|
+
# (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). To
|
376
|
+
# list the all jobs across all regions, use `projects.jobs.aggregated`. Using
|
377
|
+
# `projects.jobs.list` is not recommended, as you can only get the list of
|
378
|
+
# jobs that are running in `us-central1`.
|
379
|
+
#
|
380
|
+
# @overload list_jobs(request, options = nil)
|
381
|
+
# Pass arguments to `list_jobs` via a request object, either of type
|
382
|
+
# {::Google::Cloud::Dataflow::V1beta3::ListJobsRequest} or an equivalent Hash.
|
383
|
+
#
|
384
|
+
# @param request [::Google::Cloud::Dataflow::V1beta3::ListJobsRequest, ::Hash]
|
385
|
+
# A request object representing the call parameters. Required. To specify no
|
386
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
387
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
388
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
389
|
+
#
|
390
|
+
# @overload list_jobs(filter: nil, project_id: nil, view: nil, page_size: nil, page_token: nil, location: nil)
|
391
|
+
# Pass arguments to `list_jobs` via keyword arguments. Note that at
|
392
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
393
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
394
|
+
#
|
395
|
+
# @param filter [::Google::Cloud::Dataflow::V1beta3::ListJobsRequest::Filter]
|
396
|
+
# The kind of filter to use.
|
397
|
+
# @param project_id [::String]
|
398
|
+
# The project which owns the jobs.
|
399
|
+
# @param view [::Google::Cloud::Dataflow::V1beta3::JobView]
|
400
|
+
# Deprecated. ListJobs always returns summaries now.
|
401
|
+
# Use GetJob for other JobViews.
|
402
|
+
# @param page_size [::Integer]
|
403
|
+
# If there are many jobs, limit response to at most this many.
|
404
|
+
# The actual number of jobs returned will be the lesser of max_responses
|
405
|
+
# and an unspecified server-defined limit.
|
406
|
+
# @param page_token [::String]
|
407
|
+
# Set this to the 'next_page_token' field of a previous response
|
408
|
+
# to request additional results in a long list.
|
409
|
+
# @param location [::String]
|
410
|
+
# The [regional endpoint]
|
411
|
+
# (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
|
412
|
+
# contains this job.
|
413
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
414
|
+
# @yieldparam result [::Google::Cloud::Dataflow::V1beta3::ListJobsResponse]
|
415
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
416
|
+
#
|
417
|
+
# @return [::Google::Cloud::Dataflow::V1beta3::ListJobsResponse]
|
418
|
+
#
|
419
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
420
|
+
def list_jobs request, options = nil
|
421
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
422
|
+
|
423
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataflow::V1beta3::ListJobsRequest
|
424
|
+
|
425
|
+
# Converts hash and nil to an options object
|
426
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
427
|
+
|
428
|
+
# Customize the options with defaults
|
429
|
+
call_metadata = @config.rpcs.list_jobs.metadata.to_h
|
430
|
+
|
431
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
432
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
433
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
434
|
+
gapic_version: ::Google::Cloud::Dataflow::V1beta3::VERSION,
|
435
|
+
transports_version_send: [:rest]
|
436
|
+
|
437
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
438
|
+
|
439
|
+
options.apply_defaults timeout: @config.rpcs.list_jobs.timeout,
|
440
|
+
metadata: call_metadata,
|
441
|
+
retry_policy: @config.rpcs.list_jobs.retry_policy
|
442
|
+
|
443
|
+
options.apply_defaults timeout: @config.timeout,
|
444
|
+
metadata: @config.metadata,
|
445
|
+
retry_policy: @config.retry_policy
|
446
|
+
|
447
|
+
@jobs_stub.list_jobs request, options do |result, operation|
|
448
|
+
yield result, operation if block_given?
|
449
|
+
return result
|
450
|
+
end
|
451
|
+
rescue ::Gapic::Rest::Error => e
|
452
|
+
raise ::Google::Cloud::Error.from_error(e)
|
453
|
+
end
|
454
|
+
|
455
|
+
##
|
456
|
+
# List the jobs of a project across all regions.
|
457
|
+
#
|
458
|
+
# @overload aggregated_list_jobs(request, options = nil)
|
459
|
+
# Pass arguments to `aggregated_list_jobs` via a request object, either of type
|
460
|
+
# {::Google::Cloud::Dataflow::V1beta3::ListJobsRequest} or an equivalent Hash.
|
461
|
+
#
|
462
|
+
# @param request [::Google::Cloud::Dataflow::V1beta3::ListJobsRequest, ::Hash]
|
463
|
+
# A request object representing the call parameters. Required. To specify no
|
464
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
465
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
466
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
467
|
+
#
|
468
|
+
# @overload aggregated_list_jobs(filter: nil, project_id: nil, view: nil, page_size: nil, page_token: nil, location: nil)
|
469
|
+
# Pass arguments to `aggregated_list_jobs` via keyword arguments. Note that at
|
470
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
471
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
472
|
+
#
|
473
|
+
# @param filter [::Google::Cloud::Dataflow::V1beta3::ListJobsRequest::Filter]
|
474
|
+
# The kind of filter to use.
|
475
|
+
# @param project_id [::String]
|
476
|
+
# The project which owns the jobs.
|
477
|
+
# @param view [::Google::Cloud::Dataflow::V1beta3::JobView]
|
478
|
+
# Deprecated. ListJobs always returns summaries now.
|
479
|
+
# Use GetJob for other JobViews.
|
480
|
+
# @param page_size [::Integer]
|
481
|
+
# If there are many jobs, limit response to at most this many.
|
482
|
+
# The actual number of jobs returned will be the lesser of max_responses
|
483
|
+
# and an unspecified server-defined limit.
|
484
|
+
# @param page_token [::String]
|
485
|
+
# Set this to the 'next_page_token' field of a previous response
|
486
|
+
# to request additional results in a long list.
|
487
|
+
# @param location [::String]
|
488
|
+
# The [regional endpoint]
|
489
|
+
# (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
|
490
|
+
# contains this job.
|
491
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
492
|
+
# @yieldparam result [::Google::Cloud::Dataflow::V1beta3::ListJobsResponse]
|
493
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
494
|
+
#
|
495
|
+
# @return [::Google::Cloud::Dataflow::V1beta3::ListJobsResponse]
|
496
|
+
#
|
497
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
498
|
+
def aggregated_list_jobs request, options = nil
|
499
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
500
|
+
|
501
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataflow::V1beta3::ListJobsRequest
|
502
|
+
|
503
|
+
# Converts hash and nil to an options object
|
504
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
505
|
+
|
506
|
+
# Customize the options with defaults
|
507
|
+
call_metadata = @config.rpcs.aggregated_list_jobs.metadata.to_h
|
508
|
+
|
509
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
510
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
511
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
512
|
+
gapic_version: ::Google::Cloud::Dataflow::V1beta3::VERSION,
|
513
|
+
transports_version_send: [:rest]
|
514
|
+
|
515
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
516
|
+
|
517
|
+
options.apply_defaults timeout: @config.rpcs.aggregated_list_jobs.timeout,
|
518
|
+
metadata: call_metadata,
|
519
|
+
retry_policy: @config.rpcs.aggregated_list_jobs.retry_policy
|
520
|
+
|
521
|
+
options.apply_defaults timeout: @config.timeout,
|
522
|
+
metadata: @config.metadata,
|
523
|
+
retry_policy: @config.retry_policy
|
524
|
+
|
525
|
+
@jobs_stub.aggregated_list_jobs request, options do |result, operation|
|
526
|
+
yield result, operation if block_given?
|
527
|
+
return result
|
528
|
+
end
|
529
|
+
rescue ::Gapic::Rest::Error => e
|
530
|
+
raise ::Google::Cloud::Error.from_error(e)
|
531
|
+
end
|
532
|
+
|
533
|
+
##
|
534
|
+
# Snapshot the state of a streaming job.
|
535
|
+
#
|
536
|
+
# @overload snapshot_job(request, options = nil)
|
537
|
+
# Pass arguments to `snapshot_job` via a request object, either of type
|
538
|
+
# {::Google::Cloud::Dataflow::V1beta3::SnapshotJobRequest} or an equivalent Hash.
|
539
|
+
#
|
540
|
+
# @param request [::Google::Cloud::Dataflow::V1beta3::SnapshotJobRequest, ::Hash]
|
541
|
+
# A request object representing the call parameters. Required. To specify no
|
542
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
543
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
544
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
545
|
+
#
|
546
|
+
# @overload snapshot_job(project_id: nil, job_id: nil, ttl: nil, location: nil, snapshot_sources: nil, description: nil)
|
547
|
+
# Pass arguments to `snapshot_job` via keyword arguments. Note that at
|
548
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
549
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
550
|
+
#
|
551
|
+
# @param project_id [::String]
|
552
|
+
# The project which owns the job to be snapshotted.
|
553
|
+
# @param job_id [::String]
|
554
|
+
# The job to be snapshotted.
|
555
|
+
# @param ttl [::Google::Protobuf::Duration, ::Hash]
|
556
|
+
# TTL for the snapshot.
|
557
|
+
# @param location [::String]
|
558
|
+
# The location that contains this job.
|
559
|
+
# @param snapshot_sources [::Boolean]
|
560
|
+
# If true, perform snapshots for sources which support this.
|
561
|
+
# @param description [::String]
|
562
|
+
# User specified description of the snapshot. Maybe empty.
|
563
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
564
|
+
# @yieldparam result [::Google::Cloud::Dataflow::V1beta3::Snapshot]
|
565
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
566
|
+
#
|
567
|
+
# @return [::Google::Cloud::Dataflow::V1beta3::Snapshot]
|
568
|
+
#
|
569
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
570
|
+
def snapshot_job request, options = nil
|
571
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
572
|
+
|
573
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataflow::V1beta3::SnapshotJobRequest
|
574
|
+
|
575
|
+
# Converts hash and nil to an options object
|
576
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
577
|
+
|
578
|
+
# Customize the options with defaults
|
579
|
+
call_metadata = @config.rpcs.snapshot_job.metadata.to_h
|
580
|
+
|
581
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
582
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
583
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
584
|
+
gapic_version: ::Google::Cloud::Dataflow::V1beta3::VERSION,
|
585
|
+
transports_version_send: [:rest]
|
586
|
+
|
587
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
588
|
+
|
589
|
+
options.apply_defaults timeout: @config.rpcs.snapshot_job.timeout,
|
590
|
+
metadata: call_metadata,
|
591
|
+
retry_policy: @config.rpcs.snapshot_job.retry_policy
|
592
|
+
|
593
|
+
options.apply_defaults timeout: @config.timeout,
|
594
|
+
metadata: @config.metadata,
|
595
|
+
retry_policy: @config.retry_policy
|
596
|
+
|
597
|
+
@jobs_stub.snapshot_job request, options do |result, operation|
|
598
|
+
yield result, operation if block_given?
|
599
|
+
return result
|
600
|
+
end
|
601
|
+
rescue ::Gapic::Rest::Error => e
|
602
|
+
raise ::Google::Cloud::Error.from_error(e)
|
603
|
+
end
|
604
|
+
|
605
|
+
##
|
606
|
+
# Configuration class for the Jobs REST API.
|
607
|
+
#
|
608
|
+
# This class represents the configuration for Jobs REST,
|
609
|
+
# providing control over timeouts, retry behavior, logging, transport
|
610
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
611
|
+
# applied individually to specific RPCs. See
|
612
|
+
# {::Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client::Configuration::Rpcs}
|
613
|
+
# for a list of RPCs that can be configured independently.
|
614
|
+
#
|
615
|
+
# Configuration can be applied globally to all clients, or to a single client
|
616
|
+
# on construction.
|
617
|
+
#
|
618
|
+
# @example
|
619
|
+
#
|
620
|
+
# # Modify the global config, setting the timeout for
|
621
|
+
# # create_job to 20 seconds,
|
622
|
+
# # and all remaining timeouts to 10 seconds.
|
623
|
+
# ::Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client.configure do |config|
|
624
|
+
# config.timeout = 10.0
|
625
|
+
# config.rpcs.create_job.timeout = 20.0
|
626
|
+
# end
|
627
|
+
#
|
628
|
+
# # Apply the above configuration only to a new client.
|
629
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client.new do |config|
|
630
|
+
# config.timeout = 10.0
|
631
|
+
# config.rpcs.create_job.timeout = 20.0
|
632
|
+
# end
|
633
|
+
#
|
634
|
+
# @!attribute [rw] endpoint
|
635
|
+
# The hostname or hostname:port of the service endpoint.
|
636
|
+
# Defaults to `"dataflow.googleapis.com"`.
|
637
|
+
# @return [::String]
|
638
|
+
# @!attribute [rw] credentials
|
639
|
+
# Credentials to send with calls. You may provide any of the following types:
|
640
|
+
# * (`String`) The path to a service account key file in JSON format
|
641
|
+
# * (`Hash`) A service account key as a Hash
|
642
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
643
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
644
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
645
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
646
|
+
# * (`nil`) indicating no credentials
|
647
|
+
# @return [::Object]
|
648
|
+
# @!attribute [rw] scope
|
649
|
+
# The OAuth scopes
|
650
|
+
# @return [::Array<::String>]
|
651
|
+
# @!attribute [rw] lib_name
|
652
|
+
# The library name as recorded in instrumentation and logging
|
653
|
+
# @return [::String]
|
654
|
+
# @!attribute [rw] lib_version
|
655
|
+
# The library version as recorded in instrumentation and logging
|
656
|
+
# @return [::String]
|
657
|
+
# @!attribute [rw] timeout
|
658
|
+
# The call timeout in seconds.
|
659
|
+
# @return [::Numeric]
|
660
|
+
# @!attribute [rw] metadata
|
661
|
+
# Additional headers to be sent with the call.
|
662
|
+
# @return [::Hash{::Symbol=>::String}]
|
663
|
+
# @!attribute [rw] retry_policy
|
664
|
+
# The retry policy. The value is a hash with the following keys:
|
665
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
666
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
667
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
668
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
669
|
+
# trigger a retry.
|
670
|
+
# @return [::Hash]
|
671
|
+
# @!attribute [rw] quota_project
|
672
|
+
# A separate project against which to charge quota.
|
673
|
+
# @return [::String]
|
674
|
+
#
|
675
|
+
class Configuration
|
676
|
+
extend ::Gapic::Config
|
677
|
+
|
678
|
+
config_attr :endpoint, "dataflow.googleapis.com", ::String
|
679
|
+
config_attr :credentials, nil do |value|
|
680
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
681
|
+
allowed.any? { |klass| klass === value }
|
682
|
+
end
|
683
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
684
|
+
config_attr :lib_name, nil, ::String, nil
|
685
|
+
config_attr :lib_version, nil, ::String, nil
|
686
|
+
config_attr :timeout, nil, ::Numeric, nil
|
687
|
+
config_attr :metadata, nil, ::Hash, nil
|
688
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
689
|
+
config_attr :quota_project, nil, ::String, nil
|
690
|
+
|
691
|
+
# @private
|
692
|
+
def initialize parent_config = nil
|
693
|
+
@parent_config = parent_config unless parent_config.nil?
|
694
|
+
|
695
|
+
yield self if block_given?
|
696
|
+
end
|
697
|
+
|
698
|
+
##
|
699
|
+
# Configurations for individual RPCs
|
700
|
+
# @return [Rpcs]
|
701
|
+
#
|
702
|
+
def rpcs
|
703
|
+
@rpcs ||= begin
|
704
|
+
parent_rpcs = nil
|
705
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
706
|
+
Rpcs.new parent_rpcs
|
707
|
+
end
|
708
|
+
end
|
709
|
+
|
710
|
+
##
|
711
|
+
# Configuration RPC class for the Jobs API.
|
712
|
+
#
|
713
|
+
# Includes fields providing the configuration for each RPC in this service.
|
714
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
715
|
+
# the following configuration fields:
|
716
|
+
#
|
717
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
718
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
719
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
720
|
+
# include the following keys:
|
721
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
722
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
723
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
724
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
725
|
+
# trigger a retry.
|
726
|
+
#
|
727
|
+
class Rpcs
|
728
|
+
##
|
729
|
+
# RPC-specific configuration for `create_job`
|
730
|
+
# @return [::Gapic::Config::Method]
|
731
|
+
#
|
732
|
+
attr_reader :create_job
|
733
|
+
##
|
734
|
+
# RPC-specific configuration for `get_job`
|
735
|
+
# @return [::Gapic::Config::Method]
|
736
|
+
#
|
737
|
+
attr_reader :get_job
|
738
|
+
##
|
739
|
+
# RPC-specific configuration for `update_job`
|
740
|
+
# @return [::Gapic::Config::Method]
|
741
|
+
#
|
742
|
+
attr_reader :update_job
|
743
|
+
##
|
744
|
+
# RPC-specific configuration for `list_jobs`
|
745
|
+
# @return [::Gapic::Config::Method]
|
746
|
+
#
|
747
|
+
attr_reader :list_jobs
|
748
|
+
##
|
749
|
+
# RPC-specific configuration for `aggregated_list_jobs`
|
750
|
+
# @return [::Gapic::Config::Method]
|
751
|
+
#
|
752
|
+
attr_reader :aggregated_list_jobs
|
753
|
+
##
|
754
|
+
# RPC-specific configuration for `snapshot_job`
|
755
|
+
# @return [::Gapic::Config::Method]
|
756
|
+
#
|
757
|
+
attr_reader :snapshot_job
|
758
|
+
|
759
|
+
# @private
|
760
|
+
def initialize parent_rpcs = nil
|
761
|
+
create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job
|
762
|
+
@create_job = ::Gapic::Config::Method.new create_job_config
|
763
|
+
get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job
|
764
|
+
@get_job = ::Gapic::Config::Method.new get_job_config
|
765
|
+
update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job
|
766
|
+
@update_job = ::Gapic::Config::Method.new update_job_config
|
767
|
+
list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs
|
768
|
+
@list_jobs = ::Gapic::Config::Method.new list_jobs_config
|
769
|
+
aggregated_list_jobs_config = parent_rpcs.aggregated_list_jobs if parent_rpcs.respond_to? :aggregated_list_jobs
|
770
|
+
@aggregated_list_jobs = ::Gapic::Config::Method.new aggregated_list_jobs_config
|
771
|
+
snapshot_job_config = parent_rpcs.snapshot_job if parent_rpcs.respond_to? :snapshot_job
|
772
|
+
@snapshot_job = ::Gapic::Config::Method.new snapshot_job_config
|
773
|
+
|
774
|
+
yield self if block_given?
|
775
|
+
end
|
776
|
+
end
|
777
|
+
end
|
778
|
+
end
|
779
|
+
end
|
780
|
+
end
|
781
|
+
end
|
782
|
+
end
|
783
|
+
end
|
784
|
+
end
|