跳到主要内容

异步任务详情

接口描述

查询异步任务详情,包含任务描述、子步骤等,以便查询 任务创建删除任务 等操作状态

接口地址

/cloudcanal/console/api/v1/openapi/consolejob/queryconsolejob

请求方式

POST

请求参数

参数名称参数说明请求类型是否必须数据类型
consoleJobId异步任务id,通常从创建的任务中获得bodylong

公共响应结果

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

data 参数说明

data 中包含整个异步任务概况信息,以及每一个步骤的情况

参数名称参数说明类型(java)不为空
id主键Long
gmtCreate创建时间String
gmtModified修改时间String
jobToken异步任务识别号String
label异步任务类型String
dataJobName异步任务关联任务名称String
dataJobDesc异步任务描述String
workerName该集群正常运行的机器总数int
workerDesc该集群异常的机器总数int
dsInstanceId拥有人名称String
datasourceDesc拥有人名称String
taskState任务状态

WAIT_START(等待启动)
EXECUTE(执行中)
SUCCESS(成功)
FAILED(失败)
CANCELED(已取消)
SKIP(忽略)
String
launcher任务操作人String
launchTime任务启动时间String
finishTime任务结束时间String
userRoleType执行人角色

SYSTEM
ORG_ADMIN
String
resourceType关联的资源类型

DATA_JOB
CONSOLE_USER
WORKER
DATASOURCE
String
resourceId关联的资源idLong

taskVOList 为步骤列表,如果失败,可重试或者忽略(如果可以忽略)

参数名称参数说明类型(java)不为空
id主键Long
gmtCreate创建时间String
gmtModified修改时间String
jobId步骤关联的异步任务idLong
taskState当前步骤状态

WAIT_START(等待启动)
EXECUTE(执行中)
SUCCESS(成功)
FAILED(失败)
CANCELED(已取消)
SKIP(忽略)
String
context步骤关联的上下文信息String
host步骤执行的机器地址String
executeOrder执行顺序int
executeTime步骤执行时间String
finishTime步骤结束时间String
message步骤如果执行异常,此处会展现相关异常信息String
cancelable是否可忽略Boolean
stepName步骤名称,带国际化String

响应示例

{
"requestId": "36e910a4-2b4e-11ec-8c7e-4d8116d1099b",
"code": "1",
"msg": "request success",
"data": {
"id": 1081,
"gmtCreate": "2021-10-08T05:15:05.000+0000",
"gmtModified": "2021-10-08T05:15:13.000+0000",
"jobToken": "b2a4424c-27f6-11ec-8a1c-e94c1c29eb93",
"label": "DATA_JOB_CREATE",
"dataJobName": "canalp417v2d81ir",
"dataJobDesc": "123",
"workerName": null,
"workerDesc": null,
"dsInstanceId": null,
"datasourceDesc": null,
"taskState": "SUCCESS",
"launcher": "liqiang",
"launchTime": "2021-10-08T05:15:06.000+0000",
"finishTime": "2021-10-08T05:15:14.000+0000",
"taskVOList": [
{
"id": 3409,
"gmtCreate": "2021-10-08T05:15:05.000+0000",
"gmtModified": "2021-10-08T05:15:13.000+0000",
"jobId": 1081,
"taskState": "SUCCESS",
"context": "{\"consoleJobId\":0,\"dataJobId\":511,\"resources\":[]}",
"host": "192.168.0.133",
"executeOrder": 0,
"executeTime": "2021-10-08T05:15:06.000+0000",
"finishTime": "2021-10-08T05:15:13.000+0000",
"message": null,
"cancelable": true,
"stepName": "\"MySQL->MySQL 结构迁移\""
},
{
"id": 3410,
"gmtCreate": "2021-10-08T05:15:05.000+0000",
"gmtModified": "2021-10-08T05:15:13.000+0000",
"jobId": 1081,
"taskState": "SUCCESS",
"context": "{\"consoleJobId\":0,\"dataJobId\":511,\"resources\":[]}",
"host": "192.168.0.133",
"executeOrder": 1,
"executeTime": "2021-10-08T05:15:13.000+0000",
"finishTime": "2021-10-08T05:15:14.000+0000",
"message": null,
"cancelable": false,
"stepName": "\"分配任务执行机器\""
},
{
"id": 3411,
"gmtCreate": "2021-10-08T05:15:05.000+0000",
"gmtModified": "2021-10-08T05:15:13.000+0000",
"jobId": 1081,
"taskState": "SUCCESS",
"context": "{\"consoleJobId\":0,\"dataJobId\":511,\"resources\":[]}",
"host": "192.168.0.133",
"executeOrder": 2,
"executeTime": "2021-10-08T05:15:14.000+0000",
"finishTime": "2021-10-08T05:15:14.000+0000",
"message": null,
"cancelable": false,
"stepName": "\"创建任务状态机\""
},
{
"id": 3412,
"gmtCreate": "2021-10-08T05:15:05.000+0000",
"gmtModified": "2021-10-08T05:15:13.000+0000",
"jobId": 1081,
"taskState": "SUCCESS",
"context": "{\"consoleJobId\":0,\"dataJobId\":511,\"resources\":[]}",
"host": "192.168.0.133",
"executeOrder": 3,
"executeTime": "2021-10-08T05:15:14.000+0000",
"finishTime": "2021-10-08T05:15:14.000+0000",
"message": null,
"cancelable": false,
"stepName": "\"完成任务创建\""
}
],
"userRoleType": "SYSTEM",
"resourceType": "DATA_JOB",
"resourceId": 511
}
}