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