Baidu AI Cloud
中国站

百度智能云

Database Transmission Server

Configure Task

Interface Description

Configure the transmission task, including the mapping relation of transmission object, the connection information of a database, etc.

Request URI

POST /v{version}/task/{dtsId}/config

Parameter name Parameter type Required Description Example value Parameter position
version String Yes API version number "1" Path
dtsId String Yes Task ID "dtsmxxxyyy" Path

Request Body Parameters

Instructions for Data Structure of Request Body Field

Parameter name Parameter type Required Description Example value
dataType String[] Yes Transmission data type array (schema: Structure migration; base: Total migration; and increment: Increment migration) ["base"]
srcConnection Connection Yes
dstConnection Connection Yes
granularity String Yes Granularity of transmission tasks (instance: Instance level; dbtb: Database table level) instance
schemaMapping SchemaMapping Yes

Instructions for Data Structure of Connection Field

Parameter name Parameter type Required Description Example value
instanceType String No Instance Type bcerds
region String No Region bj
dbType String No Database type mysql
dbUser String No Access account of database dts_trans
dbPass String No Access password of database
dbPort Integer No Access port of database 3306
dbHost String No Database ip or host name 192.168.1.1
instanceId String No Instance ID rdsmfgdti3d53f5
field_whitelist String No Column filtering (whitelist)
field_blacklist String No Column filtering (blacklist)

Instruction for Data Structure of Schema Field

Parameter name Parameter type Required Description Example value
type String No The types of objects to be transmitted, with values: db (database), table, view, function, and procedure table
src String No The schema name of source database test.table_src
dst String No The schema name of target database test.table_dst
where String No The where filtering condition

Response Header Parameters

No other particular header fields are available, except for common header fields.

Response Body Parameters

Instructions for Data Structure of Response Body Field

Parameter name Parameter type Required Description Example value
dtsId String Yes Task ID dtsxxxyyyzzz

Request Example

POST /v1/task/{dtsId}/config
<Common request header>


{
  "granularity" : "instance",
  "schemaMapping" : [ {
    "dst" : "test.table_dst",
    "src" : "test.table_src",
    "where" : "where",
    "type" : "table"
  } ],
  "dataType" : [ "base" ],
  "srcConnection" : {
    "dbPass" : "dbPass",
    "dbPort" : 3306,
    "instanceId" : "rdsmfgdti3d53f5",
    "instanceType" : "bcerds",
    "dbUser" : "_dts_trans_",
    "field_whitelist" : "field_whitelist",
    "dbType" : "mysql",
    "dbHost" : "192.168.1.1",
    "field_blacklist" : "field_blacklist",
    "region" : "bj"
  }
}

Response Example

HTTP/1.1 200 OK
<Common response header>

{
  "dtsId" : "dtsxxxyyyzzz"
}

Error Code

See universal error code.

Previous
Query Task List
Next
Pre-check