跳到主要内容

数据任务详情

接口描述

根据任务id查询任务详情

接口地址

/cloudcanal/console/api/v1/openapi/datajob/queryjob

请求方式

POST

请求参数

参数名称参数说明请求类型是否必须数据类型
jobId任务idbodylong

公共响应结果

参数名称参数说明类型(java)不为空
code1:成功 0:失败string
dataobject
msgstring
requestIdstring

data 参数说明

结果数据包含 DataJob 的基本信息,以及具体对应的 Task 列表和数据源基本信息

参数名称参数说明不为空数据类型
dataJobIdDataJob idlong
dataJobNameDataJob 名称long
dataJobDescDataJob 描述String
gmtCreated创建时间String
userName拥有者String
dataJobTypeDataJob 类型, 参考 获取任务类型列表long
dataTaskState当前任务 Task 状态,参考 任务状态列表String
sourceDsVO源端数据源信息,参考 数据源信息String
targetDsVO目标端数据源信息,参考 数据源信息String
dataTasksTask 列表,参考 dataTaskVO 参数说明String
sourceSchema单独通过 查询任务schema信息 查询String
targetSchema单独通过 查询任务schema信息 查询String
mappingConfig单独通过 查询任务schema信息 查询String
filterDDL是否过滤 DDL 同步,true 表示过滤, false 表示不过滤Boolean
structMigration是否做结构迁移Boolean
initialSync如果是数据同步任务,是否需要初始化数据(全量迁移)Boolean
shortTermNum如果有短期同步,持续多少天int
shortTermSync如果是数据迁移任务,是否需要短期同步Boolean
fsmId状态机idint
fsmActive状态机是否活跃Boolean
consoleJobId曾运行过或正在运行,距离当前时间最近的异步任务 idBoolean
consoleTaskState异步任务状态String
childJobs子任务列表Boolean
lifeCycleState生命周期

CREATING(创建中)
CREATED(已创建)
DELETING(删除中)
DELETED(已删除)
LOCKED(锁定)
Boolean
srcSchemaLessFormat如果源端是消息或者缓存,定义的schema类型Boolean
dstSchemaLessFormat如果目标端是消息或者缓存,定义的schema类型String
dstCaseSensitiveType目标数据源大小写敏感类型
UpperCase
LowerCase
Sensitive
NoSpecified
Boolean
haveException是否存在异常Boolean

dataTaskVO 参数说明

参数名称参数说明不为空数据类型
dataTaskIdTask idlong
gmtCreate创建时间String
gmtModified上次更改时间String
dataTaskTypeTask 类型

BUILD_STRUCT(结构迁移)
FULL(全量迁移)
INCREMENT(增量同步)
CHECK(校验)
REVISE(订正)
REVIEW(未使用)
String
dataTaskNameTask 名称String
dataTaskStatusTask 状态,参考 任务状态列表String
dataJobId所属的 DataJob idlong
dataJobName所属的 DataJob 名称String
filterDdl是否过滤 DDLBoolean
checkOnce是否单次校验Boolean
checkPeriod是否是周期性校验Boolean
fullPeriod是否是周期性迁移Boolean
fullPeriodCronExpr周期性迁移 CronTab 表达式String
checkPeriodCronExpr周期性校验 CronTab 表达式String
lastCheckTime上次校验时间String
fullJvmHeapMb全量任务启动的 java 进程堆内存,MBint
incrementJvmHeapMb增量任务启动的 java 进程堆内存,MBint
checkJvmHeapMb校验任务启动的 java 进程堆内存,MBint
taskPosition任务位点String
healthLevel任务健康状况

Unhealthy(异常)
SubHealth(亚健康,无法判定死活)
Health(正常)
String
workerId挂载的机器idString
workerIp挂载的机器ipString
clusterId挂载集群idlong
dataDelayMs延迟时间,毫秒long
nextFireTime下一次触发时间String
startTriggerTime开始触发时间String
firstHeartbeatSendTime启动后第一次返回心跳包时间String

响应示例

