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