DescribeTaskInfo

更新时间:
复制 MD 格式

Call the DescribeTaskInfo API to query the details of a cluster task, such as its type, status, and current phase.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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 ID of the task.

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 task type. A value of cluster_scaleout indicates a scale-out task.

cluster_scaleout

state

string

The state of the task. Valid values:

  • running: The task is running.

  • fail: The task failed.

  • success: The task succeeded.

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 object targeted by the task.

c78592bfe92244365b3c3ad47f1de****

type

string

The type of the object targeted by the task.

cluster

parameters

object

The task parameters.

stages

array<object>

The task stages.

array<object>

Details of 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 task stage message.

success to xxxxx

outputs

object

The task stage outputs.

current_stage

string

The current task stage.

DrainNodes

events

array<object>

The events generated by the task.

object

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 event source.

ACK

timestamp

string

The time when the event was generated.

1669706229286

task_result

array<object>

The task execution details.

object

The execution result for a single resource.

data

string

The resource that the task operates on. For example, for a scale-out task that operates on an instance, this field returns the instance ID.

i-xxx

status

string

The processing state of the resource. Valid values:

  • success: The operation succeeded.

  • failed: The operation failed.

  • initial: The resource is being initialized.

success

error

object

Details about the error that occurred. This parameter is populated only when the task fails.

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.