{
"requestId": "8e2e34f4-2cb8-11ec-a410-735664430ce2",
"code": "1",
"msg": "request success",
"data": {
"dataJobId": 517,
"dataJobName": "canal1v004a007dd",
"dataJobDesc": "zzzz",
"userName": "liqiang",
"dataJobType": "SYNC",
"dataTaskState": "FULL",
"sourceDsVO": {
"id": 61,
"gmtCreate": "2021-09-10T03:42:39.000+0000",
"gmtModified": "2021-09-10T03:58:30.000+0000",
"uid": "4503980488230169",
"owner": "liqiang",
"deployType": "SELF_MAINTENANCE",
"region": "customer",
"dataSourceType": "MySQL",
"privateHost": "127.0.0.1:3306",
"publicHost": "",
"hostType": "PRIVATE",
"instanceDesc": "local_source",
"version": "5.7.27-log",
"instanceId": "my-6716s8rryux1366",
"autoCreateAccount": "NOT_CREATE",
"schemaJson": null,
"consoleJobId": 0,
"consoleTaskState": null,
"accountName": "origin",
"lifeCycleState": "CREATED",
"securityType": "USER_PASSWD"
},
"targetDsVO": {
"id": 1,
"gmtCreate": "2021-03-26T04:07:23.000+0000",
"gmtModified": "2021-09-14T11:11:39.000+0000",
"uid": "4503980488230169",
"owner": "liqiang",
"deployType": "SELF_MAINTENANCE",
"region": "customer",
"dataSourceType": "MySQL",
"privateHost": "127.0.0.1:4306",
"publicHost": "",
"hostType": "PRIVATE",
"instanceDesc": "local target",
"version": "5.7.27-log",
"instanceId": "my-dc1l0m2cfdtrrhq",
"autoCreateAccount": "NOT_CREATE",
"schemaJson": null,
"consoleJobId": 0,
"consoleTaskState": null,
"accountName": "root",
"lifeCycleState": "CREATED",
"securityType": "USER_PASSWD"
},
"sourceSchema": null,
"targetSchema": null,
"mappingConfig": null,
"filterDdl": false,
"structMigration": false,
"initialSync": true,
"shotTermSync": false,
"shotTermNum": 0,
"gmtCreated": "2021-10-14T06:20:06.000+0000",
"dataTasks": [
{
"dataTaskId": 1071,
"gmtCreate": null,
"gmtModified": null,
"dataTaskType": "FULL",
"dataTaskName": "canal1v004a007dd_FULL",
"dataTaskStatus": "RUNNING",
"dataJobId": 517,
"dataJobName": null,
"filterDdl": false,
"checkOnce": false,
"checkPeriod": false,
"fullPeriod": false,
"fullPeriodCronExpr": null,
"checkPeriodCronExpr": null,
"lastCheckTime": null,
"fullJvmHeapMb": 2048,
"incrementJvmHeapMb": 2048,
"checkJvmHeapMb": 2048,
"taskPosition": "{\"dataTaskId\":1071,\"gmtCreate\":1634192406000,\"gmtModified\":1634192406000,\"id\":1071,\"totalToTrans\":0,\"trans\":0,\"transPercent\":0.00}",
"healthLevel": "Unhealthy",
"workerId": 1,
"workerIp": "192.168.0.133",
"clusterId": 1,
"dataDelayMs": 0,
"nextFireTime": null,
"startTriggerTime": "2021-10-14T06:25:34.000+0000",
"firstHeartbeatSendTime": null
},
{
"dataTaskId": 1072,
"gmtCreate": null,
"gmtModified": null,
"dataTaskType": "INCREMENT",
"dataTaskName": "canal1v004a007dd_INCREMENT",
"dataTaskStatus": "INIT",
"dataJobId": 517,
"dataJobName": null,
"filterDdl": false,
"checkOnce": false,
"checkPeriod": false,
"fullPeriod": false,
"fullPeriodCronExpr": null,
"checkPeriodCronExpr": null,
"checkPeriodNum": 0,
"lastCheckTime": null,
"fullJvmHeapMb": 2048,
"incrementJvmHeapMb": 2048,
"checkJvmHeapMb": 2048,
"taskPosition": "{\"dataDelayMillis\":0,\"dataTaskId\":1072,\"delayMillis\":764819,\"filePosition\":0,\"gmtCreate\":1634192406000,\"gmtModified\":1634192406000,\"id\":1072,\"maxPositionTimestamp\":0,\"positionTimestamp\":1634192406589,\"serverId\":0}",
"healthLevel": "Health",
"workerId": 1,
"workerIp": "192.168.0.133",
"clusterId": 1,
"dataDelayMs": 0,
"nextFireTime": null,
"startTriggerTime": "9999-09-09T02:00:00.000+0000",
"firstHeartbeatSendTime": null
}
],
"fsmId": 446,
"fsmActive": true,
"consoleJobId": 1094,
"consoleTaskState": "SUCCESS",
"childJobs": [],
"lifeCycleState": "CREATED",
"srcSchemaLessFormat": null,
"dstSchemaLessFormat": null,
"dstDsCaseSensitive": true,
"haveException": false
}
}