google-cloud-dataflow-v1beta3 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/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,522 @@
|
|
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/templates_pb"
|
21
|
+
require "google/cloud/dataflow/v1beta3/templates_service/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module Dataflow
|
26
|
+
module V1beta3
|
27
|
+
module TemplatesService
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the TemplatesService service.
|
31
|
+
#
|
32
|
+
# Provides a method to create Cloud Dataflow jobs from templates.
|
33
|
+
#
|
34
|
+
class Client
|
35
|
+
# @private
|
36
|
+
attr_reader :templates_service_stub
|
37
|
+
|
38
|
+
##
|
39
|
+
# Configure the TemplatesService Client class.
|
40
|
+
#
|
41
|
+
# See {::Google::Cloud::Dataflow::V1beta3::TemplatesService::Rest::Client::Configuration}
|
42
|
+
# for a description of the configuration fields.
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
#
|
46
|
+
# # Modify the configuration for all TemplatesService clients
|
47
|
+
# ::Google::Cloud::Dataflow::V1beta3::TemplatesService::Rest::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 TemplatesService 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::TemplatesService::Rest::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 TemplatesService REST client object.
|
97
|
+
#
|
98
|
+
# @example
|
99
|
+
#
|
100
|
+
# # Create a client using the default configuration
|
101
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::TemplatesService::Rest::Client.new
|
102
|
+
#
|
103
|
+
# # Create a client using a custom configuration
|
104
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::TemplatesService::Rest::Client.new do |config|
|
105
|
+
# config.timeout = 10.0
|
106
|
+
# end
|
107
|
+
#
|
108
|
+
# @yield [config] Configure the TemplatesService client.
|
109
|
+
# @yieldparam config [Client::Configuration]
|
110
|
+
#
|
111
|
+
def initialize
|
112
|
+
# Create the configuration object
|
113
|
+
@config = Configuration.new Client.configure
|
114
|
+
|
115
|
+
# Yield the configuration if needed
|
116
|
+
yield @config if block_given?
|
117
|
+
|
118
|
+
# Create credentials
|
119
|
+
credentials = @config.credentials
|
120
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
121
|
+
# but only if the default endpoint does not have a region prefix.
|
122
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
123
|
+
!@config.endpoint.split(".").first.include?("-")
|
124
|
+
credentials ||= Credentials.default scope: @config.scope,
|
125
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
126
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
127
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
128
|
+
end
|
129
|
+
|
130
|
+
@quota_project_id = @config.quota_project
|
131
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
132
|
+
|
133
|
+
@templates_service_stub = ::Google::Cloud::Dataflow::V1beta3::TemplatesService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
134
|
+
end
|
135
|
+
|
136
|
+
# Service calls
|
137
|
+
|
138
|
+
##
|
139
|
+
# Creates a Cloud Dataflow job from a template.
|
140
|
+
#
|
141
|
+
# @overload create_job_from_template(request, options = nil)
|
142
|
+
# Pass arguments to `create_job_from_template` via a request object, either of type
|
143
|
+
# {::Google::Cloud::Dataflow::V1beta3::CreateJobFromTemplateRequest} or an equivalent Hash.
|
144
|
+
#
|
145
|
+
# @param request [::Google::Cloud::Dataflow::V1beta3::CreateJobFromTemplateRequest, ::Hash]
|
146
|
+
# A request object representing the call parameters. Required. To specify no
|
147
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
148
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
149
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
150
|
+
#
|
151
|
+
# @overload create_job_from_template(project_id: nil, job_name: nil, gcs_path: nil, parameters: nil, environment: nil, location: nil)
|
152
|
+
# Pass arguments to `create_job_from_template` via keyword arguments. Note that at
|
153
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
154
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
155
|
+
#
|
156
|
+
# @param project_id [::String]
|
157
|
+
# Required. The ID of the Cloud Platform project that the job belongs to.
|
158
|
+
# @param job_name [::String]
|
159
|
+
# Required. The job name to use for the created job.
|
160
|
+
# @param gcs_path [::String]
|
161
|
+
# Required. A Cloud Storage path to the template from which to
|
162
|
+
# create the job.
|
163
|
+
# Must be a valid Cloud Storage URL, beginning with `gs://`.
|
164
|
+
# @param parameters [::Hash{::String => ::String}]
|
165
|
+
# The runtime parameters to pass to the job.
|
166
|
+
# @param environment [::Google::Cloud::Dataflow::V1beta3::RuntimeEnvironment, ::Hash]
|
167
|
+
# The runtime environment for the job.
|
168
|
+
# @param location [::String]
|
169
|
+
# The [regional endpoint]
|
170
|
+
# (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to
|
171
|
+
# which to direct the request.
|
172
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
173
|
+
# @yieldparam result [::Google::Cloud::Dataflow::V1beta3::Job]
|
174
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
175
|
+
#
|
176
|
+
# @return [::Google::Cloud::Dataflow::V1beta3::Job]
|
177
|
+
#
|
178
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
179
|
+
def create_job_from_template request, options = nil
|
180
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
181
|
+
|
182
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataflow::V1beta3::CreateJobFromTemplateRequest
|
183
|
+
|
184
|
+
# Converts hash and nil to an options object
|
185
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
186
|
+
|
187
|
+
# Customize the options with defaults
|
188
|
+
call_metadata = @config.rpcs.create_job_from_template.metadata.to_h
|
189
|
+
|
190
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
191
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
192
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
193
|
+
gapic_version: ::Google::Cloud::Dataflow::V1beta3::VERSION,
|
194
|
+
transports_version_send: [:rest]
|
195
|
+
|
196
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
197
|
+
|
198
|
+
options.apply_defaults timeout: @config.rpcs.create_job_from_template.timeout,
|
199
|
+
metadata: call_metadata,
|
200
|
+
retry_policy: @config.rpcs.create_job_from_template.retry_policy
|
201
|
+
|
202
|
+
options.apply_defaults timeout: @config.timeout,
|
203
|
+
metadata: @config.metadata,
|
204
|
+
retry_policy: @config.retry_policy
|
205
|
+
|
206
|
+
@templates_service_stub.create_job_from_template request, options do |result, operation|
|
207
|
+
yield result, operation if block_given?
|
208
|
+
return result
|
209
|
+
end
|
210
|
+
rescue ::Gapic::Rest::Error => e
|
211
|
+
raise ::Google::Cloud::Error.from_error(e)
|
212
|
+
end
|
213
|
+
|
214
|
+
##
|
215
|
+
# Launch a template.
|
216
|
+
#
|
217
|
+
# @overload launch_template(request, options = nil)
|
218
|
+
# Pass arguments to `launch_template` via a request object, either of type
|
219
|
+
# {::Google::Cloud::Dataflow::V1beta3::LaunchTemplateRequest} or an equivalent Hash.
|
220
|
+
#
|
221
|
+
# @param request [::Google::Cloud::Dataflow::V1beta3::LaunchTemplateRequest, ::Hash]
|
222
|
+
# A request object representing the call parameters. Required. To specify no
|
223
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
224
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
225
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
226
|
+
#
|
227
|
+
# @overload launch_template(project_id: nil, validate_only: nil, gcs_path: nil, dynamic_template: nil, launch_parameters: nil, location: nil)
|
228
|
+
# Pass arguments to `launch_template` via keyword arguments. Note that at
|
229
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
230
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
231
|
+
#
|
232
|
+
# @param project_id [::String]
|
233
|
+
# Required. The ID of the Cloud Platform project that the job belongs to.
|
234
|
+
# @param validate_only [::Boolean]
|
235
|
+
# If true, the request is validated but not actually executed.
|
236
|
+
# Defaults to false.
|
237
|
+
# @param gcs_path [::String]
|
238
|
+
# A Cloud Storage path to the template from which to create
|
239
|
+
# the job.
|
240
|
+
# Must be valid Cloud Storage URL, beginning with 'gs://'.
|
241
|
+
# @param dynamic_template [::Google::Cloud::Dataflow::V1beta3::DynamicTemplateLaunchParams, ::Hash]
|
242
|
+
# Params for launching a dynamic template.
|
243
|
+
# @param launch_parameters [::Google::Cloud::Dataflow::V1beta3::LaunchTemplateParameters, ::Hash]
|
244
|
+
# The parameters of the template to launch. This should be part of the
|
245
|
+
# body of the POST request.
|
246
|
+
# @param location [::String]
|
247
|
+
# The [regional endpoint]
|
248
|
+
# (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to
|
249
|
+
# which to direct the request.
|
250
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
251
|
+
# @yieldparam result [::Google::Cloud::Dataflow::V1beta3::LaunchTemplateResponse]
|
252
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
253
|
+
#
|
254
|
+
# @return [::Google::Cloud::Dataflow::V1beta3::LaunchTemplateResponse]
|
255
|
+
#
|
256
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
257
|
+
def launch_template request, options = nil
|
258
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
259
|
+
|
260
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataflow::V1beta3::LaunchTemplateRequest
|
261
|
+
|
262
|
+
# Converts hash and nil to an options object
|
263
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
264
|
+
|
265
|
+
# Customize the options with defaults
|
266
|
+
call_metadata = @config.rpcs.launch_template.metadata.to_h
|
267
|
+
|
268
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
269
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
270
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
271
|
+
gapic_version: ::Google::Cloud::Dataflow::V1beta3::VERSION,
|
272
|
+
transports_version_send: [:rest]
|
273
|
+
|
274
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
275
|
+
|
276
|
+
options.apply_defaults timeout: @config.rpcs.launch_template.timeout,
|
277
|
+
metadata: call_metadata,
|
278
|
+
retry_policy: @config.rpcs.launch_template.retry_policy
|
279
|
+
|
280
|
+
options.apply_defaults timeout: @config.timeout,
|
281
|
+
metadata: @config.metadata,
|
282
|
+
retry_policy: @config.retry_policy
|
283
|
+
|
284
|
+
@templates_service_stub.launch_template request, options do |result, operation|
|
285
|
+
yield result, operation if block_given?
|
286
|
+
return result
|
287
|
+
end
|
288
|
+
rescue ::Gapic::Rest::Error => e
|
289
|
+
raise ::Google::Cloud::Error.from_error(e)
|
290
|
+
end
|
291
|
+
|
292
|
+
##
|
293
|
+
# Get the template associated with a template.
|
294
|
+
#
|
295
|
+
# @overload get_template(request, options = nil)
|
296
|
+
# Pass arguments to `get_template` via a request object, either of type
|
297
|
+
# {::Google::Cloud::Dataflow::V1beta3::GetTemplateRequest} or an equivalent Hash.
|
298
|
+
#
|
299
|
+
# @param request [::Google::Cloud::Dataflow::V1beta3::GetTemplateRequest, ::Hash]
|
300
|
+
# A request object representing the call parameters. Required. To specify no
|
301
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
302
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
303
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
304
|
+
#
|
305
|
+
# @overload get_template(project_id: nil, gcs_path: nil, view: nil, location: nil)
|
306
|
+
# Pass arguments to `get_template` via keyword arguments. Note that at
|
307
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
308
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
309
|
+
#
|
310
|
+
# @param project_id [::String]
|
311
|
+
# Required. The ID of the Cloud Platform project that the job belongs to.
|
312
|
+
# @param gcs_path [::String]
|
313
|
+
# Required. A Cloud Storage path to the template from which to
|
314
|
+
# create the job.
|
315
|
+
# Must be valid Cloud Storage URL, beginning with 'gs://'.
|
316
|
+
# @param view [::Google::Cloud::Dataflow::V1beta3::GetTemplateRequest::TemplateView]
|
317
|
+
# The view to retrieve. Defaults to METADATA_ONLY.
|
318
|
+
# @param location [::String]
|
319
|
+
# The [regional endpoint]
|
320
|
+
# (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to
|
321
|
+
# which to direct the request.
|
322
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
323
|
+
# @yieldparam result [::Google::Cloud::Dataflow::V1beta3::GetTemplateResponse]
|
324
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
325
|
+
#
|
326
|
+
# @return [::Google::Cloud::Dataflow::V1beta3::GetTemplateResponse]
|
327
|
+
#
|
328
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
329
|
+
def get_template request, options = nil
|
330
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
331
|
+
|
332
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataflow::V1beta3::GetTemplateRequest
|
333
|
+
|
334
|
+
# Converts hash and nil to an options object
|
335
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
336
|
+
|
337
|
+
# Customize the options with defaults
|
338
|
+
call_metadata = @config.rpcs.get_template.metadata.to_h
|
339
|
+
|
340
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
341
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
342
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
343
|
+
gapic_version: ::Google::Cloud::Dataflow::V1beta3::VERSION,
|
344
|
+
transports_version_send: [:rest]
|
345
|
+
|
346
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
347
|
+
|
348
|
+
options.apply_defaults timeout: @config.rpcs.get_template.timeout,
|
349
|
+
metadata: call_metadata,
|
350
|
+
retry_policy: @config.rpcs.get_template.retry_policy
|
351
|
+
|
352
|
+
options.apply_defaults timeout: @config.timeout,
|
353
|
+
metadata: @config.metadata,
|
354
|
+
retry_policy: @config.retry_policy
|
355
|
+
|
356
|
+
@templates_service_stub.get_template request, options do |result, operation|
|
357
|
+
yield result, operation if block_given?
|
358
|
+
return result
|
359
|
+
end
|
360
|
+
rescue ::Gapic::Rest::Error => e
|
361
|
+
raise ::Google::Cloud::Error.from_error(e)
|
362
|
+
end
|
363
|
+
|
364
|
+
##
|
365
|
+
# Configuration class for the TemplatesService REST API.
|
366
|
+
#
|
367
|
+
# This class represents the configuration for TemplatesService REST,
|
368
|
+
# providing control over timeouts, retry behavior, logging, transport
|
369
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
370
|
+
# applied individually to specific RPCs. See
|
371
|
+
# {::Google::Cloud::Dataflow::V1beta3::TemplatesService::Rest::Client::Configuration::Rpcs}
|
372
|
+
# for a list of RPCs that can be configured independently.
|
373
|
+
#
|
374
|
+
# Configuration can be applied globally to all clients, or to a single client
|
375
|
+
# on construction.
|
376
|
+
#
|
377
|
+
# @example
|
378
|
+
#
|
379
|
+
# # Modify the global config, setting the timeout for
|
380
|
+
# # create_job_from_template to 20 seconds,
|
381
|
+
# # and all remaining timeouts to 10 seconds.
|
382
|
+
# ::Google::Cloud::Dataflow::V1beta3::TemplatesService::Rest::Client.configure do |config|
|
383
|
+
# config.timeout = 10.0
|
384
|
+
# config.rpcs.create_job_from_template.timeout = 20.0
|
385
|
+
# end
|
386
|
+
#
|
387
|
+
# # Apply the above configuration only to a new client.
|
388
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::TemplatesService::Rest::Client.new do |config|
|
389
|
+
# config.timeout = 10.0
|
390
|
+
# config.rpcs.create_job_from_template.timeout = 20.0
|
391
|
+
# end
|
392
|
+
#
|
393
|
+
# @!attribute [rw] endpoint
|
394
|
+
# The hostname or hostname:port of the service endpoint.
|
395
|
+
# Defaults to `"dataflow.googleapis.com"`.
|
396
|
+
# @return [::String]
|
397
|
+
# @!attribute [rw] credentials
|
398
|
+
# Credentials to send with calls. You may provide any of the following types:
|
399
|
+
# * (`String`) The path to a service account key file in JSON format
|
400
|
+
# * (`Hash`) A service account key as a Hash
|
401
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
402
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
403
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
404
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
405
|
+
# * (`nil`) indicating no credentials
|
406
|
+
# @return [::Object]
|
407
|
+
# @!attribute [rw] scope
|
408
|
+
# The OAuth scopes
|
409
|
+
# @return [::Array<::String>]
|
410
|
+
# @!attribute [rw] lib_name
|
411
|
+
# The library name as recorded in instrumentation and logging
|
412
|
+
# @return [::String]
|
413
|
+
# @!attribute [rw] lib_version
|
414
|
+
# The library version as recorded in instrumentation and logging
|
415
|
+
# @return [::String]
|
416
|
+
# @!attribute [rw] timeout
|
417
|
+
# The call timeout in seconds.
|
418
|
+
# @return [::Numeric]
|
419
|
+
# @!attribute [rw] metadata
|
420
|
+
# Additional headers to be sent with the call.
|
421
|
+
# @return [::Hash{::Symbol=>::String}]
|
422
|
+
# @!attribute [rw] retry_policy
|
423
|
+
# The retry policy. The value is a hash with the following keys:
|
424
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
425
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
426
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
427
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
428
|
+
# trigger a retry.
|
429
|
+
# @return [::Hash]
|
430
|
+
# @!attribute [rw] quota_project
|
431
|
+
# A separate project against which to charge quota.
|
432
|
+
# @return [::String]
|
433
|
+
#
|
434
|
+
class Configuration
|
435
|
+
extend ::Gapic::Config
|
436
|
+
|
437
|
+
config_attr :endpoint, "dataflow.googleapis.com", ::String
|
438
|
+
config_attr :credentials, nil do |value|
|
439
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
440
|
+
allowed.any? { |klass| klass === value }
|
441
|
+
end
|
442
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
443
|
+
config_attr :lib_name, nil, ::String, nil
|
444
|
+
config_attr :lib_version, nil, ::String, nil
|
445
|
+
config_attr :timeout, nil, ::Numeric, nil
|
446
|
+
config_attr :metadata, nil, ::Hash, nil
|
447
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
448
|
+
config_attr :quota_project, nil, ::String, nil
|
449
|
+
|
450
|
+
# @private
|
451
|
+
def initialize parent_config = nil
|
452
|
+
@parent_config = parent_config unless parent_config.nil?
|
453
|
+
|
454
|
+
yield self if block_given?
|
455
|
+
end
|
456
|
+
|
457
|
+
##
|
458
|
+
# Configurations for individual RPCs
|
459
|
+
# @return [Rpcs]
|
460
|
+
#
|
461
|
+
def rpcs
|
462
|
+
@rpcs ||= begin
|
463
|
+
parent_rpcs = nil
|
464
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
465
|
+
Rpcs.new parent_rpcs
|
466
|
+
end
|
467
|
+
end
|
468
|
+
|
469
|
+
##
|
470
|
+
# Configuration RPC class for the TemplatesService API.
|
471
|
+
#
|
472
|
+
# Includes fields providing the configuration for each RPC in this service.
|
473
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
474
|
+
# the following configuration fields:
|
475
|
+
#
|
476
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
477
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
478
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
479
|
+
# include the following keys:
|
480
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
481
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
482
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
483
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
484
|
+
# trigger a retry.
|
485
|
+
#
|
486
|
+
class Rpcs
|
487
|
+
##
|
488
|
+
# RPC-specific configuration for `create_job_from_template`
|
489
|
+
# @return [::Gapic::Config::Method]
|
490
|
+
#
|
491
|
+
attr_reader :create_job_from_template
|
492
|
+
##
|
493
|
+
# RPC-specific configuration for `launch_template`
|
494
|
+
# @return [::Gapic::Config::Method]
|
495
|
+
#
|
496
|
+
attr_reader :launch_template
|
497
|
+
##
|
498
|
+
# RPC-specific configuration for `get_template`
|
499
|
+
# @return [::Gapic::Config::Method]
|
500
|
+
#
|
501
|
+
attr_reader :get_template
|
502
|
+
|
503
|
+
# @private
|
504
|
+
def initialize parent_rpcs = nil
|
505
|
+
create_job_from_template_config = parent_rpcs.create_job_from_template if parent_rpcs.respond_to? :create_job_from_template
|
506
|
+
@create_job_from_template = ::Gapic::Config::Method.new create_job_from_template_config
|
507
|
+
launch_template_config = parent_rpcs.launch_template if parent_rpcs.respond_to? :launch_template
|
508
|
+
@launch_template = ::Gapic::Config::Method.new launch_template_config
|
509
|
+
get_template_config = parent_rpcs.get_template if parent_rpcs.respond_to? :get_template
|
510
|
+
@get_template = ::Gapic::Config::Method.new get_template_config
|
511
|
+
|
512
|
+
yield self if block_given?
|
513
|
+
end
|
514
|
+
end
|
515
|
+
end
|
516
|
+
end
|
517
|
+
end
|
518
|
+
end
|
519
|
+
end
|
520
|
+
end
|
521
|
+
end
|
522
|
+
end
|