CreateChangeOrder - Create a deployment order

Updated at:

Applicable versions

Central version, Region version

Endpoint and authorization information

  • Get the endpoint: Replace {domain} in the API request syntax.
  • Get a personal access token.
  • Obtain organizationId: Required only for the Central version. Go to the Basic Information page in the Organization Management console to retrieve your organization ID.

Product

Resource

Required permission

Application Delivery

Deployment order

Read and write

Request syntax

Central version

POST https://{domain}/oapi/v1/appstack/organizations/{organizationId}/apps/{appName}/changeOrders

Region version

POST https://{domain}/oapi/v1/appstack/apps/{appName}/changeOrders

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example value

appName

string

path

Yes

Application name.

my-web-service

organizationId

string

path

  • Yes: Central version

  • No: Region version

Organization ID.

ec766e63aee3437d9a51f334d6exe671

-

object

body

No

Create deployment order request.

changeOrderName

string

body

Yes

Deployment order name.

20240201161127-deployment

deploymentChangedCheck

boolean

body

No

Whether to block this release if it adds or deletes a Deployment. Default is true.

true

description

string

body

No

Description.

This is a description.

envs

object

body

Yes

Environment context. The key is the environment name, and the value contains deployment order parameters for that environment (single-environment deployment only).

{
"test": {
"values": {
"appName": "my-web-service",
"cpuLimit": "1",
"cpuRequest": "0.01",
"envName": "test",
"image.backend": "nginx",
"memoryLimit": "1024Mi",
"memoryRequest": "32Mi",
"namespace": "default"
}
}
}





































orchestrationRevisionSha

string

body

No

Orchestration revision SHA value. Required when the deployment order type is Deploy.

94c50c64ccf2e966f1b37ef422db8136772039bc

rollbackChangeOrderVersion

string

body

No

Required when the deployment order type is Rollback. Specifies the deployment version number to use for rollback.

20241120175852-177

type

string

body

Yes

Deployment order type: Deploy—deploy, Scale—scale, Rollback—rollback, Destroy—destroy resources.

Deploy

Request examples

Central version

curl -X 'POST' \
  'https://{domain}/oapi/v1/appstack/organizations/ec766e63aee3437d9a51f334d6exe671/apps/my-web-service/changeOrders' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "changeOrderName": "20240201161127-deployment",
        "deploymentChangedCheck": true,
        "description": "This is a description.",
        "envs": {
            "test": {
                "values": {
                    "appName": "my-web-service",
                    "cpuLimit": "1",
                    "cpuRequest": "0.01",
                    "envName": "test",
                    "image.backend": "nginx",
                    "memoryLimit": "1024Mi",
                    "memoryRequest": "32Mi",
                    "namespace": "default"
                }
            }
        },
        "orchestrationRevisionSha": "94c50c64ccf2e966f1b37ef422db8136772039bc",
        "rollbackChangeOrderVersion": "20241120175852-177",
        "type": "Deploy"
    }'

Region version

curl -X 'POST' \
  'https://{domain}/oapi/v1/appstack/apps/my-web-service/changeOrders' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "changeOrderName": "20240201161127-deployment",
        "deploymentChangedCheck": true,
        "description": "This is a description.",
        "envs": {
            "test": {
                "values": {
                    "appName": "my-web-service",
                    "cpuLimit": "1",
                    "cpuRequest": "0.01",
                    "envName": "test",
                    "image.backend": "nginx",
                    "memoryLimit": "1024Mi",
                    "memoryRequest": "32Mi",
                    "namespace": "default"
                }
            }
        },
        "orchestrationRevisionSha": "94c50c64ccf2e966f1b37ef422db8136772039bc",
        "rollbackChangeOrderVersion": "20241120175852-177",
        "type": "Deploy"
    }'

Response parameters

Parameter

Type

Description

Example value

-

object

creator

string

Creator.

10df6011-2837-4fdb-ad92-356a679a60ca

description

string

Description.

Normal publishing of routine requirements

endedAt

string

Deployment order end time.

2024-10-08T09:11:38Z

gmtCreate

string

Last modification time of the deployment order.

2024-10-08T09:11:38Z

jobs

array

List of environment deployment orders.

-

object

Summary of an environment deployment order.

envName

string

Environment name.

sn

string

Job serial number.

state

string

Job state.

name

string

Deployment name.

20241008171130-deployment

sn

string

Unique identifier of the deployment order.

bc62b3e953714aa8be431f47b9c9b72a

startedAt

string

Deployment order start time.

2024-10-08T09:11:38Z

state

string

Deployment order state. Possible values: [INIT PREPARING RUNNING SUSPENDED CANCELED SUCCESS FAILED].

Operation type: RUNNING—running, SUSPENDED—paused, CANCELED—canceled, FAILED—failed, SUCCESS—successful

type

string

Deployment order type. Possible values: [Deploy Scale Rollback Destroy].

Operation type: Deploy—deploy, Scale—scale, Rollback—rollback, Destroy—destroy

version

string

Version used.

20241008171130-762

Response example

{
    "creator": "10df6011-2837-4fdb-ad92-356a679a60ca",
    "description": "Normal daily release requirement",
    "endedAt": "2024-10-08T09:11:38Z",
    "gmtCreate": "2024-10-08T09:11:38Z",
    "jobs": [
        {
            "envName": "",
            "sn": "",
            "state": ""
        }
    ],
    "name": "20241008171130-deployment",
    "sn": "bc62b3e953714aa8be431f47b9c9b72a",
    "startedAt": "2024-10-08T09:11:38Z",
    "state": "Operation type: RUNNING—running, SUSPENDED—paused, CANCELED—canceled, FAILED—failed, SUCCESS—successful",
    "type": "Operation type: Deploy—deploy, Scale—scale, Rollback—rollback, Destroy—destroy",
    "version": "20241008171130-762"
}

Error codes

Visit the Error Code Center to view API-related error codes.