任务详情
更新时间:2026-07-16
描述
该接口用于查看任务详情。
OpenAPI Explorer
去调试
您可以在 OpenAPI Explorer 中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer 可以自动生成 SDK 代码示例。
请求结构
Plain Text
1GET /v{version}/task?namespace={namespace}&dagId={dagId}&taskId={taskId}&ignoreChildren={ignoreChildren}&locale={locale}
2Host: oos.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| version | String | 是 | URL参数 | API版本号,当前取值为2 |
| namespace | String | 否 | Query参数 | 名称空间,如果用户未使用自定义名称空间,可以不传此字段,默认为“default” |
| dagId | String | 是 | Query参数 | 执行(Execution)ID |
| taskId | String | 是 | Query参数 | 任务(Task)ID |
| ignoreChildren | String | 否 | Query参数 | 是否忽略子执行返回;为 true 时只返回当前 task 自身信息,不递归加载子任务列表 |
| locale | String | 否 | Query参数 | 语言,默认 zh-cn |
返回头域
除公共头域,无其它特殊头域。
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| success | Boolean | 请求是否成功 |
| msg | String | 失败时返回失败原因,成功时为空字符串 |
| code | Integer | 状态码 |
| result | Task |
请求示例
Plain Text
1GET /v{version}/task?namespace={namespace}&dagId={dagId}&taskId={taskId}&ignoreChildren={ignoreChildren}&locale={locale}
2Host: oos.bj.baidubce.com
3Authorization: authorization string
返回示例
Plain Text
1200 Success
2
3{
4 "success" : true,
5 "msg" : "",
6 "code" : 200,
7 "result" : {
8 "userId" : "2dcxxxxxxxxxxx",
9 "id" : "t-RV7xxxxxx",
10 "revision" : 15193124,
11 "execution" : {
12 "namespace" : "default",
13 "id" : "d-7fxxxxxx",
14 "description" : "",
15 "templateDeleted" : false,
16 "parallelism" : 0,
17 "revision" : 0,
18 "manually" : false,
19 "createdTimestamp" : 0,
20 "updatedTimestamp" : 0,
21 "finishedTimestamp" : 0,
22 "properties" : { },
23 "tasks" : [ ],
24 "tags" : [ ],
25 "operatorActions" : { }
26 },
27 "operator" : {
28 "name" : "execute_shell",
29 "description" : "用户虚机执行脚本",
30 "descriptionI18n" : { },
31 "operator" : "BCE::Agent::ExecuteShell",
32 "label" : "",
33 "labelI18n" : { },
34 "retries" : 0,
35 "retryInterval" : 0,
36 "timeout" : 3600000,
37 "parallelismRatio" : 0,
38 "parallelismCount" : 0,
39 "allowedFailureRatio" : 0,
40 "allowedFailureCount" : 0,
41 "manually" : false,
42 "scheduleDelayMilli" : 0,
43 "waitOnAgentMilli" : 0,
44 "pauseOnFailure" : false,
45 "triggerRule" : "ALL_SUCCESS",
46 "loopWindowType" : "SLICING",
47 "properties" : {
48 "__workerSelectors__" : [ {
49 "instanceId" : "i-EAxxxxx"
50 }, {
51 "instanceId" : "i-4Dxxxxx"
52 } ],
53 "content" : "hostname",
54 "execUser" : "root",
55 "instances" : [ {
56 "instanceId" : "i-EAxxxxx"
57 }, {
58 "instanceId" : "i-4Dxxxxx"
59 } ],
60 "timeoutSecond" : 3600,
61 "user" : "root",
62 "userId" : "2dcxxxxxxxxxxx",
63 "workDir" : "/"
64 }
65 },
66 "createdTimestamp" : 1782718407907,
67 "updatedTimestamp" : 1782718408135,
68 "finishedTimestamp" : 1782718408135,
69 "state" : "SUCCESS",
70 "properties" : {
71 "instances" : [ {
72 "instanceId" : "i-EAxxxxx"
73 }, {
74 "instanceId" : "i-4Dxxxxx"
75 } ],
76 "execUser" : "root",
77 "timeoutSecond" : 3600,
78 "workDir" : "/",
79 "user" : "root",
80 "userId" : "2dcxxxxxxxxxxx",
81 "content" : "hostname"
82 },
83 "tries" : 0,
84 "children" : [ {
85 "userId" : "2dcxxxxxxxxxxx",
86 "revision" : 0,
87 "loopIndex" : 0,
88 "createdTimestamp" : 0,
89 "updatedTimestamp" : 0,
90 "finishedTimestamp" : 0,
91 "state" : "SUCCESS",
92 "properties" : { },
93 "tries" : 0,
94 "outputContext" : { }
95 }, {
96 "userId" : "2dcxxxxxxxxxxx",
97 "revision" : 0,
98 "loopIndex" : 1,
99 "createdTimestamp" : 0,
100 "updatedTimestamp" : 0,
101 "finishedTimestamp" : 0,
102 "state" : "SUCCESS",
103 "properties" : { },
104 "tries" : 0,
105 "outputContext" : { }
106 } ],
107 "outputContext" : { }
108 }
109}
评价此篇文章
