Updated on 2025-10-16 GMT+08:00

Rolling Back a Deployment

Function

This API is used to roll back a deployment based on its record ID.

Calling Method

For details, see Calling APIs.

URI

POST /v2/tasks/{task_id}/records/{record_id}/rollback

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

task_id

Yes

String

Definition:

Deployment job 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:

32 characters, including letters and digits.

Default Value:

N/A

record_id

Yes

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:

32 characters, including letters and digits.

Default Value:

N/A

Request Parameters

Table 2 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.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

RollbackRecordsRequestBody

Yes

Object

Definition:

You can transfer an empty JSON to fulfill the requirement that the WSF request body cannot be empty.

Constraints:

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

id

String

Definition:

Deployment record ID.

Range:

32 characters, including letters and digits.

task_id

String

Definition:

Deployment job ID.

Range:

32 characters, including letters and digits.

job_name

String

Definition:

Job name.

Range:

Max. 100 characters, including letters and digits.

app_component_list

Array of AppComponentDao objects

Definition:

List of components associated with the application.

Table 5 AppComponentDao

Parameter

Type

Description

task_id

String

Definition:

Deployment job ID.

Range:

32 characters, including letters and digits.

app_id

String

Definition:

AOM application ID.

Range:

32 characters, including letters and digits.

app_name

String

Parameter description:

AOM application name.

Value range:

The value consists of letters and digits.

comp_id

String

Definition:

AOM application component ID.

Range:

32 characters, including letters and digits.

comp_name

String

Parameter description:

AOM application component name.

Value range:

The value consists of 0 to 128 characters.

domain_id

String

Definition:

Tenant ID.

Range:

32 characters, including letters and digits.

region

String

Parameter description:

Region information.

Value range:

The value consists of 1 to 256 characters.

state

String

Parameter description:

Whether the AOM application component takes effect.

Value range:

  • 0: Initialized.

  • 1: The operation is successful and takes effect.

Example Requests

Roll back a deployment based on its record ID.

https://{endpoint}/v2/tasks/a38a2d40162f4ea1aa8c7cebca0bc7f8/records/a99c6b14dbc3449384849f1e7e03ea20/rollback

{ }

Example Responses

Status code: 200

OK indicates that the rollback is successful.

{
  "id" : "a99c6b14dbc3449384849f1e7e03ea20",
  "task_id" : "a38a2d40162f4ea1aa8c7cebca0bc7f8",
  "job_name" : "job_a99c6b14dbc3449384849f1e7e03ea20_1758844038197",
  "app_component_list" : [ {
    "task_id" : "a38a2d40162f4ea1aa8c7cebca0bc7f8",
    "app_id" : "000e3dce512a459c929eb54f6f3a88ac",
    "app_name" : "App-202410302024685",
    "comp_id" : "00138c1d6f9d493597091bda6c6ae4fa",
    "comp_name" : "Service-associated component",
    "domain_id" : "ce8df55870164338a72d7e828a966a2a",
    "region" : "example-region",
    "state" : "1"
  } ]
}

Status Codes

Status Code

Description

200

OK indicates that the rollback is successful.

Error Codes

See Error Codes.