Help Center/ CodeArts Deploy/ API Reference/ APIs/ Managing Applications/ Obtaining the Deployment Task Status
Updated on 2025-11-28 GMT+08:00

Obtaining the Deployment Task Status

Function

This API is used to obtain the execution status of a deployment task based on its ID.

Calling Method

For details, see Calling APIs.

URI

GET /v2/tasks/{task_id}/state

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

task_id

Yes

String

Definition

Deployment task ID. Obtain the application details by calling the API forobtaining the application details. In the response body, result.arrange_infos[0].id is the desired application details.

Constraints

N/A

Range

The value contains 32 characters. Only letters and digits are allowed.

Default value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

record_id

No

String

Definition

Deployment record ID. Obtain the historical deployment record list by calling the API forquerying the historical deployment record list of the specified application under a project according to the start time and end time. In the response body, result[0].execution_id is the desired historical deployment record list.

Constraints

N/A

Range

The value contains 32 characters. Only letters and digits are allowed.

Default value

N/A

step_state

No

Boolean

Definition

Whether to return the status of each action.

Constraints

N/A

Range

  • true: Returned.

  • false: Not returned.

Default value

true.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition:

User token. Obtain a token (the value of the X-Subject-Token response header) by calling the IAM API used forObtaining a User Token.

Constraints:

N/A.

Value range:

String. Max. 20,000 characters.

Default value:

N/A.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

result

StateInfo object

Definition

Task execution status.

status

String

Definition

Task execution status query result.

Range

  • success: The task execution status is queried.

  • error: Query task execution status failed.

Table 5 StateInfo

Parameter

Type

Description

status

String

Definition

Deployment task execution status.

Range

  • running: The task is running.

  • succeeded: The task is executed successfully.

  • failed: Failed to execute the task.

nick_name

String

Definition

Application creator nickname.

Range

Max. 128 characters.

record_id

String

Definition

Deployment task execution record ID.

Range

The value contains 32 characters. Letters and digits are allowed.

task_id

String

Definition

Deployment task ID.

Range

The value contains 32 characters. Letters and digits are allowed.

step

String

Definition

Execution status of each sub-action of the deployment task.

Range

  • running: The status is running.

  • finish: The status is completed.

start_time

String

Definition

Task execution start time. Format: yyyy-MM-dd HH:mm:ss.

Range

N/A

end_time

String

Definition

Task execution end time. Format: yyyy-MM-dd HH:mm:ss.

Range

N/A

executor

String

Definition

Deployer nickname.

Range

N/A

task_name

String

Definition

Application name.

Range

3 to 128 characters, including letters, digits, underscores (_), and hyphens (-).

step_state

Array of StepInfo objects

Definition

Sub-action execution status list.

Table 6 StepInfo

Parameter

Type

Description

region

String

Definition

Region information.

Range

The value consists of 1 to 256 characters.

enable

Boolean

Definition

Whether an action is enabled.

Range

  • true: Yes.

  • false: No.

name

String

Definition

Action name.

Range

N/A

elapsed_time

Long

Definition

Action execution duration, in milliseconds.

Range

N/A

Example Requests

Obtain the execution status of a deployment task based on its ID.

https://{endpoint}/v2/tasks/e700f15965694253940502911220d76b/state?record_id=2c82ffe8d00d4968a4e5f7a36d87ae17&step_state=false

Example Responses

Status code: 200

OK indicates that the task execution status is queried.

{
  "status" : "success",
  "result" : {
    "record_id" : "2c82ffe8d00d4968a4e5f7a36d87ae17",
    "task_id" : "e700f15965694253940502911220d76b",
    "nick_name" : "A/B side account",
    "status" : "succeeded",
    "step" : "finish",
    "start_time" : "2025-07-09 11:36:28",
    "end_time" : "2025-07-09 11:36:43",
    "executor" : "devcloud_test",
    "task_name" : "test"
  }
}

Status Codes

Status Code

Description

200

OK indicates that the task execution status is queried.

Error Codes

See Error Codes.