Use the DescribeTaskInfo operation to query details about a cluster task, such as its task type, running state, and running stage.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cs:DescribeTaskInfo |
get |
*All Resource
|
None | None |
Request syntax
GET /tasks/{task_id} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| task_id |
string |
Yes |
The task ID. |
T-5faa48fb31b6b8078d00**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
No parameters required.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| task_id |
string |
The task ID. |
T-5faa48fb31b6b8078d000006 |
| cluster_id |
string |
The cluster ID. |
c78592bfe92244365b3c3ad47f1de**** |
| task_type |
string |
The type of the task. For a scale-out task, the value is |
cluster_scaleout |
| state |
string |
The state of the task. Valid values:
|
running |
| created |
string |
The time the task was created. |
2020-11-10T16:02:04+08:00 |
| updated |
string |
The time the task was last updated. |
2020-11-10T16:03:06+08:00 |
| target |
object |
The target of the task. |
|
| id |
string |
The ID of the task target. |
c78592bfe92244365b3c3ad47f1de**** |
| type |
string |
The type of the task target. |
cluster |
| parameters |
object |
The task parameters. |
|
| stages |
array<object> |
The task stages. |
|
|
array<object> |
A task stage. |
||
| state |
string |
The state of the task stage. |
running |
| start_time |
string |
The start time of the task stage. |
2022-12-15 23:00:00 |
| end_time |
string |
The end time of the task stage. |
2022-12-15 23:00:00 |
| message |
string |
The message for the task stage. |
success to xxxxx |
| outputs |
object |
The output of the task stage. |
|
| current_stage |
string |
The current stage of the task. |
DrainNodes |
| events |
array<object> |
Events generated by the task. |
|
|
object |
The event details. |
||
| action |
string |
The event action. |
start |
| level |
string |
The event level. |
Normal |
| message |
string |
The event message. |
start to xxx |
| reason |
string |
The reason for the event. |
NodePoolUpgradeStart |
| source |
string |
The source of the event. |
ACK |
| timestamp |
string |
The time the event was generated. |
1669706229286 |
| task_result |
array<object> |
The details of the task execution. |
|
|
object |
The result for a specific resource. |
||
| data |
string |
The resource that the task operates on. For example, for a scale-out task that operates on an instance, this field is the instance ID. |
i-xxx |
| status |
string |
The scale-out state of the resource. Valid values:
|
success |
| error |
object |
Error information for the task. |
|
| code |
string |
The error code. |
400 |
| message |
string |
The error message. |
failed to xxx |
| outputs |
object |
Examples
Success response
JSON format
{
"task_id": "T-5faa48fb31b6b8078d000006",
"cluster_id": "c78592bfe92244365b3c3ad47f1de****",
"task_type": "cluster_scaleout",
"state": "running",
"created": "2020-11-10T16:02:04+08:00",
"updated": "2020-11-10T16:03:06+08:00",
"target": {
"id": "c78592bfe92244365b3c3ad47f1de****\n",
"type": "cluster"
},
"parameters": {
"test": "test",
"test2": 1
},
"stages": [
{
"state": "running",
"start_time": "2022-12-15 23:00:00",
"end_time": "2022-12-15 23:00:00",
"message": "success to xxxxx",
"outputs": {
"test": "test",
"test2": 1
}
}
],
"current_stage": "DrainNodes",
"events": [
{
"action": "start",
"level": "Normal",
"message": "start to xxx",
"reason": "NodePoolUpgradeStart",
"source": "ACK",
"timestamp": "1669706229286"
}
],
"task_result": [
{
"data": "i-xxx",
"status": "success"
}
],
"error": {
"code": "400",
"message": "failed to xxx"
},
"outputs": {
"test": "test",
"test2": 1
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.