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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62d601b8ada8a63bf56004bcc7a5e95297400e0ac94774cefb8a13e593f3a74b
|
4
|
+
data.tar.gz: 70628efad8dc91093b273989c334514f3e56e8b96e84ba819a3451d9d9a89686
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9293307cba131f8ab55171b11365a220846f87811193ef0a8fff9aafd3af756b3e4de0dfda800e2f059c8b173ff834ce2ba59197515ffec5643feb5f39390688
|
7
|
+
data.tar.gz: 64d2fa9e3195596785d349429d56a1b0564087114c1c9677262f3ce1b4bdab3418d9f98565dc5aeee1b69410dfa7dd06ccc7c16421e075daa0b85297d98b4eb0
|
data/AUTHENTICATION.md
CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
|
|
114
114
|
To configure your system for this, simply:
|
115
115
|
|
116
116
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
117
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
117
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
118
118
|
3. Write code as if already authenticated.
|
119
119
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Ruby Client for the Dataflow V1beta3 API
|
2
2
|
|
3
|
-
|
3
|
+
Manages Google Cloud Dataflow projects on Google Cloud Platform.
|
4
4
|
|
5
5
|
Dataflow is a managed service for executing a wide variety of data processing patterns.
|
6
6
|
|
@@ -46,7 +46,7 @@ for general usage information.
|
|
46
46
|
## Enabling Logging
|
47
47
|
|
48
48
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
49
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/
|
49
|
+
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
|
50
50
|
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
51
51
|
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
52
52
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
@@ -0,0 +1,351 @@
|
|
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/flex_templates_service/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module Dataflow
|
26
|
+
module V1beta3
|
27
|
+
module FlexTemplatesService
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the FlexTemplatesService service.
|
31
|
+
#
|
32
|
+
# Provides a service for Flex templates. This feature is not ready yet.
|
33
|
+
#
|
34
|
+
class Client
|
35
|
+
# @private
|
36
|
+
attr_reader :flex_templates_service_stub
|
37
|
+
|
38
|
+
##
|
39
|
+
# Configure the FlexTemplatesService Client class.
|
40
|
+
#
|
41
|
+
# See {::Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Rest::Client::Configuration}
|
42
|
+
# for a description of the configuration fields.
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
#
|
46
|
+
# # Modify the configuration for all FlexTemplatesService clients
|
47
|
+
# ::Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::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
|
68
|
+
end
|
69
|
+
yield @configure if block_given?
|
70
|
+
@configure
|
71
|
+
end
|
72
|
+
|
73
|
+
##
|
74
|
+
# Configure the FlexTemplatesService Client instance.
|
75
|
+
#
|
76
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
77
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
78
|
+
# should be made on {Client.configure}.
|
79
|
+
#
|
80
|
+
# See {::Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Rest::Client::Configuration}
|
81
|
+
# for a description of the configuration fields.
|
82
|
+
#
|
83
|
+
# @yield [config] Configure the Client client.
|
84
|
+
# @yieldparam config [Client::Configuration]
|
85
|
+
#
|
86
|
+
# @return [Client::Configuration]
|
87
|
+
#
|
88
|
+
def configure
|
89
|
+
yield @config if block_given?
|
90
|
+
@config
|
91
|
+
end
|
92
|
+
|
93
|
+
##
|
94
|
+
# Create a new FlexTemplatesService REST client object.
|
95
|
+
#
|
96
|
+
# @example
|
97
|
+
#
|
98
|
+
# # Create a client using the default configuration
|
99
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Rest::Client.new
|
100
|
+
#
|
101
|
+
# # Create a client using a custom configuration
|
102
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Rest::Client.new do |config|
|
103
|
+
# config.timeout = 10.0
|
104
|
+
# end
|
105
|
+
#
|
106
|
+
# @yield [config] Configure the FlexTemplatesService client.
|
107
|
+
# @yieldparam config [Client::Configuration]
|
108
|
+
#
|
109
|
+
def initialize
|
110
|
+
# Create the configuration object
|
111
|
+
@config = Configuration.new Client.configure
|
112
|
+
|
113
|
+
# Yield the configuration if needed
|
114
|
+
yield @config if block_given?
|
115
|
+
|
116
|
+
# Create credentials
|
117
|
+
credentials = @config.credentials
|
118
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
119
|
+
# but only if the default endpoint does not have a region prefix.
|
120
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
121
|
+
!@config.endpoint.split(".").first.include?("-")
|
122
|
+
credentials ||= Credentials.default scope: @config.scope,
|
123
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
124
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
125
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
126
|
+
end
|
127
|
+
|
128
|
+
@quota_project_id = @config.quota_project
|
129
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
130
|
+
|
131
|
+
@flex_templates_service_stub = ::Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
132
|
+
end
|
133
|
+
|
134
|
+
# Service calls
|
135
|
+
|
136
|
+
##
|
137
|
+
# Launch a job with a FlexTemplate.
|
138
|
+
#
|
139
|
+
# @overload launch_flex_template(request, options = nil)
|
140
|
+
# Pass arguments to `launch_flex_template` via a request object, either of type
|
141
|
+
# {::Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateRequest} or an equivalent Hash.
|
142
|
+
#
|
143
|
+
# @param request [::Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateRequest, ::Hash]
|
144
|
+
# A request object representing the call parameters. Required. To specify no
|
145
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
146
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
147
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
148
|
+
#
|
149
|
+
# @overload launch_flex_template(project_id: nil, launch_parameter: nil, location: nil, validate_only: nil)
|
150
|
+
# Pass arguments to `launch_flex_template` via keyword arguments. Note that at
|
151
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
152
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
153
|
+
#
|
154
|
+
# @param project_id [::String]
|
155
|
+
# Required. The ID of the Cloud Platform project that the job belongs to.
|
156
|
+
# @param launch_parameter [::Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateParameter, ::Hash]
|
157
|
+
# Required. Parameter to launch a job form Flex Template.
|
158
|
+
# @param location [::String]
|
159
|
+
# Required. The [regional endpoint]
|
160
|
+
# (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to
|
161
|
+
# which to direct the request. E.g., us-central1, us-west1.
|
162
|
+
# @param validate_only [::Boolean]
|
163
|
+
# If true, the request is validated but not actually executed.
|
164
|
+
# Defaults to false.
|
165
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
166
|
+
# @yieldparam result [::Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateResponse]
|
167
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
168
|
+
#
|
169
|
+
# @return [::Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateResponse]
|
170
|
+
#
|
171
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
172
|
+
def launch_flex_template request, options = nil
|
173
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
174
|
+
|
175
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateRequest
|
176
|
+
|
177
|
+
# Converts hash and nil to an options object
|
178
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
179
|
+
|
180
|
+
# Customize the options with defaults
|
181
|
+
call_metadata = @config.rpcs.launch_flex_template.metadata.to_h
|
182
|
+
|
183
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
184
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
185
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
186
|
+
gapic_version: ::Google::Cloud::Dataflow::V1beta3::VERSION,
|
187
|
+
transports_version_send: [:rest]
|
188
|
+
|
189
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
190
|
+
|
191
|
+
options.apply_defaults timeout: @config.rpcs.launch_flex_template.timeout,
|
192
|
+
metadata: call_metadata,
|
193
|
+
retry_policy: @config.rpcs.launch_flex_template.retry_policy
|
194
|
+
|
195
|
+
options.apply_defaults timeout: @config.timeout,
|
196
|
+
metadata: @config.metadata,
|
197
|
+
retry_policy: @config.retry_policy
|
198
|
+
|
199
|
+
@flex_templates_service_stub.launch_flex_template request, options do |result, operation|
|
200
|
+
yield result, operation if block_given?
|
201
|
+
return result
|
202
|
+
end
|
203
|
+
rescue ::Gapic::Rest::Error => e
|
204
|
+
raise ::Google::Cloud::Error.from_error(e)
|
205
|
+
end
|
206
|
+
|
207
|
+
##
|
208
|
+
# Configuration class for the FlexTemplatesService REST API.
|
209
|
+
#
|
210
|
+
# This class represents the configuration for FlexTemplatesService REST,
|
211
|
+
# providing control over timeouts, retry behavior, logging, transport
|
212
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
213
|
+
# applied individually to specific RPCs. See
|
214
|
+
# {::Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Rest::Client::Configuration::Rpcs}
|
215
|
+
# for a list of RPCs that can be configured independently.
|
216
|
+
#
|
217
|
+
# Configuration can be applied globally to all clients, or to a single client
|
218
|
+
# on construction.
|
219
|
+
#
|
220
|
+
# @example
|
221
|
+
#
|
222
|
+
# # Modify the global config, setting the timeout for
|
223
|
+
# # launch_flex_template to 20 seconds,
|
224
|
+
# # and all remaining timeouts to 10 seconds.
|
225
|
+
# ::Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Rest::Client.configure do |config|
|
226
|
+
# config.timeout = 10.0
|
227
|
+
# config.rpcs.launch_flex_template.timeout = 20.0
|
228
|
+
# end
|
229
|
+
#
|
230
|
+
# # Apply the above configuration only to a new client.
|
231
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Rest::Client.new do |config|
|
232
|
+
# config.timeout = 10.0
|
233
|
+
# config.rpcs.launch_flex_template.timeout = 20.0
|
234
|
+
# end
|
235
|
+
#
|
236
|
+
# @!attribute [rw] endpoint
|
237
|
+
# The hostname or hostname:port of the service endpoint.
|
238
|
+
# Defaults to `"dataflow.googleapis.com"`.
|
239
|
+
# @return [::String]
|
240
|
+
# @!attribute [rw] credentials
|
241
|
+
# Credentials to send with calls. You may provide any of the following types:
|
242
|
+
# * (`String`) The path to a service account key file in JSON format
|
243
|
+
# * (`Hash`) A service account key as a Hash
|
244
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
245
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
246
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
247
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
248
|
+
# * (`nil`) indicating no credentials
|
249
|
+
# @return [::Object]
|
250
|
+
# @!attribute [rw] scope
|
251
|
+
# The OAuth scopes
|
252
|
+
# @return [::Array<::String>]
|
253
|
+
# @!attribute [rw] lib_name
|
254
|
+
# The library name as recorded in instrumentation and logging
|
255
|
+
# @return [::String]
|
256
|
+
# @!attribute [rw] lib_version
|
257
|
+
# The library version as recorded in instrumentation and logging
|
258
|
+
# @return [::String]
|
259
|
+
# @!attribute [rw] timeout
|
260
|
+
# The call timeout in seconds.
|
261
|
+
# @return [::Numeric]
|
262
|
+
# @!attribute [rw] metadata
|
263
|
+
# Additional headers to be sent with the call.
|
264
|
+
# @return [::Hash{::Symbol=>::String}]
|
265
|
+
# @!attribute [rw] retry_policy
|
266
|
+
# The retry policy. The value is a hash with the following keys:
|
267
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
268
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
269
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
270
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
271
|
+
# trigger a retry.
|
272
|
+
# @return [::Hash]
|
273
|
+
# @!attribute [rw] quota_project
|
274
|
+
# A separate project against which to charge quota.
|
275
|
+
# @return [::String]
|
276
|
+
#
|
277
|
+
class Configuration
|
278
|
+
extend ::Gapic::Config
|
279
|
+
|
280
|
+
config_attr :endpoint, "dataflow.googleapis.com", ::String
|
281
|
+
config_attr :credentials, nil do |value|
|
282
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
283
|
+
allowed.any? { |klass| klass === value }
|
284
|
+
end
|
285
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
286
|
+
config_attr :lib_name, nil, ::String, nil
|
287
|
+
config_attr :lib_version, nil, ::String, nil
|
288
|
+
config_attr :timeout, nil, ::Numeric, nil
|
289
|
+
config_attr :metadata, nil, ::Hash, nil
|
290
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
291
|
+
config_attr :quota_project, nil, ::String, nil
|
292
|
+
|
293
|
+
# @private
|
294
|
+
def initialize parent_config = nil
|
295
|
+
@parent_config = parent_config unless parent_config.nil?
|
296
|
+
|
297
|
+
yield self if block_given?
|
298
|
+
end
|
299
|
+
|
300
|
+
##
|
301
|
+
# Configurations for individual RPCs
|
302
|
+
# @return [Rpcs]
|
303
|
+
#
|
304
|
+
def rpcs
|
305
|
+
@rpcs ||= begin
|
306
|
+
parent_rpcs = nil
|
307
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
308
|
+
Rpcs.new parent_rpcs
|
309
|
+
end
|
310
|
+
end
|
311
|
+
|
312
|
+
##
|
313
|
+
# Configuration RPC class for the FlexTemplatesService API.
|
314
|
+
#
|
315
|
+
# Includes fields providing the configuration for each RPC in this service.
|
316
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
317
|
+
# the following configuration fields:
|
318
|
+
#
|
319
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
320
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
321
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
322
|
+
# include the following keys:
|
323
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
324
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
325
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
326
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
327
|
+
# trigger a retry.
|
328
|
+
#
|
329
|
+
class Rpcs
|
330
|
+
##
|
331
|
+
# RPC-specific configuration for `launch_flex_template`
|
332
|
+
# @return [::Gapic::Config::Method]
|
333
|
+
#
|
334
|
+
attr_reader :launch_flex_template
|
335
|
+
|
336
|
+
# @private
|
337
|
+
def initialize parent_rpcs = nil
|
338
|
+
launch_flex_template_config = parent_rpcs.launch_flex_template if parent_rpcs.respond_to? :launch_flex_template
|
339
|
+
@launch_flex_template = ::Gapic::Config::Method.new launch_flex_template_config
|
340
|
+
|
341
|
+
yield self if block_given?
|
342
|
+
end
|
343
|
+
end
|
344
|
+
end
|
345
|
+
end
|
346
|
+
end
|
347
|
+
end
|
348
|
+
end
|
349
|
+
end
|
350
|
+
end
|
351
|
+
end
|
@@ -0,0 +1,109 @@
|
|
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/dataflow/v1beta3/templates_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Dataflow
|
24
|
+
module V1beta3
|
25
|
+
module FlexTemplatesService
|
26
|
+
module Rest
|
27
|
+
##
|
28
|
+
# REST service stub for the FlexTemplatesService service.
|
29
|
+
# Service stub contains baseline method implementations
|
30
|
+
# including transcoding, making the REST call, and deserialing the response.
|
31
|
+
#
|
32
|
+
class ServiceStub
|
33
|
+
def initialize endpoint:, credentials:
|
34
|
+
# These require statements are intentionally placed here to initialize
|
35
|
+
# the REST modules only when it's required.
|
36
|
+
require "gapic/rest"
|
37
|
+
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
|
39
|
+
numeric_enums: true,
|
40
|
+
raise_faraday_errors: false
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Baseline implementation for the launch_flex_template REST call
|
45
|
+
#
|
46
|
+
# @param request_pb [::Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateRequest]
|
47
|
+
# A request object representing the call parameters. Required.
|
48
|
+
# @param options [::Gapic::CallOptions]
|
49
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
50
|
+
#
|
51
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
52
|
+
# @yieldparam result [::Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateResponse]
|
53
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
54
|
+
#
|
55
|
+
# @return [::Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateResponse]
|
56
|
+
# A result object deserialized from the server's reply
|
57
|
+
def launch_flex_template request_pb, options = nil
|
58
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
59
|
+
|
60
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_launch_flex_template_request request_pb
|
61
|
+
query_string_params = if query_string_params.any?
|
62
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
63
|
+
else
|
64
|
+
{}
|
65
|
+
end
|
66
|
+
|
67
|
+
response = @client_stub.make_http_request(
|
68
|
+
verb,
|
69
|
+
uri: uri,
|
70
|
+
body: body || "",
|
71
|
+
params: query_string_params,
|
72
|
+
options: options
|
73
|
+
)
|
74
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
75
|
+
result = ::Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateResponse.decode_json response.body, ignore_unknown_fields: true
|
76
|
+
|
77
|
+
yield result, operation if block_given?
|
78
|
+
result
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# @private
|
83
|
+
#
|
84
|
+
# GRPC transcoding helper method for the launch_flex_template REST call
|
85
|
+
#
|
86
|
+
# @param request_pb [::Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateRequest]
|
87
|
+
# A request object representing the call parameters. Required.
|
88
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
89
|
+
# Uri, Body, Query string parameters
|
90
|
+
def self.transcode_launch_flex_template_request request_pb
|
91
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
92
|
+
.with_bindings(
|
93
|
+
uri_method: :post,
|
94
|
+
uri_template: "/v1b3/projects/{project_id}/locations/{location}/flexTemplates:launch",
|
95
|
+
body: "*",
|
96
|
+
matches: [
|
97
|
+
["project_id", %r{^[^/]+/?$}, false],
|
98
|
+
["location", %r{^[^/]+/?$}, false]
|
99
|
+
]
|
100
|
+
)
|
101
|
+
transcoder.transcode request_pb
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,51 @@
|
|
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 "gapic/rest"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/dataflow/v1beta3/version"
|
24
|
+
|
25
|
+
require "google/cloud/dataflow/v1beta3/flex_templates_service/credentials"
|
26
|
+
require "google/cloud/dataflow/v1beta3/flex_templates_service/rest/client"
|
27
|
+
|
28
|
+
module Google
|
29
|
+
module Cloud
|
30
|
+
module Dataflow
|
31
|
+
module V1beta3
|
32
|
+
##
|
33
|
+
# Provides a service for Flex templates. This feature is not ready yet.
|
34
|
+
#
|
35
|
+
# To load this service and instantiate a REST client:
|
36
|
+
#
|
37
|
+
# require "google/cloud/dataflow/v1beta3/flex_templates_service/rest"
|
38
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Rest::Client.new
|
39
|
+
#
|
40
|
+
module FlexTemplatesService
|
41
|
+
# Client for the REST transport
|
42
|
+
module Rest
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
51
|
+
require "google/cloud/dataflow/v1beta3/flex_templates_service/rest/helpers" if ::File.file? helper_path
|
@@ -24,6 +24,7 @@ require "google/cloud/dataflow/v1beta3/version"
|
|
24
24
|
|
25
25
|
require "google/cloud/dataflow/v1beta3/flex_templates_service/credentials"
|
26
26
|
require "google/cloud/dataflow/v1beta3/flex_templates_service/client"
|
27
|
+
require "google/cloud/dataflow/v1beta3/flex_templates_service/rest"
|
27
28
|
|
28
29
|
module Google
|
29
30
|
module Cloud
|
@@ -32,11 +33,16 @@ module Google
|
|
32
33
|
##
|
33
34
|
# Provides a service for Flex templates. This feature is not ready yet.
|
34
35
|
#
|
35
|
-
#
|
36
|
+
# @example Load this service and instantiate a gRPC client
|
36
37
|
#
|
37
38
|
# require "google/cloud/dataflow/v1beta3/flex_templates_service"
|
38
39
|
# client = ::Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Client.new
|
39
40
|
#
|
41
|
+
# @example Load this service and instantiate a REST client
|
42
|
+
#
|
43
|
+
# require "google/cloud/dataflow/v1beta3/flex_templates_service/rest"
|
44
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Rest::Client.new
|
45
|
+
#
|
40
46
|
module FlexTemplatesService
|
41
47
|
end
|
42
48
|
end
|
@@ -524,13 +524,11 @@ module Google
|
|
524
524
|
# # Call the list_jobs method.
|
525
525
|
# result = client.list_jobs request
|
526
526
|
#
|
527
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
528
|
-
# #
|
529
|
-
#
|
530
|
-
# # methods are also available for managing paging directly.
|
531
|
-
# result.each do |response|
|
527
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
528
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
529
|
+
# result.each do |item|
|
532
530
|
# # Each element is of type ::Google::Cloud::Dataflow::V1beta3::Job.
|
533
|
-
# p
|
531
|
+
# p item
|
534
532
|
# end
|
535
533
|
#
|
536
534
|
def list_jobs request, options = nil
|
@@ -635,13 +633,11 @@ module Google
|
|
635
633
|
# # Call the aggregated_list_jobs method.
|
636
634
|
# result = client.aggregated_list_jobs request
|
637
635
|
#
|
638
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
639
|
-
# #
|
640
|
-
#
|
641
|
-
# # methods are also available for managing paging directly.
|
642
|
-
# result.each do |response|
|
636
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
637
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
638
|
+
# result.each do |item|
|
643
639
|
# # Each element is of type ::Google::Cloud::Dataflow::V1beta3::Job.
|
644
|
-
# p
|
640
|
+
# p item
|
645
641
|
# end
|
646
642
|
#
|
647
643
|
def aggregated_list_jobs request, options = nil
|