Baidu AI Cloud
中国站

百度智能云

Database Transmission Server

Query Task Information

Interface Description

View the data transmission task information of the designated id.

Request URI

GET /v{version}/task/{dtsId}

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

No

Response Header Parameters

No other special 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 dtsmxxyy1234
taskName String Yes Task name dtsmxxyy1234
status String Yes Task status (unConfig: means after you create a task, you can enter the unconfigured status, which only contains dtsID information; ready: means after configuring tasks, you can enter the not started state, which contains all information of the task; checking: means after clicking Start, you can enter the checking state; checkPass: means only after passing the pre-check, you can start the task; checkFailed: when starting tasks, you can enter the pre-check state, and in case of failure in check, you can enter this state that you can modify tasks or terminate tasks directly; running: after passing the pre-check, you can enter this status, including data migration or data synchronization; stopping: means that you cannot operate the task in this status; stopped: means starting from this state can achieve resuming from the breakpoint, i.e., modifying a data synchronization object after pause; stopCheckFailed: means the pre-check of a new synchronized object fails. When adding the synchronized object, you can enter the pre-check status, and in case of failure in check, you can return to the paused state, but you can view and check failure reasons; runFailed: means in case of an exception during running, you can enter this state; in case of a recoverable error, you can continue to start after the recovery; and in case of an unrecoverable error, you can only terminate the task; finished: means that the task is finished, including finishing the task manually or automatically after the task is complete, or an unrecoverable error occurs) finished
dataType DataType Yes
region String Yes Region bj
createTime String Yes Creation Time 2020-12-10T13: 24: 10Z
srcConnection Connection Yes
dstConnection Connection Yes
schemaMapping SchemaMapping Yes
runningTime Integer Yes Duration of tasks run 20
subStatus List<SubStatus> Yes Subtask status
dynamicInfo DynamicInfo Yes
errmsg String Yes The error information returned when failed to execute. E.g., the error information is empty string when the task execution is successful.
sdkRealtimeProgress String Yes (Limited to data subscription) Task real-time progress in UTC format
granularity String Yes The granularity of transmission tasks, which is only divided into an instance level and a database level dbtb
subDataScope SubDataScope Yes (Limited to data subscription) Data scope of subscription channel
payInfo PayInfo Yes Payment information
lockStatus String Yes Whether tasks are locked or not. The value includes: unlock, lockExpiration unlock
dtsIdPos String Yes The forward task ID of two-way synchronization tasks dtsmxxyy1234
dtsIdNeg String Yes The backward task ID of two-way synchronization tasks dtsmxxyy1234
dtsTaskPos DtsTaskPos Yes Forward task Information of two-way synchronization tasks
dtsTaskNeg DtsTaskNeg Yes Backward task Information of two-way synchronization tasks

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 filter (whitelist)
field_blacklist String No Column filter (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 where filter condition

Instructions for Data Structure of SubStatus Field

Parameter name Parameter type Required Description Example value
s String Yes Structure running
b String Yes Total running
i String Yes Increment running

Instruction for Data Structure of DynamicInfo Field

Parameter name Parameter type Required Description Example value
schema List<DynamicInfoSchema> Yes
base List<DynamicInfoBase> Yes
increment List<DynamicInfoIncrement> Yes

Instruction for Data Structure of DynamicInfoSchema Field

Parameter name Parameter type Required Description Example value
current String Yes The number of schema migrated 800
count String Yes The total number of schema migrated 1000
speed String Yes Migration rate 500
expectFinishTime String Yes Predicted time remaining (s) 20

Instructions for Data Structure of DynamicInfoBase Field

Parameter name Parameter type Required Description Example value
current String Yes Line number of data migrated 800
count String Yes Total line number of data migrated 1000
speed String Yes Migration rate 500
expectFinishTime String Yes Predicted time remaining (s) 20

Instructions for Data Structure of DynamicInfoIncrement Field

Instructions for Data Structure of SubDataScope Field

Parameter name Parameter type Required Description Example value
startTime String Yes Start time
endTime String Yes End time

Instructions for Data Structure of PayInfo Field

Parameter name Parameter type Required Description Example value
productType String Yes Payment method: Prepay, and postpay postpay
sourceInstanceType String Yes Source-end instance type (OnBce: Baidu AI Cloud database; and OffBce: Self-built data storage) OnBce
targetInstanceType String Yes Target instance type (OnBce: Baidu AI Cloud database; and OffBce: Self-built data storage) OnBce
crossRegionTag Integer Yes Cross-region identifier (0: Intra-region; and 1: Cross-region) 0
createTime Long Yes Resource create time, and UNIX time stamp (msec) 1607606657000
standard String Yes Specification (Large: Large specification; and the large specification is only supported) Large
endTime Long Yes UNIX time stamp (msec) 1607606657000

Instructions for Data Structure of DtsTaskPos Field

A dtsTaskPos field is the forward task information of two-way synchronization tasks, so the value structure of this field is consistent with the task structure.

Instructions for Data Structure of DtsTaskNeg Field

A dtsTaskNeg field is the backward task information of two-way synchronization tasks, so the value structure of this field is consistent with the task structure.

Request Example

GET /v1/task/{dtsId}
<Common request header>

Response Example

HTTP/1.1 200 OK
<Common response header>

{
  "subDataScope" : {
    "startTime" : "startTime",
    "endTime" : "endTime"
  },
  "schemaMapping" : [ {
    "dst" : "test.table_dst",
    "src" : "test.table_src",
    "where" : "where",
    "type" : "table"
  }, {
    "dst" : "test.table_dst",
    "src" : "test.table_src",
    "where" : "where",
    "type" : "table"
  } ],
  "dataType" : [ "base", "base" ],
  "dtsId" : "dtsmxxyy1234",
  "errmsg" : "errmsg",
  "runningTime" : 20,
  "dtsIdNeg" : "dtsmxxyy1234",
  "subStatus" : [ {
    "b" : "running",
    "s" : "running",
    "i" : "running"
  }, {
    "b" : "running",
    "s" : "running",
    "i" : "running"
  } ],
  "dtsIdPos" : "dtsmxxyy1234",
  "sdkRealtimeProgress" : "sdkRealtimeProgress",
  "lockStatus" : "unlock",
  "createTime" : "2020-12-10T13: 24: 10Z",
  "granularity" : "dbtb",
  "dtsTaskNeg" : { },
  "taskName" : "dtsmxxyy1234",
  "region" : "bj",
  "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"
  },
  "dynamicInfo" : {
    "schema" : [ {
      "expectFinishTime" : "20",
      "current" : "800",
      "count" : "1000",
      "speed" : "500"
    }, {
      "expectFinishTime" : "20",
      "current" : "800",
      "count" : "1000",
      "speed" : "500"
    } ],
    "increment" : [ [ { }, { } ], [ { }, { } ] ],
    "base" : [ {
      "expectFinishTime" : "20",
      "current" : "800",
      "count" : "1000",
      "speed" : "500"
    }, {
      "expectFinishTime" : "20",
      "current" : "800",
      "count" : "1000",
      "speed" : "500"
    } ]
  },
  "payInfo" : {
    "standard" : "Large",
    "sourceInstanceType" : "OnBce",
    "createTime" : 1607606657000,
    "targetInstanceType" : "OnBce",
    "crossRegionTag" : 0,
    "endTime" : 1607606657000,
    "productType" : "postpay"
  },
  "dtsTaskPos" : { },
  "status" : "finished"
}

Error Code

See universal error code.

Previous
Create Task
Next
Query Task List