All Products
Search
Document Center

Container Service for Kubernetes:DescribeTaskInfo

Last Updated:Jan 23, 2024

You can call the DescribeTaskInfo operation to query the execution details about a task by task ID.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Debug

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
cs:DescribeTaskInfoRead
  • All Resources
    acs:cs:{#regionId}:{#accountId}:*
    none
none

Request syntax

GET /tasks/{task_id}

Request parameters

ParameterTypeRequiredDescriptionExample
task_idstringYes

The task ID.

T-5faa48fb31b6b8078d00****

Response parameters

ParameterTypeDescriptionExample
object

The response body.

task_idstring

The task ID.

T-5faa48fb31b6b8078d000006
cluster_idstring

The cluster ID.

c78592bfe92244365b3c3ad47f1de****
task_typestring

The task type. A value of cluster_scaleout indicates a scale-out task.

cluster_scaleout
statestring

The status of the task. Valid values:

  • running: The task is running.
  • failed: The task failed.
  • success: The task is complete.
running
createdstring

The time when the task was created.

2020-11-10T16:02:04+08:00
updatedstring

The time when the task was updated.

2020-11-10T16:03:06+08:00
targetobject

The object of the task.

idstring

The ID of the object.

c78592bfe92244365b3c3ad47f1de****
typestring

The type of the object.

cluster
parametersobject

The task parameters.

stagesobject []

Detailed information about the stage of the task.

statestring

The status of the stage.

running
start_timestring

The start time of the stage.

2022-12-15 23:00:00
end_timestring

The end time of the stage.

2022-12-15 23:00:00
messagestring

The message about the stage.

success to xxxxx
outputsobject

The output generated at the stage.

current_stagestring

The current stage of the task.

DrainNodes
eventsobject []

The event generated by the task.

actionstring

The action of the event.

start
levelstring

The severity level of the event.

Normal
messagestring

The message about the event.

start to xxx
reasonstring

The cause of the event.

NodePoolUpgradeStart
sourcestring

The source of the event.

ACK
timestampstring

The timestamp when the event was generated.

1669706229286
task_resultobject []

The execution details of the task.

datastring

The resources that are managed by the task. For a scale-out task, the value of this parameter is the ID of the instance that is added by the task.

i-xxx
statusstring

The status of the scale-out task. Valid values:

  • success: The scale-out task is successful.
  • success: The scale-out task failed.
  • initial: The scale-out task is being initialized.
success
errorobject

The error returned for the task.

codestring

The error code returned.

400
messagestring

The error message returned.

failed to xxx

Examples

Sample success responses

JSONformat

{
  "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"
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history