tencentcloud-sdk-dts 3.0.439 → 3.0.440

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,907 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
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
+ # http://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
+ require 'json'
18
+
19
+ module TencentCloud
20
+ module Dts
21
+ module V20211206
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2021-12-06'
26
+ api_endpoint = 'dts.tencentcloudapi.com'
27
+ sdk_version = 'DTS_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 本接口(CompleteMigrateJob)用于完成数据迁移任务。
33
+ # 选择采用增量迁移方式的任务, 需要在迁移进度进入准备完成阶段后, 调用本接口, 停止迁移增量数据。
34
+ # 通过DescribeMigrationJobs接口查询到任务的状态为准备完成(Status="readyComplete")时,此时可以调用本接口完成迁移任务。
35
+
36
+ # @param request: Request instance for CompleteMigrateJob.
37
+ # @type request: :class:`Tencentcloud::dts::V20211206::CompleteMigrateJobRequest`
38
+ # @rtype: :class:`Tencentcloud::dts::V20211206::CompleteMigrateJobResponse`
39
+ def CompleteMigrateJob(request)
40
+ body = send_request('CompleteMigrateJob', request.serialize)
41
+ response = JSON.parse(body)
42
+ if response['Response'].key?('Error') == false
43
+ model = CompleteMigrateJobResponse.new
44
+ model.deserialize(response['Response'])
45
+ model
46
+ else
47
+ code = response['Response']['Error']['Code']
48
+ message = response['Response']['Error']['Message']
49
+ reqid = response['Response']['RequestId']
50
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
51
+ end
52
+ rescue TencentCloud::Common::TencentCloudSDKException => e
53
+ raise e
54
+ rescue StandardError => e
55
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
56
+ end
57
+
58
+ # 配置一个同步任务
59
+
60
+ # @param request: Request instance for ConfigureSyncJob.
61
+ # @type request: :class:`Tencentcloud::dts::V20211206::ConfigureSyncJobRequest`
62
+ # @rtype: :class:`Tencentcloud::dts::V20211206::ConfigureSyncJobResponse`
63
+ def ConfigureSyncJob(request)
64
+ body = send_request('ConfigureSyncJob', request.serialize)
65
+ response = JSON.parse(body)
66
+ if response['Response'].key?('Error') == false
67
+ model = ConfigureSyncJobResponse.new
68
+ model.deserialize(response['Response'])
69
+ model
70
+ else
71
+ code = response['Response']['Error']['Code']
72
+ message = response['Response']['Error']['Message']
73
+ reqid = response['Response']['RequestId']
74
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
75
+ end
76
+ rescue TencentCloud::Common::TencentCloudSDKException => e
77
+ raise e
78
+ rescue StandardError => e
79
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
80
+ end
81
+
82
+ # 校验同步任务,检查必要参数和周边
83
+
84
+ # @param request: Request instance for CreateCheckSyncJob.
85
+ # @type request: :class:`Tencentcloud::dts::V20211206::CreateCheckSyncJobRequest`
86
+ # @rtype: :class:`Tencentcloud::dts::V20211206::CreateCheckSyncJobResponse`
87
+ def CreateCheckSyncJob(request)
88
+ body = send_request('CreateCheckSyncJob', request.serialize)
89
+ response = JSON.parse(body)
90
+ if response['Response'].key?('Error') == false
91
+ model = CreateCheckSyncJobResponse.new
92
+ model.deserialize(response['Response'])
93
+ model
94
+ else
95
+ code = response['Response']['Error']['Code']
96
+ message = response['Response']['Error']['Message']
97
+ reqid = response['Response']['RequestId']
98
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
99
+ end
100
+ rescue TencentCloud::Common::TencentCloudSDKException => e
101
+ raise e
102
+ rescue StandardError => e
103
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
104
+ end
105
+
106
+ # 本接口用于创建数据对比任务,创建成功后会返回数据对比任务 ID,形如:dts-8yv4w2i1-cmp-37skmii9,创建成功后可通过StartCompare启动一致性校验任务
107
+
108
+ # @param request: Request instance for CreateCompareTask.
109
+ # @type request: :class:`Tencentcloud::dts::V20211206::CreateCompareTaskRequest`
110
+ # @rtype: :class:`Tencentcloud::dts::V20211206::CreateCompareTaskResponse`
111
+ def CreateCompareTask(request)
112
+ body = send_request('CreateCompareTask', request.serialize)
113
+ response = JSON.parse(body)
114
+ if response['Response'].key?('Error') == false
115
+ model = CreateCompareTaskResponse.new
116
+ model.deserialize(response['Response'])
117
+ model
118
+ else
119
+ code = response['Response']['Error']['Code']
120
+ message = response['Response']['Error']['Message']
121
+ reqid = response['Response']['RequestId']
122
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
123
+ end
124
+ rescue TencentCloud::Common::TencentCloudSDKException => e
125
+ raise e
126
+ rescue StandardError => e
127
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
128
+ end
129
+
130
+ # 校验迁移任务,
131
+ # 在开始迁移前, 必须调用本接口创建校验迁移任务, 且校验成功后才能开始迁移. 校验的结果可以通过DescribeMigrationCheckJob查看,
132
+ # 校验成功后,迁移任务若有修改, 则必须重新校验并通过后, 才能开始迁移
133
+
134
+ # @param request: Request instance for CreateMigrateCheckJob.
135
+ # @type request: :class:`Tencentcloud::dts::V20211206::CreateMigrateCheckJobRequest`
136
+ # @rtype: :class:`Tencentcloud::dts::V20211206::CreateMigrateCheckJobResponse`
137
+ def CreateMigrateCheckJob(request)
138
+ body = send_request('CreateMigrateCheckJob', request.serialize)
139
+ response = JSON.parse(body)
140
+ if response['Response'].key?('Error') == false
141
+ model = CreateMigrateCheckJobResponse.new
142
+ model.deserialize(response['Response'])
143
+ model
144
+ else
145
+ code = response['Response']['Error']['Code']
146
+ message = response['Response']['Error']['Message']
147
+ reqid = response['Response']['RequestId']
148
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
149
+ end
150
+ rescue TencentCloud::Common::TencentCloudSDKException => e
151
+ raise e
152
+ rescue StandardError => e
153
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
154
+ end
155
+
156
+ # 购买迁移服务。购买成功后会返回随机生成的迁移服务id列表,也可以通过查询迁移服务任务列表接口`DescribeMigrationJobs`看到购买成功的实例Id。注意,一旦购买成功后源及目标数据库类型,源及目标实例地域不可修改。
157
+
158
+ # @param request: Request instance for CreateMigrationService.
159
+ # @type request: :class:`Tencentcloud::dts::V20211206::CreateMigrationServiceRequest`
160
+ # @rtype: :class:`Tencentcloud::dts::V20211206::CreateMigrationServiceResponse`
161
+ def CreateMigrationService(request)
162
+ body = send_request('CreateMigrationService', request.serialize)
163
+ response = JSON.parse(body)
164
+ if response['Response'].key?('Error') == false
165
+ model = CreateMigrationServiceResponse.new
166
+ model.deserialize(response['Response'])
167
+ model
168
+ else
169
+ code = response['Response']['Error']['Code']
170
+ message = response['Response']['Error']['Message']
171
+ reqid = response['Response']['RequestId']
172
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
173
+ end
174
+ rescue TencentCloud::Common::TencentCloudSDKException => e
175
+ raise e
176
+ rescue StandardError => e
177
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
178
+ end
179
+
180
+ # 创建一个同步任务
181
+
182
+ # @param request: Request instance for CreateSyncJob.
183
+ # @type request: :class:`Tencentcloud::dts::V20211206::CreateSyncJobRequest`
184
+ # @rtype: :class:`Tencentcloud::dts::V20211206::CreateSyncJobResponse`
185
+ def CreateSyncJob(request)
186
+ body = send_request('CreateSyncJob', request.serialize)
187
+ response = JSON.parse(body)
188
+ if response['Response'].key?('Error') == false
189
+ model = CreateSyncJobResponse.new
190
+ model.deserialize(response['Response'])
191
+ model
192
+ else
193
+ code = response['Response']['Error']['Code']
194
+ message = response['Response']['Error']['Message']
195
+ reqid = response['Response']['RequestId']
196
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
197
+ end
198
+ rescue TencentCloud::Common::TencentCloudSDKException => e
199
+ raise e
200
+ rescue StandardError => e
201
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
202
+ end
203
+
204
+ # 删除一致性校验任务
205
+
206
+ # @param request: Request instance for DeleteCompareTask.
207
+ # @type request: :class:`Tencentcloud::dts::V20211206::DeleteCompareTaskRequest`
208
+ # @rtype: :class:`Tencentcloud::dts::V20211206::DeleteCompareTaskResponse`
209
+ def DeleteCompareTask(request)
210
+ body = send_request('DeleteCompareTask', request.serialize)
211
+ response = JSON.parse(body)
212
+ if response['Response'].key?('Error') == false
213
+ model = DeleteCompareTaskResponse.new
214
+ model.deserialize(response['Response'])
215
+ model
216
+ else
217
+ code = response['Response']['Error']['Code']
218
+ message = response['Response']['Error']['Message']
219
+ reqid = response['Response']['RequestId']
220
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
221
+ end
222
+ rescue TencentCloud::Common::TencentCloudSDKException => e
223
+ raise e
224
+ rescue StandardError => e
225
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
226
+ end
227
+
228
+ # 查询校验同步任务结果
229
+
230
+ # @param request: Request instance for DescribeCheckSyncJobResult.
231
+ # @type request: :class:`Tencentcloud::dts::V20211206::DescribeCheckSyncJobResultRequest`
232
+ # @rtype: :class:`Tencentcloud::dts::V20211206::DescribeCheckSyncJobResultResponse`
233
+ def DescribeCheckSyncJobResult(request)
234
+ body = send_request('DescribeCheckSyncJobResult', request.serialize)
235
+ response = JSON.parse(body)
236
+ if response['Response'].key?('Error') == false
237
+ model = DescribeCheckSyncJobResultResponse.new
238
+ model.deserialize(response['Response'])
239
+ model
240
+ else
241
+ code = response['Response']['Error']['Code']
242
+ message = response['Response']['Error']['Message']
243
+ reqid = response['Response']['RequestId']
244
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
245
+ end
246
+ rescue TencentCloud::Common::TencentCloudSDKException => e
247
+ raise e
248
+ rescue StandardError => e
249
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
250
+ end
251
+
252
+ # 查询一致性校验任务详情
253
+
254
+ # @param request: Request instance for DescribeCompareReport.
255
+ # @type request: :class:`Tencentcloud::dts::V20211206::DescribeCompareReportRequest`
256
+ # @rtype: :class:`Tencentcloud::dts::V20211206::DescribeCompareReportResponse`
257
+ def DescribeCompareReport(request)
258
+ body = send_request('DescribeCompareReport', request.serialize)
259
+ response = JSON.parse(body)
260
+ if response['Response'].key?('Error') == false
261
+ model = DescribeCompareReportResponse.new
262
+ model.deserialize(response['Response'])
263
+ model
264
+ else
265
+ code = response['Response']['Error']['Code']
266
+ message = response['Response']['Error']['Message']
267
+ reqid = response['Response']['RequestId']
268
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
269
+ end
270
+ rescue TencentCloud::Common::TencentCloudSDKException => e
271
+ raise e
272
+ rescue StandardError => e
273
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
274
+ end
275
+
276
+ # 查询一致性校验任务列表,调用该接口后可通过接口`DescribeCompareTasks` 查询一致性校验任务列表来获得启动后的状态。
277
+
278
+ # @param request: Request instance for DescribeCompareTasks.
279
+ # @type request: :class:`Tencentcloud::dts::V20211206::DescribeCompareTasksRequest`
280
+ # @rtype: :class:`Tencentcloud::dts::V20211206::DescribeCompareTasksResponse`
281
+ def DescribeCompareTasks(request)
282
+ body = send_request('DescribeCompareTasks', request.serialize)
283
+ response = JSON.parse(body)
284
+ if response['Response'].key?('Error') == false
285
+ model = DescribeCompareTasksResponse.new
286
+ model.deserialize(response['Response'])
287
+ model
288
+ else
289
+ code = response['Response']['Error']['Code']
290
+ message = response['Response']['Error']['Message']
291
+ reqid = response['Response']['RequestId']
292
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
293
+ end
294
+ rescue TencentCloud::Common::TencentCloudSDKException => e
295
+ raise e
296
+ rescue StandardError => e
297
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
298
+ end
299
+
300
+ # 本接口用于查询支持迁移的是云数据库实例
301
+
302
+ # @param request: Request instance for DescribeMigrateDBInstances.
303
+ # @type request: :class:`Tencentcloud::dts::V20211206::DescribeMigrateDBInstancesRequest`
304
+ # @rtype: :class:`Tencentcloud::dts::V20211206::DescribeMigrateDBInstancesResponse`
305
+ def DescribeMigrateDBInstances(request)
306
+ body = send_request('DescribeMigrateDBInstances', request.serialize)
307
+ response = JSON.parse(body)
308
+ if response['Response'].key?('Error') == false
309
+ model = DescribeMigrateDBInstancesResponse.new
310
+ model.deserialize(response['Response'])
311
+ model
312
+ else
313
+ code = response['Response']['Error']['Code']
314
+ message = response['Response']['Error']['Message']
315
+ reqid = response['Response']['RequestId']
316
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
317
+ end
318
+ rescue TencentCloud::Common::TencentCloudSDKException => e
319
+ raise e
320
+ rescue StandardError => e
321
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
322
+ end
323
+
324
+ # 本接口用于创建校验后,获取校验的结果. 能查询到当前校验的状态和进度.
325
+ # 若通过校验, 则可调用'StartMigrateJob' 开始迁移.
326
+ # 若未通过校验, 则能查询到校验失败的原因. 请按照报错, 通过'ModifyMigrationJob'修改迁移配置或是调整源/目标实例的相关参数.
327
+
328
+ # @param request: Request instance for DescribeMigrationCheckJob.
329
+ # @type request: :class:`Tencentcloud::dts::V20211206::DescribeMigrationCheckJobRequest`
330
+ # @rtype: :class:`Tencentcloud::dts::V20211206::DescribeMigrationCheckJobResponse`
331
+ def DescribeMigrationCheckJob(request)
332
+ body = send_request('DescribeMigrationCheckJob', request.serialize)
333
+ response = JSON.parse(body)
334
+ if response['Response'].key?('Error') == false
335
+ model = DescribeMigrationCheckJobResponse.new
336
+ model.deserialize(response['Response'])
337
+ model
338
+ else
339
+ code = response['Response']['Error']['Code']
340
+ message = response['Response']['Error']['Message']
341
+ reqid = response['Response']['RequestId']
342
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
343
+ end
344
+ rescue TencentCloud::Common::TencentCloudSDKException => e
345
+ raise e
346
+ rescue StandardError => e
347
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
348
+ end
349
+
350
+ # 查询某个数据迁移任务详情
351
+
352
+ # @param request: Request instance for DescribeMigrationDetail.
353
+ # @type request: :class:`Tencentcloud::dts::V20211206::DescribeMigrationDetailRequest`
354
+ # @rtype: :class:`Tencentcloud::dts::V20211206::DescribeMigrationDetailResponse`
355
+ def DescribeMigrationDetail(request)
356
+ body = send_request('DescribeMigrationDetail', request.serialize)
357
+ response = JSON.parse(body)
358
+ if response['Response'].key?('Error') == false
359
+ model = DescribeMigrationDetailResponse.new
360
+ model.deserialize(response['Response'])
361
+ model
362
+ else
363
+ code = response['Response']['Error']['Code']
364
+ message = response['Response']['Error']['Message']
365
+ reqid = response['Response']['RequestId']
366
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
367
+ end
368
+ rescue TencentCloud::Common::TencentCloudSDKException => e
369
+ raise e
370
+ rescue StandardError => e
371
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
372
+ end
373
+
374
+ # 查询数据迁移任务列表
375
+
376
+ # @param request: Request instance for DescribeMigrationJobs.
377
+ # @type request: :class:`Tencentcloud::dts::V20211206::DescribeMigrationJobsRequest`
378
+ # @rtype: :class:`Tencentcloud::dts::V20211206::DescribeMigrationJobsResponse`
379
+ def DescribeMigrationJobs(request)
380
+ body = send_request('DescribeMigrationJobs', request.serialize)
381
+ response = JSON.parse(body)
382
+ if response['Response'].key?('Error') == false
383
+ model = DescribeMigrationJobsResponse.new
384
+ model.deserialize(response['Response'])
385
+ model
386
+ else
387
+ code = response['Response']['Error']['Code']
388
+ message = response['Response']['Error']['Message']
389
+ reqid = response['Response']['RequestId']
390
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
391
+ end
392
+ rescue TencentCloud::Common::TencentCloudSDKException => e
393
+ raise e
394
+ rescue StandardError => e
395
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
396
+ end
397
+
398
+ # 查询同步任务信息
399
+
400
+ # @param request: Request instance for DescribeSyncJobs.
401
+ # @type request: :class:`Tencentcloud::dts::V20211206::DescribeSyncJobsRequest`
402
+ # @rtype: :class:`Tencentcloud::dts::V20211206::DescribeSyncJobsResponse`
403
+ def DescribeSyncJobs(request)
404
+ body = send_request('DescribeSyncJobs', request.serialize)
405
+ response = JSON.parse(body)
406
+ if response['Response'].key?('Error') == false
407
+ model = DescribeSyncJobsResponse.new
408
+ model.deserialize(response['Response'])
409
+ model
410
+ else
411
+ code = response['Response']['Error']['Code']
412
+ message = response['Response']['Error']['Message']
413
+ reqid = response['Response']['RequestId']
414
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
415
+ end
416
+ rescue TencentCloud::Common::TencentCloudSDKException => e
417
+ raise e
418
+ rescue StandardError => e
419
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
420
+ end
421
+
422
+ # 下线删除数据迁移任务。计费任务必须先调用隔离(IsolateMigrateJob)接口,且只有是**已隔离**状态下,才能调用此接口销毁任务。对于不计费任务,调用隔离(IsolateMigrateJob)接口删除任务操作。
423
+
424
+ # @param request: Request instance for DestroyMigrateJob.
425
+ # @type request: :class:`Tencentcloud::dts::V20211206::DestroyMigrateJobRequest`
426
+ # @rtype: :class:`Tencentcloud::dts::V20211206::DestroyMigrateJobResponse`
427
+ def DestroyMigrateJob(request)
428
+ body = send_request('DestroyMigrateJob', request.serialize)
429
+ response = JSON.parse(body)
430
+ if response['Response'].key?('Error') == false
431
+ model = DestroyMigrateJobResponse.new
432
+ model.deserialize(response['Response'])
433
+ model
434
+ else
435
+ code = response['Response']['Error']['Code']
436
+ message = response['Response']['Error']['Message']
437
+ reqid = response['Response']['RequestId']
438
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
439
+ end
440
+ rescue TencentCloud::Common::TencentCloudSDKException => e
441
+ raise e
442
+ rescue StandardError => e
443
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
444
+ end
445
+
446
+ # 下线同步任务,任务在已隔离状态下可以通过此操作进行任务下线,即彻底删除任务。下线操作后可通过查询同步任务信息接口DescribeSyncJobs,获取下线后任务列表,此操作成功后无法看到此任务表示下线成功。
447
+
448
+ # @param request: Request instance for DestroySyncJob.
449
+ # @type request: :class:`Tencentcloud::dts::V20211206::DestroySyncJobRequest`
450
+ # @rtype: :class:`Tencentcloud::dts::V20211206::DestroySyncJobResponse`
451
+ def DestroySyncJob(request)
452
+ body = send_request('DestroySyncJob', request.serialize)
453
+ response = JSON.parse(body)
454
+ if response['Response'].key?('Error') == false
455
+ model = DestroySyncJobResponse.new
456
+ model.deserialize(response['Response'])
457
+ model
458
+ else
459
+ code = response['Response']['Error']['Code']
460
+ message = response['Response']['Error']['Message']
461
+ reqid = response['Response']['RequestId']
462
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
463
+ end
464
+ rescue TencentCloud::Common::TencentCloudSDKException => e
465
+ raise e
466
+ rescue StandardError => e
467
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
468
+ end
469
+
470
+ # 隔离退还数据迁移服务。调用此接口后可通过查询迁移服务列表接口`DescribeMigrationJobs`来查询当前任务状态。对于计费任务,在任务隔离后可进行解除隔离(RecoverMigrationJob)操作或直接进行下线销毁(DestroyMigrateJob)操作。对于不计费任务,调用此接口会直接删除任务,无法进行恢复操作。
471
+
472
+ # @param request: Request instance for IsolateMigrateJob.
473
+ # @type request: :class:`Tencentcloud::dts::V20211206::IsolateMigrateJobRequest`
474
+ # @rtype: :class:`Tencentcloud::dts::V20211206::IsolateMigrateJobResponse`
475
+ def IsolateMigrateJob(request)
476
+ body = send_request('IsolateMigrateJob', request.serialize)
477
+ response = JSON.parse(body)
478
+ if response['Response'].key?('Error') == false
479
+ model = IsolateMigrateJobResponse.new
480
+ model.deserialize(response['Response'])
481
+ model
482
+ else
483
+ code = response['Response']['Error']['Code']
484
+ message = response['Response']['Error']['Message']
485
+ reqid = response['Response']['RequestId']
486
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
487
+ end
488
+ rescue TencentCloud::Common::TencentCloudSDKException => e
489
+ raise e
490
+ rescue StandardError => e
491
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
492
+ end
493
+
494
+ # 销毁(隔离)同步任务,销毁后可通过查询同步任务信息接口DescribeSyncJobs,获取销毁后状态。在任务销毁后可进行解除隔离(RecoverSyncJob)操作或直接进行立即下线操作。对于不计费任务,调用此接口后会直接删除任务,无法进行恢复操作。
495
+
496
+ # @param request: Request instance for IsolateSyncJob.
497
+ # @type request: :class:`Tencentcloud::dts::V20211206::IsolateSyncJobRequest`
498
+ # @rtype: :class:`Tencentcloud::dts::V20211206::IsolateSyncJobResponse`
499
+ def IsolateSyncJob(request)
500
+ body = send_request('IsolateSyncJob', request.serialize)
501
+ response = JSON.parse(body)
502
+ if response['Response'].key?('Error') == false
503
+ model = IsolateSyncJobResponse.new
504
+ model.deserialize(response['Response'])
505
+ model
506
+ else
507
+ code = response['Response']['Error']['Code']
508
+ message = response['Response']['Error']['Message']
509
+ reqid = response['Response']['RequestId']
510
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
511
+ end
512
+ rescue TencentCloud::Common::TencentCloudSDKException => e
513
+ raise e
514
+ rescue StandardError => e
515
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
516
+ end
517
+
518
+ # 修改一致性校验任务,在任务创建后启动之前,可修改一致性校验参数
519
+
520
+ # @param request: Request instance for ModifyCompareTask.
521
+ # @type request: :class:`Tencentcloud::dts::V20211206::ModifyCompareTaskRequest`
522
+ # @rtype: :class:`Tencentcloud::dts::V20211206::ModifyCompareTaskResponse`
523
+ def ModifyCompareTask(request)
524
+ body = send_request('ModifyCompareTask', request.serialize)
525
+ response = JSON.parse(body)
526
+ if response['Response'].key?('Error') == false
527
+ model = ModifyCompareTaskResponse.new
528
+ model.deserialize(response['Response'])
529
+ model
530
+ else
531
+ code = response['Response']['Error']['Code']
532
+ message = response['Response']['Error']['Message']
533
+ reqid = response['Response']['RequestId']
534
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
535
+ end
536
+ rescue TencentCloud::Common::TencentCloudSDKException => e
537
+ raise e
538
+ rescue StandardError => e
539
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
540
+ end
541
+
542
+ # 修改一致性校验任务名称
543
+
544
+ # @param request: Request instance for ModifyCompareTaskName.
545
+ # @type request: :class:`Tencentcloud::dts::V20211206::ModifyCompareTaskNameRequest`
546
+ # @rtype: :class:`Tencentcloud::dts::V20211206::ModifyCompareTaskNameResponse`
547
+ def ModifyCompareTaskName(request)
548
+ body = send_request('ModifyCompareTaskName', request.serialize)
549
+ response = JSON.parse(body)
550
+ if response['Response'].key?('Error') == false
551
+ model = ModifyCompareTaskNameResponse.new
552
+ model.deserialize(response['Response'])
553
+ model
554
+ else
555
+ code = response['Response']['Error']['Code']
556
+ message = response['Response']['Error']['Message']
557
+ reqid = response['Response']['RequestId']
558
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
559
+ end
560
+ rescue TencentCloud::Common::TencentCloudSDKException => e
561
+ raise e
562
+ rescue StandardError => e
563
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
564
+ end
565
+
566
+ # 调整实例规格,此接口只支持按量计费任务的调整。调用此接口后可通过查询迁移服务列表接口`DescribeMigrationJobs`来查询当前任务状态。
567
+
568
+ # @param request: Request instance for ModifyMigrateJobSpec.
569
+ # @type request: :class:`Tencentcloud::dts::V20211206::ModifyMigrateJobSpecRequest`
570
+ # @rtype: :class:`Tencentcloud::dts::V20211206::ModifyMigrateJobSpecResponse`
571
+ def ModifyMigrateJobSpec(request)
572
+ body = send_request('ModifyMigrateJobSpec', request.serialize)
573
+ response = JSON.parse(body)
574
+ if response['Response'].key?('Error') == false
575
+ model = ModifyMigrateJobSpecResponse.new
576
+ model.deserialize(response['Response'])
577
+ model
578
+ else
579
+ code = response['Response']['Error']['Code']
580
+ message = response['Response']['Error']['Message']
581
+ reqid = response['Response']['RequestId']
582
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
583
+ end
584
+ rescue TencentCloud::Common::TencentCloudSDKException => e
585
+ raise e
586
+ rescue StandardError => e
587
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
588
+ end
589
+
590
+ # 修改迁移任务名
591
+
592
+ # @param request: Request instance for ModifyMigrateName.
593
+ # @type request: :class:`Tencentcloud::dts::V20211206::ModifyMigrateNameRequest`
594
+ # @rtype: :class:`Tencentcloud::dts::V20211206::ModifyMigrateNameResponse`
595
+ def ModifyMigrateName(request)
596
+ body = send_request('ModifyMigrateName', request.serialize)
597
+ response = JSON.parse(body)
598
+ if response['Response'].key?('Error') == false
599
+ model = ModifyMigrateNameResponse.new
600
+ model.deserialize(response['Response'])
601
+ model
602
+ else
603
+ code = response['Response']['Error']['Code']
604
+ message = response['Response']['Error']['Message']
605
+ reqid = response['Response']['RequestId']
606
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
607
+ end
608
+ rescue TencentCloud::Common::TencentCloudSDKException => e
609
+ raise e
610
+ rescue StandardError => e
611
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
612
+ end
613
+
614
+ # 配置迁移服务,配置成功后可通过`CreateMigrationCheckJob` 创建迁移校验任务接口发起校验任务,只有校验通过才能启动迁移任务。
615
+
616
+ # @param request: Request instance for ModifyMigrationJob.
617
+ # @type request: :class:`Tencentcloud::dts::V20211206::ModifyMigrationJobRequest`
618
+ # @rtype: :class:`Tencentcloud::dts::V20211206::ModifyMigrationJobResponse`
619
+ def ModifyMigrationJob(request)
620
+ body = send_request('ModifyMigrationJob', request.serialize)
621
+ response = JSON.parse(body)
622
+ if response['Response'].key?('Error') == false
623
+ model = ModifyMigrationJobResponse.new
624
+ model.deserialize(response['Response'])
625
+ model
626
+ else
627
+ code = response['Response']['Error']['Code']
628
+ message = response['Response']['Error']['Message']
629
+ reqid = response['Response']['RequestId']
630
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
631
+ end
632
+ rescue TencentCloud::Common::TencentCloudSDKException => e
633
+ raise e
634
+ rescue StandardError => e
635
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
636
+ end
637
+
638
+ # 解除隔离数据迁移任务,用户手动发起隔离后的手动解隔离,只有任务状态为已隔离(手动操作)状态下才能触发此操作。调用此接口后可通过查询迁移服务列表接口`DescribeMigrationJobs`来查询当前任务状态。
639
+
640
+ # @param request: Request instance for RecoverMigrateJob.
641
+ # @type request: :class:`Tencentcloud::dts::V20211206::RecoverMigrateJobRequest`
642
+ # @rtype: :class:`Tencentcloud::dts::V20211206::RecoverMigrateJobResponse`
643
+ def RecoverMigrateJob(request)
644
+ body = send_request('RecoverMigrateJob', request.serialize)
645
+ response = JSON.parse(body)
646
+ if response['Response'].key?('Error') == false
647
+ model = RecoverMigrateJobResponse.new
648
+ model.deserialize(response['Response'])
649
+ model
650
+ else
651
+ code = response['Response']['Error']['Code']
652
+ message = response['Response']['Error']['Message']
653
+ reqid = response['Response']['RequestId']
654
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
655
+ end
656
+ rescue TencentCloud::Common::TencentCloudSDKException => e
657
+ raise e
658
+ rescue StandardError => e
659
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
660
+ end
661
+
662
+ # 解除隔离同步任务,任务在已隔离状态下可调用该接口解除隔离状态任务,同时可通过查询同步任务信息接口DescribeSyncJobs,获取操作后状态。
663
+
664
+ # @param request: Request instance for RecoverSyncJob.
665
+ # @type request: :class:`Tencentcloud::dts::V20211206::RecoverSyncJobRequest`
666
+ # @rtype: :class:`Tencentcloud::dts::V20211206::RecoverSyncJobResponse`
667
+ def RecoverSyncJob(request)
668
+ body = send_request('RecoverSyncJob', request.serialize)
669
+ response = JSON.parse(body)
670
+ if response['Response'].key?('Error') == false
671
+ model = RecoverSyncJobResponse.new
672
+ model.deserialize(response['Response'])
673
+ model
674
+ else
675
+ code = response['Response']['Error']['Code']
676
+ message = response['Response']['Error']['Message']
677
+ reqid = response['Response']['RequestId']
678
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
679
+ end
680
+ rescue TencentCloud::Common::TencentCloudSDKException => e
681
+ raise e
682
+ rescue StandardError => e
683
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
684
+ end
685
+
686
+ # 调整同步任务规格,此接口只支持按量计费任务的调整,调用此接口后不会立即生效,后台调整时间大概为3~5分钟。调用此接口后可通过查询同步任务信息接口DescribeSyncJobs,获取变配后的状态。
687
+
688
+ # @param request: Request instance for ResizeSyncJob.
689
+ # @type request: :class:`Tencentcloud::dts::V20211206::ResizeSyncJobRequest`
690
+ # @rtype: :class:`Tencentcloud::dts::V20211206::ResizeSyncJobResponse`
691
+ def ResizeSyncJob(request)
692
+ body = send_request('ResizeSyncJob', request.serialize)
693
+ response = JSON.parse(body)
694
+ if response['Response'].key?('Error') == false
695
+ model = ResizeSyncJobResponse.new
696
+ model.deserialize(response['Response'])
697
+ model
698
+ else
699
+ code = response['Response']['Error']['Code']
700
+ message = response['Response']['Error']['Message']
701
+ reqid = response['Response']['RequestId']
702
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
703
+ end
704
+ rescue TencentCloud::Common::TencentCloudSDKException => e
705
+ raise e
706
+ rescue StandardError => e
707
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
708
+ end
709
+
710
+ # 重试数据迁移任务,针对redis在迁移在失败情况下的重试操作,注意:此操作跳过校验阶段,直接重新发起任务,相当于从StartMigrationJob开始执行。调用此接口后可通过查询迁移服务列表接口`DescribeMigrationJobs`来查询当前任务状态。
711
+
712
+ # @param request: Request instance for ResumeMigrateJob.
713
+ # @type request: :class:`Tencentcloud::dts::V20211206::ResumeMigrateJobRequest`
714
+ # @rtype: :class:`Tencentcloud::dts::V20211206::ResumeMigrateJobResponse`
715
+ def ResumeMigrateJob(request)
716
+ body = send_request('ResumeMigrateJob', request.serialize)
717
+ response = JSON.parse(body)
718
+ if response['Response'].key?('Error') == false
719
+ model = ResumeMigrateJobResponse.new
720
+ model.deserialize(response['Response'])
721
+ model
722
+ else
723
+ code = response['Response']['Error']['Code']
724
+ message = response['Response']['Error']['Message']
725
+ reqid = response['Response']['RequestId']
726
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
727
+ end
728
+ rescue TencentCloud::Common::TencentCloudSDKException => e
729
+ raise e
730
+ rescue StandardError => e
731
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
732
+ end
733
+
734
+ # 重试同步任务,部分可恢复报错情况下,可通过该接口重试同步任务,可通过查询同步任务信息接口DescribeSyncJobs,获取操作后状态。
735
+
736
+ # @param request: Request instance for ResumeSyncJob.
737
+ # @type request: :class:`Tencentcloud::dts::V20211206::ResumeSyncJobRequest`
738
+ # @rtype: :class:`Tencentcloud::dts::V20211206::ResumeSyncJobResponse`
739
+ def ResumeSyncJob(request)
740
+ body = send_request('ResumeSyncJob', request.serialize)
741
+ response = JSON.parse(body)
742
+ if response['Response'].key?('Error') == false
743
+ model = ResumeSyncJobResponse.new
744
+ model.deserialize(response['Response'])
745
+ model
746
+ else
747
+ code = response['Response']['Error']['Code']
748
+ message = response['Response']['Error']['Message']
749
+ reqid = response['Response']['RequestId']
750
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
751
+ end
752
+ rescue TencentCloud::Common::TencentCloudSDKException => e
753
+ raise e
754
+ rescue StandardError => e
755
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
756
+ end
757
+
758
+ # 启动一致性校验任务,启动之前需要先通过接口`CreateCompareTask` 创建一致性校验任务,启动后可通过接口`DescribeCompareTasks` 查询一致性校验任务列表来获得启动后的状态
759
+
760
+ # @param request: Request instance for StartCompare.
761
+ # @type request: :class:`Tencentcloud::dts::V20211206::StartCompareRequest`
762
+ # @rtype: :class:`Tencentcloud::dts::V20211206::StartCompareResponse`
763
+ def StartCompare(request)
764
+ body = send_request('StartCompare', request.serialize)
765
+ response = JSON.parse(body)
766
+ if response['Response'].key?('Error') == false
767
+ model = StartCompareResponse.new
768
+ model.deserialize(response['Response'])
769
+ model
770
+ else
771
+ code = response['Response']['Error']['Code']
772
+ message = response['Response']['Error']['Message']
773
+ reqid = response['Response']['RequestId']
774
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
775
+ end
776
+ rescue TencentCloud::Common::TencentCloudSDKException => e
777
+ raise e
778
+ rescue StandardError => e
779
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
780
+ end
781
+
782
+ # 本接口(StartMigrationJob)用于启动迁移任务。调用此接口后可通过查询迁移服务列表接口`DescribeMigrationJobs`来查询当前任务状态。
783
+
784
+ # @param request: Request instance for StartMigrateJob.
785
+ # @type request: :class:`Tencentcloud::dts::V20211206::StartMigrateJobRequest`
786
+ # @rtype: :class:`Tencentcloud::dts::V20211206::StartMigrateJobResponse`
787
+ def StartMigrateJob(request)
788
+ body = send_request('StartMigrateJob', request.serialize)
789
+ response = JSON.parse(body)
790
+ if response['Response'].key?('Error') == false
791
+ model = StartMigrateJobResponse.new
792
+ model.deserialize(response['Response'])
793
+ model
794
+ else
795
+ code = response['Response']['Error']['Code']
796
+ message = response['Response']['Error']['Message']
797
+ reqid = response['Response']['RequestId']
798
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
799
+ end
800
+ rescue TencentCloud::Common::TencentCloudSDKException => e
801
+ raise e
802
+ rescue StandardError => e
803
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
804
+ end
805
+
806
+ # 启动同步任务
807
+
808
+ # @param request: Request instance for StartSyncJob.
809
+ # @type request: :class:`Tencentcloud::dts::V20211206::StartSyncJobRequest`
810
+ # @rtype: :class:`Tencentcloud::dts::V20211206::StartSyncJobResponse`
811
+ def StartSyncJob(request)
812
+ body = send_request('StartSyncJob', request.serialize)
813
+ response = JSON.parse(body)
814
+ if response['Response'].key?('Error') == false
815
+ model = StartSyncJobResponse.new
816
+ model.deserialize(response['Response'])
817
+ model
818
+ else
819
+ code = response['Response']['Error']['Code']
820
+ message = response['Response']['Error']['Message']
821
+ reqid = response['Response']['RequestId']
822
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
823
+ end
824
+ rescue TencentCloud::Common::TencentCloudSDKException => e
825
+ raise e
826
+ rescue StandardError => e
827
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
828
+ end
829
+
830
+ # 终止一致性校验任务
831
+
832
+ # @param request: Request instance for StopCompare.
833
+ # @type request: :class:`Tencentcloud::dts::V20211206::StopCompareRequest`
834
+ # @rtype: :class:`Tencentcloud::dts::V20211206::StopCompareResponse`
835
+ def StopCompare(request)
836
+ body = send_request('StopCompare', request.serialize)
837
+ response = JSON.parse(body)
838
+ if response['Response'].key?('Error') == false
839
+ model = StopCompareResponse.new
840
+ model.deserialize(response['Response'])
841
+ model
842
+ else
843
+ code = response['Response']['Error']['Code']
844
+ message = response['Response']['Error']['Message']
845
+ reqid = response['Response']['RequestId']
846
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
847
+ end
848
+ rescue TencentCloud::Common::TencentCloudSDKException => e
849
+ raise e
850
+ rescue StandardError => e
851
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
852
+ end
853
+
854
+ # 本接口(StopMigrateJob)用于停止数据迁移任务。
855
+ # 调用此接口后可通过查询迁移服务列表接口`DescribeMigrationJobs`来查询当前任务状态。
856
+
857
+ # @param request: Request instance for StopMigrateJob.
858
+ # @type request: :class:`Tencentcloud::dts::V20211206::StopMigrateJobRequest`
859
+ # @rtype: :class:`Tencentcloud::dts::V20211206::StopMigrateJobResponse`
860
+ def StopMigrateJob(request)
861
+ body = send_request('StopMigrateJob', request.serialize)
862
+ response = JSON.parse(body)
863
+ if response['Response'].key?('Error') == false
864
+ model = StopMigrateJobResponse.new
865
+ model.deserialize(response['Response'])
866
+ model
867
+ else
868
+ code = response['Response']['Error']['Code']
869
+ message = response['Response']['Error']['Message']
870
+ reqid = response['Response']['RequestId']
871
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
872
+ end
873
+ rescue TencentCloud::Common::TencentCloudSDKException => e
874
+ raise e
875
+ rescue StandardError => e
876
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
877
+ end
878
+
879
+ # 终止同步任务
880
+
881
+ # @param request: Request instance for StopSyncJob.
882
+ # @type request: :class:`Tencentcloud::dts::V20211206::StopSyncJobRequest`
883
+ # @rtype: :class:`Tencentcloud::dts::V20211206::StopSyncJobResponse`
884
+ def StopSyncJob(request)
885
+ body = send_request('StopSyncJob', request.serialize)
886
+ response = JSON.parse(body)
887
+ if response['Response'].key?('Error') == false
888
+ model = StopSyncJobResponse.new
889
+ model.deserialize(response['Response'])
890
+ model
891
+ else
892
+ code = response['Response']['Error']['Code']
893
+ message = response['Response']['Error']['Message']
894
+ reqid = response['Response']['RequestId']
895
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
896
+ end
897
+ rescue TencentCloud::Common::TencentCloudSDKException => e
898
+ raise e
899
+ rescue StandardError => e
900
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
901
+ end
902
+
903
+
904
+ end
905
+ end
906
+ end
907
+ end