google-cloud-dataflow-v1beta3 0.1.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 +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 Metrics
|
26
|
+
# Credentials for the Metrics 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,48 @@
|
|
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/snapshots/credentials"
|
26
|
+
require "google/cloud/dataflow/v1beta3/snapshots/client"
|
27
|
+
|
28
|
+
module Google
|
29
|
+
module Cloud
|
30
|
+
module Dataflow
|
31
|
+
module V1beta3
|
32
|
+
##
|
33
|
+
# Provides methods to manage snapshots of Google Cloud Dataflow jobs.
|
34
|
+
#
|
35
|
+
# To load this service and instantiate a client:
|
36
|
+
#
|
37
|
+
# require "google/cloud/dataflow/v1beta3/snapshots"
|
38
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new
|
39
|
+
#
|
40
|
+
module Snapshots
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
helper_path = ::File.join __dir__, "snapshots", "helpers.rb"
|
48
|
+
require "google/cloud/dataflow/v1beta3/snapshots/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,515 @@
|
|
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/snapshots_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Dataflow
|
25
|
+
module V1beta3
|
26
|
+
module Snapshots
|
27
|
+
##
|
28
|
+
# Client for the Snapshots service.
|
29
|
+
#
|
30
|
+
# Provides methods to manage snapshots of Google Cloud Dataflow jobs.
|
31
|
+
#
|
32
|
+
class Client
|
33
|
+
# @private
|
34
|
+
attr_reader :snapshots_stub
|
35
|
+
|
36
|
+
##
|
37
|
+
# Configure the Snapshots Client class.
|
38
|
+
#
|
39
|
+
# See {::Google::Cloud::Dataflow::V1beta3::Snapshots::Client::Configuration}
|
40
|
+
# for a description of the configuration fields.
|
41
|
+
#
|
42
|
+
# ## Example
|
43
|
+
#
|
44
|
+
# To modify the configuration for all Snapshots clients:
|
45
|
+
#
|
46
|
+
# ::Google::Cloud::Dataflow::V1beta3::Snapshots::Client.configure do |config|
|
47
|
+
# config.timeout = 10.0
|
48
|
+
# end
|
49
|
+
#
|
50
|
+
# @yield [config] Configure the Client client.
|
51
|
+
# @yieldparam config [Client::Configuration]
|
52
|
+
#
|
53
|
+
# @return [Client::Configuration]
|
54
|
+
#
|
55
|
+
def self.configure
|
56
|
+
@configure ||= begin
|
57
|
+
namespace = ["Google", "Cloud", "Dataflow", "V1beta3"]
|
58
|
+
parent_config = while namespace.any?
|
59
|
+
parent_name = namespace.join "::"
|
60
|
+
parent_const = const_get parent_name
|
61
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
62
|
+
namespace.pop
|
63
|
+
end
|
64
|
+
default_config = Client::Configuration.new parent_config
|
65
|
+
|
66
|
+
default_config.timeout = 60.0
|
67
|
+
|
68
|
+
default_config
|
69
|
+
end
|
70
|
+
yield @configure if block_given?
|
71
|
+
@configure
|
72
|
+
end
|
73
|
+
|
74
|
+
##
|
75
|
+
# Configure the Snapshots Client instance.
|
76
|
+
#
|
77
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
78
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
79
|
+
# should be made on {Client.configure}.
|
80
|
+
#
|
81
|
+
# See {::Google::Cloud::Dataflow::V1beta3::Snapshots::Client::Configuration}
|
82
|
+
# for a description of the configuration fields.
|
83
|
+
#
|
84
|
+
# @yield [config] Configure the Client client.
|
85
|
+
# @yieldparam config [Client::Configuration]
|
86
|
+
#
|
87
|
+
# @return [Client::Configuration]
|
88
|
+
#
|
89
|
+
def configure
|
90
|
+
yield @config if block_given?
|
91
|
+
@config
|
92
|
+
end
|
93
|
+
|
94
|
+
##
|
95
|
+
# Create a new Snapshots client object.
|
96
|
+
#
|
97
|
+
# ## Examples
|
98
|
+
#
|
99
|
+
# To create a new Snapshots client with the default
|
100
|
+
# configuration:
|
101
|
+
#
|
102
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new
|
103
|
+
#
|
104
|
+
# To create a new Snapshots client with a custom
|
105
|
+
# configuration:
|
106
|
+
#
|
107
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new do |config|
|
108
|
+
# config.timeout = 10.0
|
109
|
+
# end
|
110
|
+
#
|
111
|
+
# @yield [config] Configure the Snapshots client.
|
112
|
+
# @yieldparam config [Client::Configuration]
|
113
|
+
#
|
114
|
+
def initialize
|
115
|
+
# These require statements are intentionally placed here to initialize
|
116
|
+
# the gRPC module only when it's required.
|
117
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
118
|
+
require "gapic/grpc"
|
119
|
+
require "google/dataflow/v1beta3/snapshots_services_pb"
|
120
|
+
|
121
|
+
# Create the configuration object
|
122
|
+
@config = Configuration.new Client.configure
|
123
|
+
|
124
|
+
# Yield the configuration if needed
|
125
|
+
yield @config if block_given?
|
126
|
+
|
127
|
+
# Create credentials
|
128
|
+
credentials = @config.credentials
|
129
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
130
|
+
# but only if the default endpoint does not have a region prefix.
|
131
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
132
|
+
@config.endpoint == Client.configure.endpoint &&
|
133
|
+
!@config.endpoint.split(".").first.include?("-")
|
134
|
+
credentials ||= Credentials.default scope: @config.scope,
|
135
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
136
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
137
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
138
|
+
end
|
139
|
+
@quota_project_id = @config.quota_project
|
140
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
141
|
+
|
142
|
+
@snapshots_stub = ::Gapic::ServiceStub.new(
|
143
|
+
::Google::Cloud::Dataflow::V1beta3::SnapshotsV1Beta3::Stub,
|
144
|
+
credentials: credentials,
|
145
|
+
endpoint: @config.endpoint,
|
146
|
+
channel_args: @config.channel_args,
|
147
|
+
interceptors: @config.interceptors
|
148
|
+
)
|
149
|
+
end
|
150
|
+
|
151
|
+
# Service calls
|
152
|
+
|
153
|
+
##
|
154
|
+
# Gets information about a snapshot.
|
155
|
+
#
|
156
|
+
# @overload get_snapshot(request, options = nil)
|
157
|
+
# Pass arguments to `get_snapshot` via a request object, either of type
|
158
|
+
# {::Google::Cloud::Dataflow::V1beta3::GetSnapshotRequest} or an equivalent Hash.
|
159
|
+
#
|
160
|
+
# @param request [::Google::Cloud::Dataflow::V1beta3::GetSnapshotRequest, ::Hash]
|
161
|
+
# A request object representing the call parameters. Required. To specify no
|
162
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
163
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
164
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
165
|
+
#
|
166
|
+
# @overload get_snapshot(project_id: nil, snapshot_id: nil, location: nil)
|
167
|
+
# Pass arguments to `get_snapshot` via keyword arguments. Note that at
|
168
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
169
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
170
|
+
#
|
171
|
+
# @param project_id [::String]
|
172
|
+
# The ID of the Cloud Platform project that the snapshot belongs to.
|
173
|
+
# @param snapshot_id [::String]
|
174
|
+
# The ID of the snapshot.
|
175
|
+
# @param location [::String]
|
176
|
+
# The location that contains this snapshot.
|
177
|
+
#
|
178
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
179
|
+
# @yieldparam response [::Google::Cloud::Dataflow::V1beta3::Snapshot]
|
180
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
181
|
+
#
|
182
|
+
# @return [::Google::Cloud::Dataflow::V1beta3::Snapshot]
|
183
|
+
#
|
184
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
185
|
+
#
|
186
|
+
def get_snapshot request, options = nil
|
187
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
188
|
+
|
189
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataflow::V1beta3::GetSnapshotRequest
|
190
|
+
|
191
|
+
# Converts hash and nil to an options object
|
192
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
193
|
+
|
194
|
+
# Customize the options with defaults
|
195
|
+
metadata = @config.rpcs.get_snapshot.metadata.to_h
|
196
|
+
|
197
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
198
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
199
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
200
|
+
gapic_version: ::Google::Cloud::Dataflow::V1beta3::VERSION
|
201
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
202
|
+
|
203
|
+
options.apply_defaults timeout: @config.rpcs.get_snapshot.timeout,
|
204
|
+
metadata: metadata,
|
205
|
+
retry_policy: @config.rpcs.get_snapshot.retry_policy
|
206
|
+
options.apply_defaults metadata: @config.metadata,
|
207
|
+
retry_policy: @config.retry_policy
|
208
|
+
|
209
|
+
@snapshots_stub.call_rpc :get_snapshot, request, options: options do |response, operation|
|
210
|
+
yield response, operation if block_given?
|
211
|
+
return response
|
212
|
+
end
|
213
|
+
rescue ::GRPC::BadStatus => e
|
214
|
+
raise ::Google::Cloud::Error.from_error(e)
|
215
|
+
end
|
216
|
+
|
217
|
+
##
|
218
|
+
# Deletes a snapshot.
|
219
|
+
#
|
220
|
+
# @overload delete_snapshot(request, options = nil)
|
221
|
+
# Pass arguments to `delete_snapshot` via a request object, either of type
|
222
|
+
# {::Google::Cloud::Dataflow::V1beta3::DeleteSnapshotRequest} or an equivalent Hash.
|
223
|
+
#
|
224
|
+
# @param request [::Google::Cloud::Dataflow::V1beta3::DeleteSnapshotRequest, ::Hash]
|
225
|
+
# A request object representing the call parameters. Required. To specify no
|
226
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
227
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
228
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
229
|
+
#
|
230
|
+
# @overload delete_snapshot(project_id: nil, snapshot_id: nil, location: nil)
|
231
|
+
# Pass arguments to `delete_snapshot` via keyword arguments. Note that at
|
232
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
233
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
234
|
+
#
|
235
|
+
# @param project_id [::String]
|
236
|
+
# The ID of the Cloud Platform project that the snapshot belongs to.
|
237
|
+
# @param snapshot_id [::String]
|
238
|
+
# The ID of the snapshot.
|
239
|
+
# @param location [::String]
|
240
|
+
# The location that contains this snapshot.
|
241
|
+
#
|
242
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
243
|
+
# @yieldparam response [::Google::Cloud::Dataflow::V1beta3::DeleteSnapshotResponse]
|
244
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
245
|
+
#
|
246
|
+
# @return [::Google::Cloud::Dataflow::V1beta3::DeleteSnapshotResponse]
|
247
|
+
#
|
248
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
249
|
+
#
|
250
|
+
def delete_snapshot request, options = nil
|
251
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
252
|
+
|
253
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataflow::V1beta3::DeleteSnapshotRequest
|
254
|
+
|
255
|
+
# Converts hash and nil to an options object
|
256
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
257
|
+
|
258
|
+
# Customize the options with defaults
|
259
|
+
metadata = @config.rpcs.delete_snapshot.metadata.to_h
|
260
|
+
|
261
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
262
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
263
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
264
|
+
gapic_version: ::Google::Cloud::Dataflow::V1beta3::VERSION
|
265
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
266
|
+
|
267
|
+
options.apply_defaults timeout: @config.rpcs.delete_snapshot.timeout,
|
268
|
+
metadata: metadata,
|
269
|
+
retry_policy: @config.rpcs.delete_snapshot.retry_policy
|
270
|
+
options.apply_defaults metadata: @config.metadata,
|
271
|
+
retry_policy: @config.retry_policy
|
272
|
+
|
273
|
+
@snapshots_stub.call_rpc :delete_snapshot, request, options: options do |response, operation|
|
274
|
+
yield response, operation if block_given?
|
275
|
+
return response
|
276
|
+
end
|
277
|
+
rescue ::GRPC::BadStatus => e
|
278
|
+
raise ::Google::Cloud::Error.from_error(e)
|
279
|
+
end
|
280
|
+
|
281
|
+
##
|
282
|
+
# Lists snapshots.
|
283
|
+
#
|
284
|
+
# @overload list_snapshots(request, options = nil)
|
285
|
+
# Pass arguments to `list_snapshots` via a request object, either of type
|
286
|
+
# {::Google::Cloud::Dataflow::V1beta3::ListSnapshotsRequest} or an equivalent Hash.
|
287
|
+
#
|
288
|
+
# @param request [::Google::Cloud::Dataflow::V1beta3::ListSnapshotsRequest, ::Hash]
|
289
|
+
# A request object representing the call parameters. Required. To specify no
|
290
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
291
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
292
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
293
|
+
#
|
294
|
+
# @overload list_snapshots(project_id: nil, job_id: nil, location: nil)
|
295
|
+
# Pass arguments to `list_snapshots` via keyword arguments. Note that at
|
296
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
297
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
298
|
+
#
|
299
|
+
# @param project_id [::String]
|
300
|
+
# The project ID to list snapshots for.
|
301
|
+
# @param job_id [::String]
|
302
|
+
# If specified, list snapshots created from this job.
|
303
|
+
# @param location [::String]
|
304
|
+
# The location to list snapshots in.
|
305
|
+
#
|
306
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
307
|
+
# @yieldparam response [::Google::Cloud::Dataflow::V1beta3::ListSnapshotsResponse]
|
308
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
309
|
+
#
|
310
|
+
# @return [::Google::Cloud::Dataflow::V1beta3::ListSnapshotsResponse]
|
311
|
+
#
|
312
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
313
|
+
#
|
314
|
+
def list_snapshots request, options = nil
|
315
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
316
|
+
|
317
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataflow::V1beta3::ListSnapshotsRequest
|
318
|
+
|
319
|
+
# Converts hash and nil to an options object
|
320
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
321
|
+
|
322
|
+
# Customize the options with defaults
|
323
|
+
metadata = @config.rpcs.list_snapshots.metadata.to_h
|
324
|
+
|
325
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
326
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
327
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
328
|
+
gapic_version: ::Google::Cloud::Dataflow::V1beta3::VERSION
|
329
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
330
|
+
|
331
|
+
options.apply_defaults timeout: @config.rpcs.list_snapshots.timeout,
|
332
|
+
metadata: metadata,
|
333
|
+
retry_policy: @config.rpcs.list_snapshots.retry_policy
|
334
|
+
options.apply_defaults metadata: @config.metadata,
|
335
|
+
retry_policy: @config.retry_policy
|
336
|
+
|
337
|
+
@snapshots_stub.call_rpc :list_snapshots, request, options: options do |response, operation|
|
338
|
+
yield response, operation if block_given?
|
339
|
+
return response
|
340
|
+
end
|
341
|
+
rescue ::GRPC::BadStatus => e
|
342
|
+
raise ::Google::Cloud::Error.from_error(e)
|
343
|
+
end
|
344
|
+
|
345
|
+
##
|
346
|
+
# Configuration class for the Snapshots API.
|
347
|
+
#
|
348
|
+
# This class represents the configuration for Snapshots,
|
349
|
+
# providing control over timeouts, retry behavior, logging, transport
|
350
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
351
|
+
# applied individually to specific RPCs. See
|
352
|
+
# {::Google::Cloud::Dataflow::V1beta3::Snapshots::Client::Configuration::Rpcs}
|
353
|
+
# for a list of RPCs that can be configured independently.
|
354
|
+
#
|
355
|
+
# Configuration can be applied globally to all clients, or to a single client
|
356
|
+
# on construction.
|
357
|
+
#
|
358
|
+
# # Examples
|
359
|
+
#
|
360
|
+
# To modify the global config, setting the timeout for get_snapshot
|
361
|
+
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
362
|
+
#
|
363
|
+
# ::Google::Cloud::Dataflow::V1beta3::Snapshots::Client.configure do |config|
|
364
|
+
# config.timeout = 10.0
|
365
|
+
# config.rpcs.get_snapshot.timeout = 20.0
|
366
|
+
# end
|
367
|
+
#
|
368
|
+
# To apply the above configuration only to a new client:
|
369
|
+
#
|
370
|
+
# client = ::Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new do |config|
|
371
|
+
# config.timeout = 10.0
|
372
|
+
# config.rpcs.get_snapshot.timeout = 20.0
|
373
|
+
# end
|
374
|
+
#
|
375
|
+
# @!attribute [rw] endpoint
|
376
|
+
# The hostname or hostname:port of the service endpoint.
|
377
|
+
# Defaults to `"dataflow.googleapis.com"`.
|
378
|
+
# @return [::String]
|
379
|
+
# @!attribute [rw] credentials
|
380
|
+
# Credentials to send with calls. You may provide any of the following types:
|
381
|
+
# * (`String`) The path to a service account key file in JSON format
|
382
|
+
# * (`Hash`) A service account key as a Hash
|
383
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
384
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
385
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
386
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
387
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
388
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
389
|
+
# * (`nil`) indicating no credentials
|
390
|
+
# @return [::Object]
|
391
|
+
# @!attribute [rw] scope
|
392
|
+
# The OAuth scopes
|
393
|
+
# @return [::Array<::String>]
|
394
|
+
# @!attribute [rw] lib_name
|
395
|
+
# The library name as recorded in instrumentation and logging
|
396
|
+
# @return [::String]
|
397
|
+
# @!attribute [rw] lib_version
|
398
|
+
# The library version as recorded in instrumentation and logging
|
399
|
+
# @return [::String]
|
400
|
+
# @!attribute [rw] channel_args
|
401
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
402
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
403
|
+
# @return [::Hash]
|
404
|
+
# @!attribute [rw] interceptors
|
405
|
+
# An array of interceptors that are run before calls are executed.
|
406
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
407
|
+
# @!attribute [rw] timeout
|
408
|
+
# The call timeout in seconds.
|
409
|
+
# @return [::Numeric]
|
410
|
+
# @!attribute [rw] metadata
|
411
|
+
# Additional gRPC headers to be sent with the call.
|
412
|
+
# @return [::Hash{::Symbol=>::String}]
|
413
|
+
# @!attribute [rw] retry_policy
|
414
|
+
# The retry policy. The value is a hash with the following keys:
|
415
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
416
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
417
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
418
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
419
|
+
# trigger a retry.
|
420
|
+
# @return [::Hash]
|
421
|
+
# @!attribute [rw] quota_project
|
422
|
+
# A separate project against which to charge quota.
|
423
|
+
# @return [::String]
|
424
|
+
#
|
425
|
+
class Configuration
|
426
|
+
extend ::Gapic::Config
|
427
|
+
|
428
|
+
config_attr :endpoint, "dataflow.googleapis.com", ::String
|
429
|
+
config_attr :credentials, nil do |value|
|
430
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
431
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
432
|
+
allowed.any? { |klass| klass === value }
|
433
|
+
end
|
434
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
435
|
+
config_attr :lib_name, nil, ::String, nil
|
436
|
+
config_attr :lib_version, nil, ::String, nil
|
437
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
438
|
+
config_attr :interceptors, nil, ::Array, nil
|
439
|
+
config_attr :timeout, nil, ::Numeric, nil
|
440
|
+
config_attr :metadata, nil, ::Hash, nil
|
441
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
442
|
+
config_attr :quota_project, nil, ::String, nil
|
443
|
+
|
444
|
+
# @private
|
445
|
+
def initialize parent_config = nil
|
446
|
+
@parent_config = parent_config unless parent_config.nil?
|
447
|
+
|
448
|
+
yield self if block_given?
|
449
|
+
end
|
450
|
+
|
451
|
+
##
|
452
|
+
# Configurations for individual RPCs
|
453
|
+
# @return [Rpcs]
|
454
|
+
#
|
455
|
+
def rpcs
|
456
|
+
@rpcs ||= begin
|
457
|
+
parent_rpcs = nil
|
458
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
459
|
+
Rpcs.new parent_rpcs
|
460
|
+
end
|
461
|
+
end
|
462
|
+
|
463
|
+
##
|
464
|
+
# Configuration RPC class for the Snapshots API.
|
465
|
+
#
|
466
|
+
# Includes fields providing the configuration for each RPC in this service.
|
467
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
468
|
+
# the following configuration fields:
|
469
|
+
#
|
470
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
471
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
472
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
473
|
+
# include the following keys:
|
474
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
475
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
476
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
477
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
478
|
+
# trigger a retry.
|
479
|
+
#
|
480
|
+
class Rpcs
|
481
|
+
##
|
482
|
+
# RPC-specific configuration for `get_snapshot`
|
483
|
+
# @return [::Gapic::Config::Method]
|
484
|
+
#
|
485
|
+
attr_reader :get_snapshot
|
486
|
+
##
|
487
|
+
# RPC-specific configuration for `delete_snapshot`
|
488
|
+
# @return [::Gapic::Config::Method]
|
489
|
+
#
|
490
|
+
attr_reader :delete_snapshot
|
491
|
+
##
|
492
|
+
# RPC-specific configuration for `list_snapshots`
|
493
|
+
# @return [::Gapic::Config::Method]
|
494
|
+
#
|
495
|
+
attr_reader :list_snapshots
|
496
|
+
|
497
|
+
# @private
|
498
|
+
def initialize parent_rpcs = nil
|
499
|
+
get_snapshot_config = parent_rpcs.get_snapshot if parent_rpcs.respond_to? :get_snapshot
|
500
|
+
@get_snapshot = ::Gapic::Config::Method.new get_snapshot_config
|
501
|
+
delete_snapshot_config = parent_rpcs.delete_snapshot if parent_rpcs.respond_to? :delete_snapshot
|
502
|
+
@delete_snapshot = ::Gapic::Config::Method.new delete_snapshot_config
|
503
|
+
list_snapshots_config = parent_rpcs.list_snapshots if parent_rpcs.respond_to? :list_snapshots
|
504
|
+
@list_snapshots = ::Gapic::Config::Method.new list_snapshots_config
|
505
|
+
|
506
|
+
yield self if block_given?
|
507
|
+
end
|
508
|
+
end
|
509
|
+
end
|
510
|
+
end
|
511
|
+
end
|
512
|
+
end
|
513
|
+
end
|
514
|
+
end
|
515
|
+
end
|