Call DescribeTaskInfo to get details about a cluster task, such as the task type, running status, and running phase.
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 data returned in the response. |
||
| task_id |
string |
The ID of the task. |
T-5faa48fb31b6b8078d000006 |
| cluster_id |
string |
The ID of the cluster. |
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 when the task was created. |
2020-11-10T16:02:04+08:00 |
| updated |
string |
The time when the task was last updated. |
2020-11-10T16:03:06+08:00 |
| target |
object |
The object targeted by the task. |
|
| id |
string |
The ID of the target object. |
c78592bfe92244365b3c3ad47f1de**** |
| type |
string |
The type of the target object. |
cluster |
| parameters |
object |
The parameters of the task. |
|
| stages |
array<object> |
The stages of the task. |
|
|
array<object> |
A stage of the task. |
||
| state |
string |
The state of the task stage. |
running |
| start_time |
string |
The time when the task stage started. |
2022-12-15 23:00:00 |
| end_time |
string |
The time when the task stage ended. |
2022-12-15 23:00:00 |
| message |
string |
Information about 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> |
The events generated by the task. |
|
|
object |
The details of an event. |
||
| action |
string |
The action of the event. |
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. The value |
ACK |
| timestamp |
string |
The timestamp of the event. |
1669706229286 |
| task_result |
array<object> |
The execution details of the task. |
|
|
object |
The execution result for a specific resource. |
||
| data |
string |
The resource targeted by the task. For example, if the task scales out an instance, this parameter returns the ID of the instance. |
i-xxx |
| status |
string |
The status of the resource scale-out. Valid values:
|
success |
| error |
object |
Information about the task error. |
|
| 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.