POST /v1/task
Host: dts.baidubce.com
Content-Type: application/json
Authorization: bce-auth-v1/5a6f0606bf5e48f29dd132aa76aa5182/2017-06-12T13:13:05Z/1800/content-type;host;x-bce-date/8baeafe6bfc35b0cf6205e87e4ce6c0dbb442375951ace4d16e6c7a4dab95943{"crossRegionTag":0,"directionType":"single","standard":"large","productType":"postpay","sourceInstanceType":"public","targetInstanceType":"bcerds","type":"migration","orderInfo":{"src":{"instanceType":"bcegateway","dbType":"redisCluster","sliceNum":2,"region":"fwh","vpcShortId":"vpc-784a9yx6dj21","subnetShortId":"sbn-fgjg9kup7fub","zone":"cn-fwh-a"},"dst":{"instanceType":"bcescs","dbType":"redisCluster","region":"bd"}}}}
响应示例
HTTP/1.1200 OK
{"dtsTasks":[{"dtsId":"dtsgsi2nut0kq7s8fvtq"}]}
配置任务
接口说明
配置任务。
请求结构
POST /v1/task/{dtsId}/config
Host: dts.baidubce.com
Authorization: authorization string
{"type":"migration","taskName":"专线迁移Redis Cluster-SCS企业集群版","dataType":["increment","base"],"srcConnection":{"instanceType":"bcegateway","dbType":"redisCluster","region":"bd","clusterTopo":"172.0.0.1:6379,172.0.0.2:6379;172.0.1.1:6379,172.0.1.2:6379;172.0.2.1:6379,172.0.2.2:6379","dbPass":"","vpcShortId":"vpc-t83wrgg3ur1i","subnetShortId":"sbn-6ax8fqz4tacz","zone":"cn-fwh-b","positionStrategy":"fail"},"dstConnection":{"instanceType":"bcescs","dbType":"redisCluster","region":"bd","instanceId":"scs-bj-wrkqizojmekg","dbServer":"","dbPass":""},"schemaMapping":[],"granularity":"instance"}
请求体参数
参数名称
参数类型
是否必选
描述
示例值
参数位置
dtsId
String
是
任务ID
dtsmxxxyyy
URL参数
type
String
是
任务类型(数据传输任务:migration),目前仅支持数据传输任务
migration
Request Body 参数
dataType
String[]
是
传输数据类型数组(schema:结构迁移;base:全量迁移;increment:增量迁移)
["base"]
Request Body 参数
srcConnection
Connection
是
源端
srcConnection
Request Body 参数
dstConnection
Connection
是
目标端
dstConnection
Request Body 参数
granularity
String
是
传输任务的粒度(instance:实例级;dbtb:库表级)
instance
Request Body 参数
schemaMapping
SchemaMapping
是
schemaMapping
schemaMapping
Request Body 参数
accountMapping
AccountMapping[]
否
账号迁移
accountMapping
Request Body 参数
incrIgnoreType
String
否
特殊DDL过滤
drop,truncate
Request Body 参数
initPosition
InitPosition
否
自定义同步点
initPosition
Request Body 参数
响应头参数
除公共头域,无其它特殊头域。
响应体参数
响应体字段数据结构说明
参数名称
参数类型
是否必选
描述
示例值
dtsId
String
是
任务ID
dtsxxxyyyzzz
请求示例
POST /v1/task/{dtsId}/config
Host: dts.baidubce.com
Content-Type: application/json
Authorization: bce-auth-v1/5a6f0606bf5e48f29dd132aa76aa5182/2017-06-12T13:13:05Z/1800/content-type;host;x-bce-date/8baeafe6bfc35b0cf6205e87e4ce6c0dbb442375951ace4d16e6c7a4dab95943{"type":"migration","taskName":"专线迁移Redis Cluster-SCS企业集群版","dataType":["increment","base"],"srcConnection":{"instanceType":"bcegateway","dbType":"redisCluster","region":"bd","clusterTopo":"172.0.0.1:6379,172.0.0.2:6379;172.0.1.1:6379,172.0.1.2:6379;172.0.2.1:6379,172.0.2.2:6379","dbPass":"","vpcShortId":"vpc-t83wrgg3ur1i","subnetShortId":"sbn-6ax8fqz4tacz","zone":"cn-fwh-b","positionStrategy":"fail"},"dstConnection":{"instanceType":"bcescs","dbType":"redisCluster","region":"bd","instanceId":"scs-bj-wrkqizojmekg","dbServer":"","dbPass":""},"schemaMapping":[],"granularity":"instance"}
响应示例
HTTP/1.1200 OK
{"dtsId":"dtsxxxyyyzzz"}
前置检查
接口说明
当配置完任务,开始前置检查。
请求结构
POST /v1/task/{dtsId}/precheck
Host: dts.baidubce.com
Authorization: authorization string
请求体参数
参数名称
参数类型
是否必须
描述
示例值
参数位置
dtsId
String
是
任务ID
dtsxxxxyyy
URL参数
响应头参数
除公共头域,无其它特殊头域。
响应体参数
响应体字段数据结构说明
参数名称
参数类型
是否必须
描述
示例值
success
Boolean
是
是否成功
true
result
Object
否
暂未使用
null
请求示例
POST /v1/task/{dtsId}/precheck
Host: dts.baidubce.com
Content-Type: application/json
Authorization: bce-auth-v1/5a6f0606bf5e48f29dd132aa76aa5182/2017-06-12T13:13:05Z/1800/content-type;host;x-bce-date/8baeafe6bfc35b0cf6205e87e4ce6c0dbb442375951ace4d16e6c7a4dab95943
响应示例
HTTP/1.1200 OK
{"result":{},"success":true}
查询前置检查结果
接口说明
任务启动前的前置检查,包括连通性,对象存在性,binlog格式等。
请求结构
GET /v1/task/{dtsId}/precheck
Host: dts.baidubce.com
Authorization: authorization string
请求体参数
参数名称
参数类型
是否必须
描述
示例值
参数位置
dtsId
String
是
任务ID
dtsxxxxyyy
URL参数
响应头参数
除公共头域,无其它特殊头域。
响应体参数
响应体字段数据结构说明
参数名称
参数类型
是否必须
描述
示例值
success
Boolean
是
是否成功
true
result
PreCheckResultItem[]
是
前置检查结果集合
PreCheckResultItem字段数据结构说明
参数名称
参数类型
是否必须
描述
示例值
name
String
是
名称
srcOracleConnect
subscription
String
是
描述
检查数据传输服务器是否能连通源数据库
message
String
是
提示语
status
String
是
状态
pass
请求示例
GET /v1/task/{dtsId}/precheck
Host: dts.baidubce.com
Content-Type: application/json
Authorization: bce-auth-v1/5a6f0606bf5e48f29dd132aa76aa5182/2017-06-12T13:13:05Z/1800/content-type;host;x-bce-date/8baeafe6bfc35b0cf6205e87e4ce6c0dbb442375951ace4d16e6c7a4dab95943
响应示例
HTTP/1.1200 OK
{"result":[{"name":"srcOracleConnect","subscription":"检查数据传输服务器是否能连通源数据库","message":"message","status":"pass"},{"name":"srcOracleConnect","subscription":"检查数据传输服务器是否能连通源数据库","message":"message","status":"pass"}],"success":true}
强制跳过前置检查
接口说明
强制跳过前置检查。
请求结构
PUT /v1/task/{dtsId}?skipPrecheck
Host: dts.baidubce.com
Authorization: authorization string
请求体参数
参数名称
参数类型
是否必须
描述
示例值
参数位置
dtsId
String
是
任务ID
dtsxxxxyyy
URL参数
响应头参数
除公共头域,无其它特殊头域。
响应体参数
响应体字段数据结构说明
参数名称
参数类型
是否必须
描述
示例值
success
Boolean
是
是否成功
true
result
Object
否
暂未使用
null
请求示例
PUT /v1/task/{dtsId}?skipPrecheck
Content-Type: application/json
Authorization: bce-auth-v1/5a6f0606bf5e48f29dd132aa76aa5182/2017-06-12T13:13:05Z/1800/content-type;host;x-bce-date/8baeafe6bfc35b0cf6205e87e4ce6c0dbb442375951ace4d16e6c7a4dab95943
响应示例
HTTP/1.1200 OK
{"result":{},"success":true}
启动任务
接口说明
当配置完任务,前置检查通过后,可以启动任务。
请求结构
POST /v1/task/{dtsId}/start
Host: dts.baidubce.com
Authorization: authorization string
请求体参数
参数名称
参数类型
是否必须
描述
示例值
参数位置
dtsId
String
是
任务ID
dtsxxxxyyy
URL参数
响应头参数
除公共头域,无其它特殊头域。
响应体参数
响应体字段数据结构说明
参数名称
参数类型
是否必须
描述
示例值
success
Boolean
是
是否成功
true
result
Object
否
暂未使用
null
请求示例
POST /v1/task/{dtsId}/start
Host: dts.baidubce.com
Content-Type: application/json
Authorization: bce-auth-v1/5a6f0606bf5e48f29dd132aa76aa5182/2017-06-12T13:13:05Z/1800/content-type;host;x-bce-date/8baeafe6bfc35b0cf6205e87e4ce6c0dbb442375951ace4d16e6c7a4dab95943
响应示例
HTTP/1.1200 OK
{"result":{},"success":true}
暂停任务
接口说明
运行中的任务可以暂停。
请求结构
POST /v1/task/{dtsId}/pause
Host: dts.baidubce.com
Authorization: authorization string
请求体参数
参数名称
参数类型
是否必须
描述
示例值
参数位置
dtsId
String
是
任务ID
dtsxxxxyyy
URL参数
响应头参数
除公共头域,无其它特殊头域。
响应体参数
响应体字段数据结构说明
参数名称
参数类型
是否必须
描述
示例值
success
Boolean
是
是否成功
true
result
Object
否
暂未使用
null
请求示例
POST /v1/task/{dtsId}/pause
Host: dts.baidubce.com
Content-Type: application/json
Authorization: bce-auth-v1/5a6f0606bf5e48f29dd132aa76aa5182/2017-06-12T13:13:05Z/1800/content-type;host;x-bce-date/8baeafe6bfc35b0cf6205e87e4ce6c0dbb442375951ace4d16e6c7a4dab95943
响应示例
HTTP/1.1200 OK
{"result":{},"success":true}
结束任务
接口说明
结束任务。
请求结构
POST /v1/task/{dtsId}/shutdown
Host: dts.baidubce.com
Authorization: authorization string
请求体参数
参数名称
参数类型
是否必须
描述
示例值
参数位置
dtsId
String
是
任务ID
dtsxxxxyyy
URL参数
响应头参数
除公共头域,无其它特殊头域。
响应体参数
响应体字段数据结构说明
参数名称
参数类型
是否必须
描述
示例值
success
Boolean
是
是否成功
true
result
Object
否
暂未使用
null
请求示例
POST /v1/task/{dtsId}/shutdown
Host: dts.baidubce.com
Content-Type: application/json
Authorization: bce-auth-v1/5a6f0606bf5e48f29dd132aa76aa5182/2017-06-12T13:13:05Z/1800/content-type;host;x-bce-date/8baeafe6bfc35b0cf6205e87e4ce6c0dbb442375951ace4d16e6c7a4dab95943
GET /v1/task/{dtsId}
Host: dts.baidubce.com
Content-Type: application/json
Authorization: bce-auth-v1/5a6f0606bf5e48f29dd132aa76aa5182/2017-06- 12T13:13:05Z/1800/content-type;host;x-bce- date/8baeafe6bfc35b0cf6205e87e4ce6c0dbb442375951ace4d16e6c7a4dab95943
响应示例
HTTP/1.1200 OK
{"taskName":"dtsg6iidgzupuva0kg6b","status":"running","dataType":["base","increment"],"region":"bd","createTime":"2022-11-30T05:32:18Z","srcConnection":{"instanceType":"bcegateway","region":"bd","dbType":"redisCluster","sliceNum":"2","clusterTopo":"172.0.0.1:6379,172.0.0.2:6379;172.0.1.1:6379,172.0.1.2:6379;172.0.2.1:6379,172.0.2.2:6379","dbPort":"","dbHost":"","dbUser":"","dbPass":"","zone":"cn-bd-c","subnetShortId":"sbn-ka9xp8yuj81n","vpcId":"1cd2dd00-b2c8-4053-9550-594a2991cc6e","vpcName":"默认私有网络","vpcCidr":"172.16.0.0/16","vpcShortId":"vpc-2a0giawvdben","positionStrategy":"fail"},"dstConnection":{"instanceType":"bcescs","dbType":"redis","region":"bd","instanceId":"scs-bdbl-aewdjquqydzx","dbPass":""},"schemaMapping":[],"payInfo":{"productType":"postpay","sourceInstanceType":"OffBce","targetInstanceType":"OffBce","crossRegionTag":1,"createTime":1669786338000,"standard":"Large","endTime":null},"lockStatus":null,"incrNetType":"large","netType":null,"expireTime":null,"incrIgnoreType":null,"remark":"","dtsTasks":[{"dtsId":"dtsmjoyxoqn1w8qkc447","taskName":"son of dtsg6iidgzupuva0kg6b","status":"running","srcConnection":{"instanceType":"bcegateway","region":"bd","dbType":"redis","dbHost":"172.16.32.37","dbPort":6379,"dbPass":"","dbUser":"","zone":"cn-bd-c","subnetShortId":"sbn-ka9xp8yuj81n","vpcId":"1cd2dd00-b2c8-4053-9550-594a2991cc6e","vpcName":"默认私有网络","vpcCidr":"172.16.0.0/16","vpcShortId":"vpc-2a0giawvdben","positionStrategy":"fail"},"dstConnection":{"instanceType":"bcescs","dbType":"redis","region":"bd","instanceId":"scs-bdbl-aewdjquqydzx","dbPass":""},"schemaMapping":[],"granularity":"instance","dynamicInfo":{"increment":{"delay":"1",//延迟信息, 单位为秒。延迟为0时表示增量同步追平"position":"12345"//增量同步位点。增量同步点与源端一致时表示增量同步追平},"base":{"current":"60000","count":"150000","speed":"1500","expectFinishTime":"87000"}},"message":"","createTime":"2022-11-30T05:41:39Z","dataType":["base","increment"],"subStatus":[{"b":"running","i":"queue"}]},{"dtsId":"dtsmqyi92k7s73905q30","taskName":"son of dtsg6iidgzupuva0kg6b","status":"running","srcConnection":{"instanceType":"bcegateway","region":"bd","dbType":"redis","dbHost":"172.16.32.36","dbPort":6379,"dbUser":"","dbPass":"","vpcId":"1cd2dd00-b2c8-4053-9550-594a2991cc6e","subnetShortId":"sbn-ka9xp8yuj81n","zone":"cn-bd-c","vpcName":"默认私有网络","vpcCidr":"172.16.0.0/16","vpcShortId":"vpc-2a0giawvdben","positionStrategy":"fail"},"dstConnection":{"instanceType":"bcescs","dbType":"redis","region":"bd","instanceId":"scs-bdbl-aewdjquqydzx","dbPass":""},"schemaMapping":[],"granularity":"instance","dynamicInfo":{"increment":{"delay":"1",//延迟信息, 单位为秒。延迟为0时表示增量同步追平"position":"12345"//增量同步位点。增量同步点与源端一致时表示增量同步追平},"base":{"current":"60000","count":"150000","speed":"1500","expectFinishTime":"87000"}},"message":"","createTime":"2022-11-30T05:41:39Z","dataType":["base","increment"],"subStatus":[{"b":"running","i":"queue"}]}]}