google-cloud-bigquery-migration-v2 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 +149 -0
- data/LICENSE.md +201 -0
- data/README.md +139 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_entities_pb.rb +89 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_error_details_pb.rb +39 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_metrics_pb.rb +52 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_service/client.rb +1016 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_service/credentials.rb +49 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_service/paths.rb +92 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_service.rb +51 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_service_pb.rb +76 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_service_services_pb.rb +62 -0
- data/lib/google/cloud/bigquery/migration/v2/translation_config_pb.rb +127 -0
- data/lib/google/cloud/bigquery/migration/v2/version.rb +30 -0
- data/lib/google/cloud/bigquery/migration/v2.rb +42 -0
- data/lib/google-cloud-bigquery-migration-v2.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/distribution.rb +225 -0
- data/proto_docs/google/api/field_behavior.rb +71 -0
- data/proto_docs/google/api/label.rb +49 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/metric.rb +276 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/cloud/bigquery/migration/v2/migration_entities.rb +220 -0
- data/proto_docs/google/cloud/bigquery/migration/v2/migration_error_details.rb +72 -0
- data/proto_docs/google/cloud/bigquery/migration/v2/migration_metrics.rb +119 -0
- data/proto_docs/google/cloud/bigquery/migration/v2/migration_service.rb +166 -0
- data/proto_docs/google/cloud/bigquery/migration/v2/translation_config.rb +275 -0
- data/proto_docs/google/protobuf/any.rb +141 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +129 -0
- data/proto_docs/google/rpc/error_details.rb +297 -0
- metadata +227 -0
@@ -0,0 +1,1016 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2022 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/cloud/bigquery/migration/v2/migration_service_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Bigquery
|
25
|
+
module Migration
|
26
|
+
module V2
|
27
|
+
module MigrationService
|
28
|
+
##
|
29
|
+
# Client for the MigrationService service.
|
30
|
+
#
|
31
|
+
# Service to handle EDW migrations.
|
32
|
+
#
|
33
|
+
class Client
|
34
|
+
include Paths
|
35
|
+
|
36
|
+
# @private
|
37
|
+
attr_reader :migration_service_stub
|
38
|
+
|
39
|
+
##
|
40
|
+
# Configure the MigrationService Client class.
|
41
|
+
#
|
42
|
+
# See {::Google::Cloud::Bigquery::Migration::V2::MigrationService::Client::Configuration}
|
43
|
+
# for a description of the configuration fields.
|
44
|
+
#
|
45
|
+
# @example
|
46
|
+
#
|
47
|
+
# # Modify the configuration for all MigrationService clients
|
48
|
+
# ::Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.configure do |config|
|
49
|
+
# config.timeout = 10.0
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# @yield [config] Configure the Client client.
|
53
|
+
# @yieldparam config [Client::Configuration]
|
54
|
+
#
|
55
|
+
# @return [Client::Configuration]
|
56
|
+
#
|
57
|
+
def self.configure
|
58
|
+
@configure ||= begin
|
59
|
+
namespace = ["Google", "Cloud", "Bigquery", "Migration", "V2"]
|
60
|
+
parent_config = while namespace.any?
|
61
|
+
parent_name = namespace.join "::"
|
62
|
+
parent_const = const_get parent_name
|
63
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
64
|
+
namespace.pop
|
65
|
+
end
|
66
|
+
default_config = Client::Configuration.new parent_config
|
67
|
+
|
68
|
+
default_config.rpcs.create_migration_workflow.timeout = 60.0
|
69
|
+
|
70
|
+
default_config.rpcs.get_migration_workflow.timeout = 60.0
|
71
|
+
default_config.rpcs.get_migration_workflow.retry_policy = {
|
72
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
73
|
+
}
|
74
|
+
|
75
|
+
default_config.rpcs.list_migration_workflows.timeout = 60.0
|
76
|
+
default_config.rpcs.list_migration_workflows.retry_policy = {
|
77
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
78
|
+
}
|
79
|
+
|
80
|
+
default_config.rpcs.delete_migration_workflow.timeout = 60.0
|
81
|
+
|
82
|
+
default_config.rpcs.start_migration_workflow.timeout = 60.0
|
83
|
+
default_config.rpcs.start_migration_workflow.retry_policy = {
|
84
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
85
|
+
}
|
86
|
+
|
87
|
+
default_config
|
88
|
+
end
|
89
|
+
yield @configure if block_given?
|
90
|
+
@configure
|
91
|
+
end
|
92
|
+
|
93
|
+
##
|
94
|
+
# Configure the MigrationService Client instance.
|
95
|
+
#
|
96
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
97
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
98
|
+
# should be made on {Client.configure}.
|
99
|
+
#
|
100
|
+
# See {::Google::Cloud::Bigquery::Migration::V2::MigrationService::Client::Configuration}
|
101
|
+
# for a description of the configuration fields.
|
102
|
+
#
|
103
|
+
# @yield [config] Configure the Client client.
|
104
|
+
# @yieldparam config [Client::Configuration]
|
105
|
+
#
|
106
|
+
# @return [Client::Configuration]
|
107
|
+
#
|
108
|
+
def configure
|
109
|
+
yield @config if block_given?
|
110
|
+
@config
|
111
|
+
end
|
112
|
+
|
113
|
+
##
|
114
|
+
# Create a new MigrationService client object.
|
115
|
+
#
|
116
|
+
# @example
|
117
|
+
#
|
118
|
+
# # Create a client using the default configuration
|
119
|
+
# client = ::Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new
|
120
|
+
#
|
121
|
+
# # Create a client using a custom configuration
|
122
|
+
# client = ::Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new do |config|
|
123
|
+
# config.timeout = 10.0
|
124
|
+
# end
|
125
|
+
#
|
126
|
+
# @yield [config] Configure the MigrationService client.
|
127
|
+
# @yieldparam config [Client::Configuration]
|
128
|
+
#
|
129
|
+
def initialize
|
130
|
+
# These require statements are intentionally placed here to initialize
|
131
|
+
# the gRPC module only when it's required.
|
132
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
133
|
+
require "gapic/grpc"
|
134
|
+
require "google/cloud/bigquery/migration/v2/migration_service_services_pb"
|
135
|
+
|
136
|
+
# Create the configuration object
|
137
|
+
@config = Configuration.new Client.configure
|
138
|
+
|
139
|
+
# Yield the configuration if needed
|
140
|
+
yield @config if block_given?
|
141
|
+
|
142
|
+
# Create credentials
|
143
|
+
credentials = @config.credentials
|
144
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
145
|
+
# but only if the default endpoint does not have a region prefix.
|
146
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
147
|
+
!@config.endpoint.split(".").first.include?("-")
|
148
|
+
credentials ||= Credentials.default scope: @config.scope,
|
149
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
150
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
151
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
152
|
+
end
|
153
|
+
@quota_project_id = @config.quota_project
|
154
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
155
|
+
|
156
|
+
@migration_service_stub = ::Gapic::ServiceStub.new(
|
157
|
+
::Google::Cloud::Bigquery::Migration::V2::MigrationService::Stub,
|
158
|
+
credentials: credentials,
|
159
|
+
endpoint: @config.endpoint,
|
160
|
+
channel_args: @config.channel_args,
|
161
|
+
interceptors: @config.interceptors
|
162
|
+
)
|
163
|
+
end
|
164
|
+
|
165
|
+
# Service calls
|
166
|
+
|
167
|
+
##
|
168
|
+
# Creates a migration workflow.
|
169
|
+
#
|
170
|
+
# @overload create_migration_workflow(request, options = nil)
|
171
|
+
# Pass arguments to `create_migration_workflow` via a request object, either of type
|
172
|
+
# {::Google::Cloud::Bigquery::Migration::V2::CreateMigrationWorkflowRequest} or an equivalent Hash.
|
173
|
+
#
|
174
|
+
# @param request [::Google::Cloud::Bigquery::Migration::V2::CreateMigrationWorkflowRequest, ::Hash]
|
175
|
+
# A request object representing the call parameters. Required. To specify no
|
176
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
177
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
178
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
179
|
+
#
|
180
|
+
# @overload create_migration_workflow(parent: nil, migration_workflow: nil)
|
181
|
+
# Pass arguments to `create_migration_workflow` via keyword arguments. Note that at
|
182
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
183
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
184
|
+
#
|
185
|
+
# @param parent [::String]
|
186
|
+
# Required. The name of the project to which this migration workflow belongs.
|
187
|
+
# Example: `projects/foo/locations/bar`
|
188
|
+
# @param migration_workflow [::Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow, ::Hash]
|
189
|
+
# Required. The migration workflow to create.
|
190
|
+
#
|
191
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
192
|
+
# @yieldparam response [::Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow]
|
193
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
194
|
+
#
|
195
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow]
|
196
|
+
#
|
197
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
198
|
+
#
|
199
|
+
# @example Basic example
|
200
|
+
# require "google/cloud/bigquery/migration/v2"
|
201
|
+
#
|
202
|
+
# # Create a client object. The client can be reused for multiple calls.
|
203
|
+
# client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new
|
204
|
+
#
|
205
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
206
|
+
# request = Google::Cloud::Bigquery::Migration::V2::CreateMigrationWorkflowRequest.new
|
207
|
+
#
|
208
|
+
# # Call the create_migration_workflow method.
|
209
|
+
# result = client.create_migration_workflow request
|
210
|
+
#
|
211
|
+
# # The returned object is of type Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow.
|
212
|
+
# p result
|
213
|
+
#
|
214
|
+
def create_migration_workflow request, options = nil
|
215
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
216
|
+
|
217
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Migration::V2::CreateMigrationWorkflowRequest
|
218
|
+
|
219
|
+
# Converts hash and nil to an options object
|
220
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
221
|
+
|
222
|
+
# Customize the options with defaults
|
223
|
+
metadata = @config.rpcs.create_migration_workflow.metadata.to_h
|
224
|
+
|
225
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
226
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
227
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
228
|
+
gapic_version: ::Google::Cloud::Bigquery::Migration::V2::VERSION
|
229
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
230
|
+
|
231
|
+
header_params = {}
|
232
|
+
if request.parent
|
233
|
+
header_params["parent"] = request.parent
|
234
|
+
end
|
235
|
+
|
236
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
237
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
238
|
+
|
239
|
+
options.apply_defaults timeout: @config.rpcs.create_migration_workflow.timeout,
|
240
|
+
metadata: metadata,
|
241
|
+
retry_policy: @config.rpcs.create_migration_workflow.retry_policy
|
242
|
+
|
243
|
+
options.apply_defaults timeout: @config.timeout,
|
244
|
+
metadata: @config.metadata,
|
245
|
+
retry_policy: @config.retry_policy
|
246
|
+
|
247
|
+
@migration_service_stub.call_rpc :create_migration_workflow, request, options: options do |response, operation|
|
248
|
+
yield response, operation if block_given?
|
249
|
+
return response
|
250
|
+
end
|
251
|
+
rescue ::GRPC::BadStatus => e
|
252
|
+
raise ::Google::Cloud::Error.from_error(e)
|
253
|
+
end
|
254
|
+
|
255
|
+
##
|
256
|
+
# Gets a previously created migration workflow.
|
257
|
+
#
|
258
|
+
# @overload get_migration_workflow(request, options = nil)
|
259
|
+
# Pass arguments to `get_migration_workflow` via a request object, either of type
|
260
|
+
# {::Google::Cloud::Bigquery::Migration::V2::GetMigrationWorkflowRequest} or an equivalent Hash.
|
261
|
+
#
|
262
|
+
# @param request [::Google::Cloud::Bigquery::Migration::V2::GetMigrationWorkflowRequest, ::Hash]
|
263
|
+
# A request object representing the call parameters. Required. To specify no
|
264
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
265
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
266
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
267
|
+
#
|
268
|
+
# @overload get_migration_workflow(name: nil, read_mask: nil)
|
269
|
+
# Pass arguments to `get_migration_workflow` via keyword arguments. Note that at
|
270
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
271
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
272
|
+
#
|
273
|
+
# @param name [::String]
|
274
|
+
# Required. The unique identifier for the migration workflow.
|
275
|
+
# Example: `projects/123/locations/us/workflows/1234`
|
276
|
+
# @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
|
277
|
+
# The list of fields to be retrieved.
|
278
|
+
#
|
279
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
280
|
+
# @yieldparam response [::Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow]
|
281
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
282
|
+
#
|
283
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow]
|
284
|
+
#
|
285
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
286
|
+
#
|
287
|
+
# @example Basic example
|
288
|
+
# require "google/cloud/bigquery/migration/v2"
|
289
|
+
#
|
290
|
+
# # Create a client object. The client can be reused for multiple calls.
|
291
|
+
# client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new
|
292
|
+
#
|
293
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
294
|
+
# request = Google::Cloud::Bigquery::Migration::V2::GetMigrationWorkflowRequest.new
|
295
|
+
#
|
296
|
+
# # Call the get_migration_workflow method.
|
297
|
+
# result = client.get_migration_workflow request
|
298
|
+
#
|
299
|
+
# # The returned object is of type Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow.
|
300
|
+
# p result
|
301
|
+
#
|
302
|
+
def get_migration_workflow request, options = nil
|
303
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
304
|
+
|
305
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Migration::V2::GetMigrationWorkflowRequest
|
306
|
+
|
307
|
+
# Converts hash and nil to an options object
|
308
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
309
|
+
|
310
|
+
# Customize the options with defaults
|
311
|
+
metadata = @config.rpcs.get_migration_workflow.metadata.to_h
|
312
|
+
|
313
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
314
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
315
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
316
|
+
gapic_version: ::Google::Cloud::Bigquery::Migration::V2::VERSION
|
317
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
318
|
+
|
319
|
+
header_params = {}
|
320
|
+
if request.name
|
321
|
+
header_params["name"] = request.name
|
322
|
+
end
|
323
|
+
|
324
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
325
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
326
|
+
|
327
|
+
options.apply_defaults timeout: @config.rpcs.get_migration_workflow.timeout,
|
328
|
+
metadata: metadata,
|
329
|
+
retry_policy: @config.rpcs.get_migration_workflow.retry_policy
|
330
|
+
|
331
|
+
options.apply_defaults timeout: @config.timeout,
|
332
|
+
metadata: @config.metadata,
|
333
|
+
retry_policy: @config.retry_policy
|
334
|
+
|
335
|
+
@migration_service_stub.call_rpc :get_migration_workflow, request, options: options do |response, operation|
|
336
|
+
yield response, operation if block_given?
|
337
|
+
return response
|
338
|
+
end
|
339
|
+
rescue ::GRPC::BadStatus => e
|
340
|
+
raise ::Google::Cloud::Error.from_error(e)
|
341
|
+
end
|
342
|
+
|
343
|
+
##
|
344
|
+
# Lists previously created migration workflow.
|
345
|
+
#
|
346
|
+
# @overload list_migration_workflows(request, options = nil)
|
347
|
+
# Pass arguments to `list_migration_workflows` via a request object, either of type
|
348
|
+
# {::Google::Cloud::Bigquery::Migration::V2::ListMigrationWorkflowsRequest} or an equivalent Hash.
|
349
|
+
#
|
350
|
+
# @param request [::Google::Cloud::Bigquery::Migration::V2::ListMigrationWorkflowsRequest, ::Hash]
|
351
|
+
# A request object representing the call parameters. Required. To specify no
|
352
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
353
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
354
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
355
|
+
#
|
356
|
+
# @overload list_migration_workflows(parent: nil, read_mask: nil, page_size: nil, page_token: nil)
|
357
|
+
# Pass arguments to `list_migration_workflows` via keyword arguments. Note that at
|
358
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
359
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
360
|
+
#
|
361
|
+
# @param parent [::String]
|
362
|
+
# Required. The project and location of the migration workflows to list.
|
363
|
+
# Example: `projects/123/locations/us`
|
364
|
+
# @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
|
365
|
+
# The list of fields to be retrieved.
|
366
|
+
# @param page_size [::Integer]
|
367
|
+
# The maximum number of migration workflows to return. The service may return
|
368
|
+
# fewer than this number.
|
369
|
+
# @param page_token [::String]
|
370
|
+
# A page token, received from previous `ListMigrationWorkflows` call.
|
371
|
+
# Provide this to retrieve the subsequent page.
|
372
|
+
#
|
373
|
+
# When paginating, all other parameters provided to `ListMigrationWorkflows`
|
374
|
+
# must match the call that provided the page token.
|
375
|
+
#
|
376
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
377
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow>]
|
378
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
379
|
+
#
|
380
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow>]
|
381
|
+
#
|
382
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
383
|
+
#
|
384
|
+
# @example Basic example
|
385
|
+
# require "google/cloud/bigquery/migration/v2"
|
386
|
+
#
|
387
|
+
# # Create a client object. The client can be reused for multiple calls.
|
388
|
+
# client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new
|
389
|
+
#
|
390
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
391
|
+
# request = Google::Cloud::Bigquery::Migration::V2::ListMigrationWorkflowsRequest.new
|
392
|
+
#
|
393
|
+
# # Call the list_migration_workflows method.
|
394
|
+
# result = client.list_migration_workflows request
|
395
|
+
#
|
396
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
397
|
+
# # iterate over all elements by calling #each, and the enumerable
|
398
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
399
|
+
# # methods are also available for managing paging directly.
|
400
|
+
# result.each do |response|
|
401
|
+
# # Each element is of type ::Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow.
|
402
|
+
# p response
|
403
|
+
# end
|
404
|
+
#
|
405
|
+
def list_migration_workflows request, options = nil
|
406
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
407
|
+
|
408
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Migration::V2::ListMigrationWorkflowsRequest
|
409
|
+
|
410
|
+
# Converts hash and nil to an options object
|
411
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
412
|
+
|
413
|
+
# Customize the options with defaults
|
414
|
+
metadata = @config.rpcs.list_migration_workflows.metadata.to_h
|
415
|
+
|
416
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
417
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
418
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
419
|
+
gapic_version: ::Google::Cloud::Bigquery::Migration::V2::VERSION
|
420
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
421
|
+
|
422
|
+
header_params = {}
|
423
|
+
if request.parent
|
424
|
+
header_params["parent"] = request.parent
|
425
|
+
end
|
426
|
+
|
427
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
428
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
429
|
+
|
430
|
+
options.apply_defaults timeout: @config.rpcs.list_migration_workflows.timeout,
|
431
|
+
metadata: metadata,
|
432
|
+
retry_policy: @config.rpcs.list_migration_workflows.retry_policy
|
433
|
+
|
434
|
+
options.apply_defaults timeout: @config.timeout,
|
435
|
+
metadata: @config.metadata,
|
436
|
+
retry_policy: @config.retry_policy
|
437
|
+
|
438
|
+
@migration_service_stub.call_rpc :list_migration_workflows, request, options: options do |response, operation|
|
439
|
+
response = ::Gapic::PagedEnumerable.new @migration_service_stub, :list_migration_workflows, request, response, operation, options
|
440
|
+
yield response, operation if block_given?
|
441
|
+
return response
|
442
|
+
end
|
443
|
+
rescue ::GRPC::BadStatus => e
|
444
|
+
raise ::Google::Cloud::Error.from_error(e)
|
445
|
+
end
|
446
|
+
|
447
|
+
##
|
448
|
+
# Deletes a migration workflow by name.
|
449
|
+
#
|
450
|
+
# @overload delete_migration_workflow(request, options = nil)
|
451
|
+
# Pass arguments to `delete_migration_workflow` via a request object, either of type
|
452
|
+
# {::Google::Cloud::Bigquery::Migration::V2::DeleteMigrationWorkflowRequest} or an equivalent Hash.
|
453
|
+
#
|
454
|
+
# @param request [::Google::Cloud::Bigquery::Migration::V2::DeleteMigrationWorkflowRequest, ::Hash]
|
455
|
+
# A request object representing the call parameters. Required. To specify no
|
456
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
457
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
458
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
459
|
+
#
|
460
|
+
# @overload delete_migration_workflow(name: nil)
|
461
|
+
# Pass arguments to `delete_migration_workflow` via keyword arguments. Note that at
|
462
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
463
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
464
|
+
#
|
465
|
+
# @param name [::String]
|
466
|
+
# Required. The unique identifier for the migration workflow.
|
467
|
+
# Example: `projects/123/locations/us/workflows/1234`
|
468
|
+
#
|
469
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
470
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
471
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
472
|
+
#
|
473
|
+
# @return [::Google::Protobuf::Empty]
|
474
|
+
#
|
475
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
476
|
+
#
|
477
|
+
# @example Basic example
|
478
|
+
# require "google/cloud/bigquery/migration/v2"
|
479
|
+
#
|
480
|
+
# # Create a client object. The client can be reused for multiple calls.
|
481
|
+
# client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new
|
482
|
+
#
|
483
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
484
|
+
# request = Google::Cloud::Bigquery::Migration::V2::DeleteMigrationWorkflowRequest.new
|
485
|
+
#
|
486
|
+
# # Call the delete_migration_workflow method.
|
487
|
+
# result = client.delete_migration_workflow request
|
488
|
+
#
|
489
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
490
|
+
# p result
|
491
|
+
#
|
492
|
+
def delete_migration_workflow request, options = nil
|
493
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
494
|
+
|
495
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Migration::V2::DeleteMigrationWorkflowRequest
|
496
|
+
|
497
|
+
# Converts hash and nil to an options object
|
498
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
499
|
+
|
500
|
+
# Customize the options with defaults
|
501
|
+
metadata = @config.rpcs.delete_migration_workflow.metadata.to_h
|
502
|
+
|
503
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
504
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
505
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
506
|
+
gapic_version: ::Google::Cloud::Bigquery::Migration::V2::VERSION
|
507
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
508
|
+
|
509
|
+
header_params = {}
|
510
|
+
if request.name
|
511
|
+
header_params["name"] = request.name
|
512
|
+
end
|
513
|
+
|
514
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
515
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
516
|
+
|
517
|
+
options.apply_defaults timeout: @config.rpcs.delete_migration_workflow.timeout,
|
518
|
+
metadata: metadata,
|
519
|
+
retry_policy: @config.rpcs.delete_migration_workflow.retry_policy
|
520
|
+
|
521
|
+
options.apply_defaults timeout: @config.timeout,
|
522
|
+
metadata: @config.metadata,
|
523
|
+
retry_policy: @config.retry_policy
|
524
|
+
|
525
|
+
@migration_service_stub.call_rpc :delete_migration_workflow, request, options: options do |response, operation|
|
526
|
+
yield response, operation if block_given?
|
527
|
+
return response
|
528
|
+
end
|
529
|
+
rescue ::GRPC::BadStatus => e
|
530
|
+
raise ::Google::Cloud::Error.from_error(e)
|
531
|
+
end
|
532
|
+
|
533
|
+
##
|
534
|
+
# Starts a previously created migration workflow. I.e., the state transitions
|
535
|
+
# from DRAFT to RUNNING. This is a no-op if the state is already RUNNING.
|
536
|
+
# An error will be signaled if the state is anything other than DRAFT or
|
537
|
+
# RUNNING.
|
538
|
+
#
|
539
|
+
# @overload start_migration_workflow(request, options = nil)
|
540
|
+
# Pass arguments to `start_migration_workflow` via a request object, either of type
|
541
|
+
# {::Google::Cloud::Bigquery::Migration::V2::StartMigrationWorkflowRequest} or an equivalent Hash.
|
542
|
+
#
|
543
|
+
# @param request [::Google::Cloud::Bigquery::Migration::V2::StartMigrationWorkflowRequest, ::Hash]
|
544
|
+
# A request object representing the call parameters. Required. To specify no
|
545
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
546
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
547
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
548
|
+
#
|
549
|
+
# @overload start_migration_workflow(name: nil)
|
550
|
+
# Pass arguments to `start_migration_workflow` via keyword arguments. Note that at
|
551
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
552
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
553
|
+
#
|
554
|
+
# @param name [::String]
|
555
|
+
# Required. The unique identifier for the migration workflow.
|
556
|
+
# Example: `projects/123/locations/us/workflows/1234`
|
557
|
+
#
|
558
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
559
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
560
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
561
|
+
#
|
562
|
+
# @return [::Google::Protobuf::Empty]
|
563
|
+
#
|
564
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
565
|
+
#
|
566
|
+
# @example Basic example
|
567
|
+
# require "google/cloud/bigquery/migration/v2"
|
568
|
+
#
|
569
|
+
# # Create a client object. The client can be reused for multiple calls.
|
570
|
+
# client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new
|
571
|
+
#
|
572
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
573
|
+
# request = Google::Cloud::Bigquery::Migration::V2::StartMigrationWorkflowRequest.new
|
574
|
+
#
|
575
|
+
# # Call the start_migration_workflow method.
|
576
|
+
# result = client.start_migration_workflow request
|
577
|
+
#
|
578
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
579
|
+
# p result
|
580
|
+
#
|
581
|
+
def start_migration_workflow request, options = nil
|
582
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
583
|
+
|
584
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Migration::V2::StartMigrationWorkflowRequest
|
585
|
+
|
586
|
+
# Converts hash and nil to an options object
|
587
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
588
|
+
|
589
|
+
# Customize the options with defaults
|
590
|
+
metadata = @config.rpcs.start_migration_workflow.metadata.to_h
|
591
|
+
|
592
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
593
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
594
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
595
|
+
gapic_version: ::Google::Cloud::Bigquery::Migration::V2::VERSION
|
596
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
597
|
+
|
598
|
+
header_params = {}
|
599
|
+
if request.name
|
600
|
+
header_params["name"] = request.name
|
601
|
+
end
|
602
|
+
|
603
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
604
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
605
|
+
|
606
|
+
options.apply_defaults timeout: @config.rpcs.start_migration_workflow.timeout,
|
607
|
+
metadata: metadata,
|
608
|
+
retry_policy: @config.rpcs.start_migration_workflow.retry_policy
|
609
|
+
|
610
|
+
options.apply_defaults timeout: @config.timeout,
|
611
|
+
metadata: @config.metadata,
|
612
|
+
retry_policy: @config.retry_policy
|
613
|
+
|
614
|
+
@migration_service_stub.call_rpc :start_migration_workflow, request, options: options do |response, operation|
|
615
|
+
yield response, operation if block_given?
|
616
|
+
return response
|
617
|
+
end
|
618
|
+
rescue ::GRPC::BadStatus => e
|
619
|
+
raise ::Google::Cloud::Error.from_error(e)
|
620
|
+
end
|
621
|
+
|
622
|
+
##
|
623
|
+
# Gets a previously created migration subtask.
|
624
|
+
#
|
625
|
+
# @overload get_migration_subtask(request, options = nil)
|
626
|
+
# Pass arguments to `get_migration_subtask` via a request object, either of type
|
627
|
+
# {::Google::Cloud::Bigquery::Migration::V2::GetMigrationSubtaskRequest} or an equivalent Hash.
|
628
|
+
#
|
629
|
+
# @param request [::Google::Cloud::Bigquery::Migration::V2::GetMigrationSubtaskRequest, ::Hash]
|
630
|
+
# A request object representing the call parameters. Required. To specify no
|
631
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
632
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
633
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
634
|
+
#
|
635
|
+
# @overload get_migration_subtask(name: nil, read_mask: nil)
|
636
|
+
# Pass arguments to `get_migration_subtask` via keyword arguments. Note that at
|
637
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
638
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
639
|
+
#
|
640
|
+
# @param name [::String]
|
641
|
+
# Required. The unique identifier for the migration subtask.
|
642
|
+
# Example: `projects/123/locations/us/workflows/1234/subtasks/543`
|
643
|
+
# @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
|
644
|
+
# Optional. The list of fields to be retrieved.
|
645
|
+
#
|
646
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
647
|
+
# @yieldparam response [::Google::Cloud::Bigquery::Migration::V2::MigrationSubtask]
|
648
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
649
|
+
#
|
650
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::MigrationSubtask]
|
651
|
+
#
|
652
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
653
|
+
#
|
654
|
+
# @example Basic example
|
655
|
+
# require "google/cloud/bigquery/migration/v2"
|
656
|
+
#
|
657
|
+
# # Create a client object. The client can be reused for multiple calls.
|
658
|
+
# client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new
|
659
|
+
#
|
660
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
661
|
+
# request = Google::Cloud::Bigquery::Migration::V2::GetMigrationSubtaskRequest.new
|
662
|
+
#
|
663
|
+
# # Call the get_migration_subtask method.
|
664
|
+
# result = client.get_migration_subtask request
|
665
|
+
#
|
666
|
+
# # The returned object is of type Google::Cloud::Bigquery::Migration::V2::MigrationSubtask.
|
667
|
+
# p result
|
668
|
+
#
|
669
|
+
def get_migration_subtask request, options = nil
|
670
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
671
|
+
|
672
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Migration::V2::GetMigrationSubtaskRequest
|
673
|
+
|
674
|
+
# Converts hash and nil to an options object
|
675
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
676
|
+
|
677
|
+
# Customize the options with defaults
|
678
|
+
metadata = @config.rpcs.get_migration_subtask.metadata.to_h
|
679
|
+
|
680
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
681
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
682
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
683
|
+
gapic_version: ::Google::Cloud::Bigquery::Migration::V2::VERSION
|
684
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
685
|
+
|
686
|
+
header_params = {}
|
687
|
+
if request.name
|
688
|
+
header_params["name"] = request.name
|
689
|
+
end
|
690
|
+
|
691
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
692
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
693
|
+
|
694
|
+
options.apply_defaults timeout: @config.rpcs.get_migration_subtask.timeout,
|
695
|
+
metadata: metadata,
|
696
|
+
retry_policy: @config.rpcs.get_migration_subtask.retry_policy
|
697
|
+
|
698
|
+
options.apply_defaults timeout: @config.timeout,
|
699
|
+
metadata: @config.metadata,
|
700
|
+
retry_policy: @config.retry_policy
|
701
|
+
|
702
|
+
@migration_service_stub.call_rpc :get_migration_subtask, request, options: options do |response, operation|
|
703
|
+
yield response, operation if block_given?
|
704
|
+
return response
|
705
|
+
end
|
706
|
+
rescue ::GRPC::BadStatus => e
|
707
|
+
raise ::Google::Cloud::Error.from_error(e)
|
708
|
+
end
|
709
|
+
|
710
|
+
##
|
711
|
+
# Lists previously created migration subtasks.
|
712
|
+
#
|
713
|
+
# @overload list_migration_subtasks(request, options = nil)
|
714
|
+
# Pass arguments to `list_migration_subtasks` via a request object, either of type
|
715
|
+
# {::Google::Cloud::Bigquery::Migration::V2::ListMigrationSubtasksRequest} or an equivalent Hash.
|
716
|
+
#
|
717
|
+
# @param request [::Google::Cloud::Bigquery::Migration::V2::ListMigrationSubtasksRequest, ::Hash]
|
718
|
+
# A request object representing the call parameters. Required. To specify no
|
719
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
720
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
721
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
722
|
+
#
|
723
|
+
# @overload list_migration_subtasks(parent: nil, read_mask: nil, page_size: nil, page_token: nil, filter: nil)
|
724
|
+
# Pass arguments to `list_migration_subtasks` via keyword arguments. Note that at
|
725
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
726
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
727
|
+
#
|
728
|
+
# @param parent [::String]
|
729
|
+
# Required. The migration task of the subtasks to list.
|
730
|
+
# Example: `projects/123/locations/us/workflows/1234`
|
731
|
+
# @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
|
732
|
+
# Optional. The list of fields to be retrieved.
|
733
|
+
# @param page_size [::Integer]
|
734
|
+
# Optional. The maximum number of migration tasks to return. The service may return
|
735
|
+
# fewer than this number.
|
736
|
+
# @param page_token [::String]
|
737
|
+
# Optional. A page token, received from previous `ListMigrationSubtasks` call.
|
738
|
+
# Provide this to retrieve the subsequent page.
|
739
|
+
#
|
740
|
+
# When paginating, all other parameters provided to `ListMigrationSubtasks`
|
741
|
+
# must match the call that provided the page token.
|
742
|
+
# @param filter [::String]
|
743
|
+
# Optional. The filter to apply. This can be used to get the subtasks of a specific
|
744
|
+
# tasks in a workflow, e.g. `migration_task = "ab012"` where `"ab012"` is the
|
745
|
+
# task ID (not the name in the named map).
|
746
|
+
#
|
747
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
748
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Migration::V2::MigrationSubtask>]
|
749
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
750
|
+
#
|
751
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Migration::V2::MigrationSubtask>]
|
752
|
+
#
|
753
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
754
|
+
#
|
755
|
+
# @example Basic example
|
756
|
+
# require "google/cloud/bigquery/migration/v2"
|
757
|
+
#
|
758
|
+
# # Create a client object. The client can be reused for multiple calls.
|
759
|
+
# client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new
|
760
|
+
#
|
761
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
762
|
+
# request = Google::Cloud::Bigquery::Migration::V2::ListMigrationSubtasksRequest.new
|
763
|
+
#
|
764
|
+
# # Call the list_migration_subtasks method.
|
765
|
+
# result = client.list_migration_subtasks request
|
766
|
+
#
|
767
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
768
|
+
# # iterate over all elements by calling #each, and the enumerable
|
769
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
770
|
+
# # methods are also available for managing paging directly.
|
771
|
+
# result.each do |response|
|
772
|
+
# # Each element is of type ::Google::Cloud::Bigquery::Migration::V2::MigrationSubtask.
|
773
|
+
# p response
|
774
|
+
# end
|
775
|
+
#
|
776
|
+
def list_migration_subtasks request, options = nil
|
777
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
778
|
+
|
779
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Migration::V2::ListMigrationSubtasksRequest
|
780
|
+
|
781
|
+
# Converts hash and nil to an options object
|
782
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
783
|
+
|
784
|
+
# Customize the options with defaults
|
785
|
+
metadata = @config.rpcs.list_migration_subtasks.metadata.to_h
|
786
|
+
|
787
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
788
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
789
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
790
|
+
gapic_version: ::Google::Cloud::Bigquery::Migration::V2::VERSION
|
791
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
792
|
+
|
793
|
+
header_params = {}
|
794
|
+
if request.parent
|
795
|
+
header_params["parent"] = request.parent
|
796
|
+
end
|
797
|
+
|
798
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
799
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
800
|
+
|
801
|
+
options.apply_defaults timeout: @config.rpcs.list_migration_subtasks.timeout,
|
802
|
+
metadata: metadata,
|
803
|
+
retry_policy: @config.rpcs.list_migration_subtasks.retry_policy
|
804
|
+
|
805
|
+
options.apply_defaults timeout: @config.timeout,
|
806
|
+
metadata: @config.metadata,
|
807
|
+
retry_policy: @config.retry_policy
|
808
|
+
|
809
|
+
@migration_service_stub.call_rpc :list_migration_subtasks, request, options: options do |response, operation|
|
810
|
+
response = ::Gapic::PagedEnumerable.new @migration_service_stub, :list_migration_subtasks, request, response, operation, options
|
811
|
+
yield response, operation if block_given?
|
812
|
+
return response
|
813
|
+
end
|
814
|
+
rescue ::GRPC::BadStatus => e
|
815
|
+
raise ::Google::Cloud::Error.from_error(e)
|
816
|
+
end
|
817
|
+
|
818
|
+
##
|
819
|
+
# Configuration class for the MigrationService API.
|
820
|
+
#
|
821
|
+
# This class represents the configuration for MigrationService,
|
822
|
+
# providing control over timeouts, retry behavior, logging, transport
|
823
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
824
|
+
# applied individually to specific RPCs. See
|
825
|
+
# {::Google::Cloud::Bigquery::Migration::V2::MigrationService::Client::Configuration::Rpcs}
|
826
|
+
# for a list of RPCs that can be configured independently.
|
827
|
+
#
|
828
|
+
# Configuration can be applied globally to all clients, or to a single client
|
829
|
+
# on construction.
|
830
|
+
#
|
831
|
+
# @example
|
832
|
+
#
|
833
|
+
# # Modify the global config, setting the timeout for
|
834
|
+
# # create_migration_workflow to 20 seconds,
|
835
|
+
# # and all remaining timeouts to 10 seconds.
|
836
|
+
# ::Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.configure do |config|
|
837
|
+
# config.timeout = 10.0
|
838
|
+
# config.rpcs.create_migration_workflow.timeout = 20.0
|
839
|
+
# end
|
840
|
+
#
|
841
|
+
# # Apply the above configuration only to a new client.
|
842
|
+
# client = ::Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new do |config|
|
843
|
+
# config.timeout = 10.0
|
844
|
+
# config.rpcs.create_migration_workflow.timeout = 20.0
|
845
|
+
# end
|
846
|
+
#
|
847
|
+
# @!attribute [rw] endpoint
|
848
|
+
# The hostname or hostname:port of the service endpoint.
|
849
|
+
# Defaults to `"bigquerymigration.googleapis.com"`.
|
850
|
+
# @return [::String]
|
851
|
+
# @!attribute [rw] credentials
|
852
|
+
# Credentials to send with calls. You may provide any of the following types:
|
853
|
+
# * (`String`) The path to a service account key file in JSON format
|
854
|
+
# * (`Hash`) A service account key as a Hash
|
855
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
856
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
857
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
858
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
859
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
860
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
861
|
+
# * (`nil`) indicating no credentials
|
862
|
+
# @return [::Object]
|
863
|
+
# @!attribute [rw] scope
|
864
|
+
# The OAuth scopes
|
865
|
+
# @return [::Array<::String>]
|
866
|
+
# @!attribute [rw] lib_name
|
867
|
+
# The library name as recorded in instrumentation and logging
|
868
|
+
# @return [::String]
|
869
|
+
# @!attribute [rw] lib_version
|
870
|
+
# The library version as recorded in instrumentation and logging
|
871
|
+
# @return [::String]
|
872
|
+
# @!attribute [rw] channel_args
|
873
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
874
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
875
|
+
# @return [::Hash]
|
876
|
+
# @!attribute [rw] interceptors
|
877
|
+
# An array of interceptors that are run before calls are executed.
|
878
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
879
|
+
# @!attribute [rw] timeout
|
880
|
+
# The call timeout in seconds.
|
881
|
+
# @return [::Numeric]
|
882
|
+
# @!attribute [rw] metadata
|
883
|
+
# Additional gRPC headers to be sent with the call.
|
884
|
+
# @return [::Hash{::Symbol=>::String}]
|
885
|
+
# @!attribute [rw] retry_policy
|
886
|
+
# The retry policy. The value is a hash with the following keys:
|
887
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
888
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
889
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
890
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
891
|
+
# trigger a retry.
|
892
|
+
# @return [::Hash]
|
893
|
+
# @!attribute [rw] quota_project
|
894
|
+
# A separate project against which to charge quota.
|
895
|
+
# @return [::String]
|
896
|
+
#
|
897
|
+
class Configuration
|
898
|
+
extend ::Gapic::Config
|
899
|
+
|
900
|
+
config_attr :endpoint, "bigquerymigration.googleapis.com", ::String
|
901
|
+
config_attr :credentials, nil do |value|
|
902
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
903
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
904
|
+
allowed.any? { |klass| klass === value }
|
905
|
+
end
|
906
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
907
|
+
config_attr :lib_name, nil, ::String, nil
|
908
|
+
config_attr :lib_version, nil, ::String, nil
|
909
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
910
|
+
config_attr :interceptors, nil, ::Array, nil
|
911
|
+
config_attr :timeout, nil, ::Numeric, nil
|
912
|
+
config_attr :metadata, nil, ::Hash, nil
|
913
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
914
|
+
config_attr :quota_project, nil, ::String, nil
|
915
|
+
|
916
|
+
# @private
|
917
|
+
def initialize parent_config = nil
|
918
|
+
@parent_config = parent_config unless parent_config.nil?
|
919
|
+
|
920
|
+
yield self if block_given?
|
921
|
+
end
|
922
|
+
|
923
|
+
##
|
924
|
+
# Configurations for individual RPCs
|
925
|
+
# @return [Rpcs]
|
926
|
+
#
|
927
|
+
def rpcs
|
928
|
+
@rpcs ||= begin
|
929
|
+
parent_rpcs = nil
|
930
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
931
|
+
Rpcs.new parent_rpcs
|
932
|
+
end
|
933
|
+
end
|
934
|
+
|
935
|
+
##
|
936
|
+
# Configuration RPC class for the MigrationService API.
|
937
|
+
#
|
938
|
+
# Includes fields providing the configuration for each RPC in this service.
|
939
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
940
|
+
# the following configuration fields:
|
941
|
+
#
|
942
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
943
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
944
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
945
|
+
# include the following keys:
|
946
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
947
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
948
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
949
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
950
|
+
# trigger a retry.
|
951
|
+
#
|
952
|
+
class Rpcs
|
953
|
+
##
|
954
|
+
# RPC-specific configuration for `create_migration_workflow`
|
955
|
+
# @return [::Gapic::Config::Method]
|
956
|
+
#
|
957
|
+
attr_reader :create_migration_workflow
|
958
|
+
##
|
959
|
+
# RPC-specific configuration for `get_migration_workflow`
|
960
|
+
# @return [::Gapic::Config::Method]
|
961
|
+
#
|
962
|
+
attr_reader :get_migration_workflow
|
963
|
+
##
|
964
|
+
# RPC-specific configuration for `list_migration_workflows`
|
965
|
+
# @return [::Gapic::Config::Method]
|
966
|
+
#
|
967
|
+
attr_reader :list_migration_workflows
|
968
|
+
##
|
969
|
+
# RPC-specific configuration for `delete_migration_workflow`
|
970
|
+
# @return [::Gapic::Config::Method]
|
971
|
+
#
|
972
|
+
attr_reader :delete_migration_workflow
|
973
|
+
##
|
974
|
+
# RPC-specific configuration for `start_migration_workflow`
|
975
|
+
# @return [::Gapic::Config::Method]
|
976
|
+
#
|
977
|
+
attr_reader :start_migration_workflow
|
978
|
+
##
|
979
|
+
# RPC-specific configuration for `get_migration_subtask`
|
980
|
+
# @return [::Gapic::Config::Method]
|
981
|
+
#
|
982
|
+
attr_reader :get_migration_subtask
|
983
|
+
##
|
984
|
+
# RPC-specific configuration for `list_migration_subtasks`
|
985
|
+
# @return [::Gapic::Config::Method]
|
986
|
+
#
|
987
|
+
attr_reader :list_migration_subtasks
|
988
|
+
|
989
|
+
# @private
|
990
|
+
def initialize parent_rpcs = nil
|
991
|
+
create_migration_workflow_config = parent_rpcs.create_migration_workflow if parent_rpcs.respond_to? :create_migration_workflow
|
992
|
+
@create_migration_workflow = ::Gapic::Config::Method.new create_migration_workflow_config
|
993
|
+
get_migration_workflow_config = parent_rpcs.get_migration_workflow if parent_rpcs.respond_to? :get_migration_workflow
|
994
|
+
@get_migration_workflow = ::Gapic::Config::Method.new get_migration_workflow_config
|
995
|
+
list_migration_workflows_config = parent_rpcs.list_migration_workflows if parent_rpcs.respond_to? :list_migration_workflows
|
996
|
+
@list_migration_workflows = ::Gapic::Config::Method.new list_migration_workflows_config
|
997
|
+
delete_migration_workflow_config = parent_rpcs.delete_migration_workflow if parent_rpcs.respond_to? :delete_migration_workflow
|
998
|
+
@delete_migration_workflow = ::Gapic::Config::Method.new delete_migration_workflow_config
|
999
|
+
start_migration_workflow_config = parent_rpcs.start_migration_workflow if parent_rpcs.respond_to? :start_migration_workflow
|
1000
|
+
@start_migration_workflow = ::Gapic::Config::Method.new start_migration_workflow_config
|
1001
|
+
get_migration_subtask_config = parent_rpcs.get_migration_subtask if parent_rpcs.respond_to? :get_migration_subtask
|
1002
|
+
@get_migration_subtask = ::Gapic::Config::Method.new get_migration_subtask_config
|
1003
|
+
list_migration_subtasks_config = parent_rpcs.list_migration_subtasks if parent_rpcs.respond_to? :list_migration_subtasks
|
1004
|
+
@list_migration_subtasks = ::Gapic::Config::Method.new list_migration_subtasks_config
|
1005
|
+
|
1006
|
+
yield self if block_given?
|
1007
|
+
end
|
1008
|
+
end
|
1009
|
+
end
|
1010
|
+
end
|
1011
|
+
end
|
1012
|
+
end
|
1013
|
+
end
|
1014
|
+
end
|
1015
|
+
end
|
1016
|
+
end
|