10.Task management
1. Query subtask details
API address: /v1/task/{jobId}
Request method:GET
Request data type:application/json
Response data type:*/*,application/json
Supported version:v1.0.0
API description:
Query execution details of a single subtask
Request parameters:
| Parameter name | Parameter description | Location | Whether required | Data type | Description |
|---|---|---|---|---|---|
| jobId | jobId returned after calling the interface | path | true | string | Task id |
Request example. Replace parameter values in the actual request:
Response parameters:
| Parameter name | Parameter description | Type | Description |
|---|---|---|---|
| code | Return code | integer(int32) | |
| message | Return processing message | string | |
| result | Returned data object | object | |
| traceId | business ID | string | |
| jobId | Task ID | string | |
| message | Execution result description | string | |
| uuid | Resource UUID | string | |
| sn | sn | string | Card operations: returned for card requests, container creation, cloud disk mounting/unmounting, etc. |
| methodDesc | Task type | string | |
| method | Method name | string | |
| armCardIp | Card IP | string | Container operations: restart, reset, start, stop, backup, and other container-level operations will return this |
| status | Task status code | integer | -1, 0:execution failed; 1:waiting; 2:execution succeeded; 3:in progress; 4:canceling; 5:canceled |
| data | Specific execution content | object | |
| stdOut | Execution content output | list | |
| stdErr | Execution error output | list | |
| beginTime | Task start time | string | |
| endTime | Task end time | string | |
| timestamp | Timestamp | integer(int64) |
Response example:
{
"message": "操作成功!",
"code": 200,
"result": {
"traceId": "C20250822151033726037",
"jobId": "5169daa682384453a6c523572b4587e4",
"methodDesc": "执行异步命令",
"method": "InstanceCommandSync",
"data": {
"stdOut": [
"/",
""
],
"stdErr": [
""
]
},
"beginTime": "2025-08-22 15:10:33",
"endTime": "2025-08-22 15:10:34",
"message": "任务成功",
"uuid": "qs-fs-pre-fmmjbdac7ye24o40",
"status": 2,
"armCardIp": "172.30.0.40"
},
"timestamp": 1755847993501
}
2. Query subtask list
API address: /v1/task/list
Request method:GET
Request data type:application/json
Response data type:*/*,application/json
Supported version:v1.0.0
API description:
Query the subtask list of one or more batch tasks (main tasks)
Request parameters:
| Parameter name | Parameter description | Location | Whether required | Data type | Description |
|---|---|---|---|---|---|
| traceIds | List of traceIds returned after calling the interface | body | true | string | |
| offset | Starting position of the query | body | false | integer | defaults to 0 if not filled |
| limit | Number of records per query | body | false | integer | defaults to 100 if not filled |
Request example:
POST "/openapi/v1/task/list"
body:
{
"offset": 0,
"limit": 100,
"traceIds": [
"C20250822151034530048"
]
}
Response parameters:
| Parameter name | Parameter description | Type | Description |
|---|---|---|---|
| code | Return code | integer(int32) | |
| message | Return processing message | string | |
| result | Returned data object | object | |
| jobs | Task object | object | |
| jobId | Task ID | string | |
| message | Execution result description | string | |
| uuid | Resource uuid | string | |
| status | Status code | integer | -1, 0:execution failed; 1:waiting; 2:execution succeeded; 3:in progress; 4:canceling; 5:canceled |
| methodDesc | Task type | string | |
| method | Method name | string | |
| armCardIp | Card IP | string | |
| sn | Card sn | string | |
| data | Specific execution content | object | |
| stdOut | Execution content output | List | |
| stdErr | Execution error output | List | |
| beginTime | Task start time | string | |
| endTime | Task end time | string | |
| timestamp | Request timestamp | interger(int64) | |
| traceId | Batch task request processing ID | string |
Response example:
{
"message": "操作成功!",
"code": 200,
"result": [
{
"traceId": "C20250822151034530048",
"jobs": [
{
"traceId": "C20250822151034530048",
"jobId": "f58a02ab832845f99348b3d26b85330a",
"methodDesc": "执行异步命令",
"method": "InstanceCommandSync",
"data": {
"stdOut": [
"/",
""
],
"stdErr": [
""
]
},
"beginTime": "2025-08-22 15:10:34",
"endTime": "2025-08-22 15:10:34",
"message": "任务成功",
"uuid": "qs-fs-pre-fmmjbdac7ye24o40",
"status": 2,
"armCardIp": "172.30.0.40"
}
]
}
],
"timestamp": 1755846640915
}