POST /v1/task
Host: dts.baidubce.com
Authorization: authorization string
{"crossRegionTag":0,"directionType":"single","standard":"large","productType":"postpay","sourceInstanceType":"public","targetInstanceType":"bcerds","type":"migration","rollback":1,"orderInfo":{"src":{"instanceType":"bcegateway","dbType":"redisCluster","sliceNum":2,"region":"bd","vpcShortId":"vpc-784a9yx6dj21","subnetShortId":"sbn-fgjg9kup7fub","zone":"cn-fwh-a"},"dst":{"instanceType":"bcescs","dbType":"redisCluster","region":"bd"}}}
请求体参数
参数名称
参数类型
是否必须
描述
示例值
参数位置
type
String
是
任务类型(数据传输任务:migration),目前仅支持数据传输任务
migration
Request Body 参数
productType
String
是
付费类型(后付费:postpay),目前仅支持后付费
postpay
Request Body 参数
standard
String
是
实例规格(small;medium;large;xlarge)
large
Request Body 参数
sourceInstanceType
String
是
源端类型(百度智能云数据库:bcerds;自建数据存储:public)
bcerds
Request Body 参数
targetInstanceType
String
是
目标端类型(百度智能云数据库:bcerds;自建数据存储:public)
bcerds
Request Body 参数
crossRegionTag
Integer
是
跨地域标识(当源端、目标端类型均为百度智能云数据库且跨地域时:1;其他情况:0)
0
Request Body 参数
directionType
String
是
同步方向(单向同步:single;双向同步:bidirect),目前仅支持单向同步
single
Request Body 参数
orderInfo
OrderInfo
是
购买类型
orderInfo
Request Body 参数
rollback
String
否
一键反向,1为创建一键反向任务,其余时候不传该参数
1
Request Body 参数
OrderInfo字段数据结构说明
参数名称
参数类型
是否必须
描述
示例值
src
Src
是
源端
src
dst
Src
是
目标端
src
Src字段数据结构说明
参数名称
参数类型
是否必须
描述
示例值
instanceType
String
是
源端接入类型(云数据库RDS:bcerds;云数据库 DocDB for MongoDB:bcedocdb;云数据库 SCS for Redis:bcescs;云数据库专属集群DDC:bceddc;云原生数据库 GaiaDB-S:bcegaiadb;公网:public;专线接入:bceet;云服务器BCC:bcebcc;物理服务器BBC:bcebbc;专属服务器DCC:bcedcc;专线迁移:bcegateway(src或dst只支持一端类型为bcegateway))
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","rollback":1,"orderInfo":{"src":{"instanceType":"bcegateway","dbType":"redisCluster","sliceNum":2,"region":"bd","vpcShortId":"vpc-784a9yx6dj21","subnetShortId":"sbn-fgjg9kup7fub","zone":"cn-fwh-a"},"dst":{"instanceType":"bcescs","dbType":"redisCluster","region":"bd"}}}
响应示例
HTTP/1.1200 OK
{"dtsTasks":[{"dtsId":"dtsrelbh81lx8xicuacs"}]}
配置任务
接口说明
配置任务。
请求结构
POST /v1/task/{taskId}/newRollback/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{"dtsId":"dtsrelbh81lx8xicuacs","taskName":"专线迁移的Redis Cluster迁移到SCS企业集群版(一键反向)","openRollbackConfig":"true","dtsTaskPos":{"type":"migration","dtsGroupName":"正向","dataType":["increment","base"],"srcConnection":{"instanceType":"bcegateway","dbType":"redisCluster","region":"bj","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-2a0giawvdben","subnetShortId":"sbn-fgjg9kup7fub","zone":"cn-fwh-a","positionStrategy":"fail"},"dstConnection":{"instanceType":"bcescs","dbType":"redisCluster","region":"bj","instanceId":"scs-bj-ohfyvdqyxkwg","dbPass":""},"schemaMapping":[],"granularity":"instance"},"dtsTaskNeg":{"type":"migration","dtsGroupName":"反向","dataType":["increment"],"srcConnection":{"instanceType":"bcescs","dbType":"redisCluster","region":"bj","instanceId":"scs-bj-ohfyvdqyxkwg","srcDstFlag":"dst","dbServer":""},"dstConnection":{"instanceType":"bcegateway","dbType":"redisCluster","region":"bj","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":"","zone":"cn-fwh-a","subnetShortId":"sbn-fgjg9kup7fub","vpcShortId":"vpc-2a0giawvdben"},"schemaMapping":[],"granularity":"instance"}}
请求体参数
参数名称
参数类型
是否必须
描述
示例值
参数位置
taskId
String
是
任务ID
"dtsmxxxyyy"
URL参数
taskName
String
是
任务名称
taskName
Request Body 参数
openRollbackConfig
String
是
是否打开反向任务配置
true
Request Body 参数
dtsTaskPos
String
是
正向数据流
dtsTaskPos
Request Body 参数
dtsTaskNeg
String
是
反向数据流
dtsTaskNeg
Request Body 参数
响应头参数
除公共头域,无其它特殊头域。
响应体参数
响应体字段数据结构说明
参数名称
参数类型
是否必选
描述
示例值
dtsId
String
是
任务ID
dtsxxxyyyzzz
请求示例
POST /v1/task/{taskId}/newRollback/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{"dtsId":"dtsrelbh81lx8xicuacs","taskName":"专线迁移的Redis Cluster迁移到SCS企业集群版(一键反向)","openRollbackConfig":"true","dtsTaskPos":{"type":"migration","dtsGroupName":"正向","dataType":["increment","base"],"srcConnection":{"instanceType":"bcegateway","dbType":"redisCluster","region":"bj","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-2a0giawvdben","subnetShortId":"sbn-fgjg9kup7fub","zone":"cn-fwh-a","positionStrategy":"fail"},"dstConnection":{"instanceType":"bcescs","dbType":"redisCluster","region":"bj","instanceId":"scs-bj-ohfyvdqyxkwg","dbPass":""},"schemaMapping":[],"granularity":"instance"},"dtsTaskNeg":{"type":"migration","dtsGroupName":"反向","dataType":["increment"],"srcConnection":{"instanceType":"bcescs","dbType":"redisCluster","region":"bj","instanceId":"scs-bj-ohfyvdqyxkwg","srcDstFlag":"dst","dbServer":""},"dstConnection":{"instanceType":"bcegateway","dbType":"redisCluster","region":"bj","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":"","zone":"cn-fwh-a","subnetShortId":"sbn-fgjg9kup7fub","vpcShortId":"vpc-2a0giawvdben"},"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}/rollback/precheck
Host: dts.baidubce.com
Authorization: authorization string
请求体参数
参数名称
参数类型
是否必须
描述
示例值
参数位置
dtsId
String
是
任务ID
"dtsxxxxyyy"
URL参数
响应头参数
除公共头域,无其它特殊头域。
响应体参数
响应体字段数据结构说明
参数名称
参数类型
是否必须
描述
示例值
success
Boolean
是
是否成功
true
result
Object
是
前置检查结果集合
请求示例
GET /v1/task/{dtsId}/rollback/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
{"success":true,"result":{"posCheckResults":[//正向数据流{"name":"srcConnect","status":"ready","message":"源库无法连接, 请确认配置信息和源库状态是否正常","subscription":"检查数据传输服务是否能连通源数据源"}],"negCheckResults":[//反向数据流{"name":"dstConnect","status":"ready","message":"目标库无法连接, 请确认配置信息和目标库状态是否正常","subscription":"检查数据传输服务器是否能连通目的数据库"}]}}
强制跳过前置检查
接口说明
强制跳过前置检查。
请求结构
PUT /v1/task/{dtsId}?skipPrecheck
Host: dts.baidubce.com
Authorization: authorization string
请求体参数
参数名称
参数类型
是否必须
描述
示例值
参数位置
dtsId
String
是
单任务ID
dtsmxxxyyy
URL参数
响应头参数
除公共头域,无其它特殊头域。
响应体参数
响应体字段数据结构说明
参数名称
参数类型
是否必须
描述
示例值
success
Boolean
是
是否成功
true
result
Object
否
暂未使用
null
请求示例
PUT /v1/task/{dtsId}?skipPrecheck
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}/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
{//一键反向dtsrelbh81lx8xicuacs任务详情"taskName":"dtsrelbh81lx8xicuacs","status": "ready,"region":"bj->bj","createTime":"2022-09-13T07:52:30Z",
"dtsIdPos":"dtsgopxwg5swes7b25ek","dtsIdNeg":"dtsgong72g3o6pl6om18","dtsTaskPos":{//正向数据流(任务组)dtsgopxwg5swes7b25ek详情"dtsGroupName":"dtsrelbh81lx8xicuacs","dtsGroupId":"dtsgopxwg5swes7b25ek","status":"ready","dataType":["base","increment"],"region":"bj","createTime":"2022-09-13T07:52:31Z","srcConnection":{"instanceType":"bcegateway","region":"bj","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","dbPass":"","vpcId":"9556bf45-5867-4495-83c5-bd945b782503","vpcName":"zhaixinrui","vpcCidr":"172.16.0.0/16","vpcShortId":"vpc-it3v6qt3jhvj","positionStrategy":"fail"},"dstConnection":{"instanceType":"bcescs","region":"bj","dbType":"redisCluster","instanceId":"scs-bj-ohfyvdqyxkwg","dbPass":""},"schemaMapping":[],"incrNetType":"large","netType":null,"remark":"","dtsTasks":[//子任务dtsm5imulov4tlqsesqa详情{"dtsId":"dtsm5imulov4tlqsesqa","taskName":"son of dtsgopxwg5swes7b25ek","status":"ready","srcConnection":{"instanceType":"bcegateway","region":"bj","dbType":"redis","dbHost":"10.18.140.78","dbPort":8,"dbPass":"","vpcId":"9556bf45-5867-4495-83c5-bd945b782503","backendIp":"172.16.2.23","backendPort":6379,"vpcEndpointId":"afef67ff-8731-4aac-abed-27b30b6a0ca2","positionStrategy":"fail"},"dstConnection":{"instanceType":"bcescs","region":"bj","dbType":"redis","instanceId":"scs-bj-ohfyvdqyxkwg_proxy_2"},"dynamicInfo":{},"message":"","schemaMapping":[],"createTime":"2022-09-13T08:04:38Z","dataType":["base","increment"],"subStatus":[]}]},"dtsTaskNeg":{//反向数据流(任务组)dtsgong72g3o6pl6om18详情"dtsGroupName":"dtsrelbh81lx8xicuacs","dtsGroupId":"dtsgong72g3o6pl6om18","status":"ready","dataType":["increment"],"region":"bj","createTime":"2022-09-13T07:52:31Z","srcConnection":{"instanceType":"bcescs","region":"bj","dbType":"redisCluster","instanceId":"scs-bj-ohfyvdqyxkwg","dbPass":""},"dstConnection":{"instanceType":"bcegateway","region":"bj","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","dbPass":"","vpcId":"9556bf45-5867-4495-83c5-bd945b782503","vpcName":"zhaixinrui","vpcCidr":"172.16.0.0/16","vpcShortId":"vpc-it3v6qt3jhvj","positionStrategy":"fail"},"schemaMapping":[],"remark":"","dtsTasks":[//子任务dtsmdf98gso72lm0qasd详情{"dtsId":"dtsmdf98gso72lm0qasd","taskName":"son of dtsgong72g3o6pl6om18","status":"ready","srcConnection":{"instanceType":"bcescs","region":"bj","dbType":"redis","instanceId":"scs-bj-ohfyvdqyxkwg-0","dbPass":"",},"dstConnection":{"instanceType":"bcegateway","region":"bj","dbType":"redis","dbHost":"10.18.140.78","dbPort":8,"dbPass":"","vpcId":"9556bf45-5867-4495-83c5-bd945b782503","backendIp":"172.16.2.23","backendPort":6379,"vpcEndpointId":"afef67ff-8731-4aac-abed-27b30b6a0ca2","positionStrategy":"fail"},"dynamicInfo":{},"message":"","schemaMapping":[],"createTime":"2022-09-13T08:04:39Z","dataType":["increment"],"subStatus":[]}]},"payInfo":{"productType":"postpay","sourceInstanceType":"OffBce","targetInstanceType":"OnBce","crossRegionTag":1,"createTime":1663055551000,"standard":"Large","endTime":null},"incrNetType":"large","netType":"large","openRollbackConfig":"false"}