DeleteEnv - Delete environment

Updated at:

Applicable versions

Central version, Region version

Endpoint and authorization information

  • Obtain the endpoint to replace {domain} in the API request syntax.
  • Obtain a personal access token.
  • Obtain the organization ID. This is required for the Central version only. You can obtain your organization ID from the Basic Information page in the Organization Management console.

Product

Resource

Required permission

Application Delivery

Environment

Read and write

Request syntax

Central version

DELETE https://{domain}/oapi/v1/appstack/organizations/{organizationId}/apps/{appName}/envs/{envName}

Region version

DELETE https://{domain}/oapi/v1/appstack/apps/{appName}/envs/{envName}

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

envName

string

path

Yes

Environment name.

dev

organizationId

string

path

  • Yes: Central version

  • No: Region version

Organization ID.

ec766e63aee3437d9a51f334d6exe671

Request examples

Central version

curl -X 'DELETE' \
  'https://{domain}/oapi/v1/appstack/organizations/ec766e63aee3437d9a51f334d6exe671/apps/my-web-service/envs/dev' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region version

curl -X 'DELETE' \
  'https://{domain}/oapi/v1/appstack/apps/my-web-service/envs/dev' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example value

-

object

AppStack environment model.

appName

string

Unique name of the application to which the environment belongs.

my-web-service

creatorId

string

User ID of the environment creator.

bd9e3c6d-624f-4580-af7d-c5e26f1ed0f0

deployGroupName

string

Unique name of the deployment group.

k8s-dev

description

string

Environment description.

This is a development environment for demonstration purposes.

descriptiveName

string

Display name of the environment.

Staging environment

gmtCreate

string

Environment creation time.

2024-09-01 00:00:00

labelList

array

List of tags.

-

object

AppStack tag.

displayName

string

Display name of the tag. Used for descriptive purposes only and not used in tag matching.

Demo tag key

displayValue

string

Display value of the tag. Used for descriptive purposes only and not used in tag matching.

Test tag value

extraMap

object

Map of extended tag properties. You can store custom extension fields when defining a tag.

{}

name

string

Tag name. Must contain only lowercase letters, hyphens, and digits, and must start and end with a lowercase letter or digit.

demo-label

namespace

string

Tag namespace. Determines the scope of the tag.

default

value

string

Tag value. Must contain only lowercase letters, hyphens, and digits, and must start and end with a lowercase letter or digit.

demo-label-value

lockBy

string

User ID of the user currently locking the environment.

bd9e3c6d-624f-4580-af7d-c5e26f1ed0f0

name

string

Unique environment name. Must contain only lowercase letters, hyphens, and digits, and must start and end with a lowercase letter or digit.

dev

replicasManagement

string

Replica management mode.

USER

resourcePoolName

string

Unique name of the resource pool.

default

rolloutStrategies

array

Deployment strategies.

-

object

Deployment strategy.

batchMode

string

Batch mode. Possible values: [ConfirmFirstBatch Auto Manual].

ConfirmFirstBatch

batchSteps

array

List of batch details.

-

object

Batch detail.

type

string

Batch type. Possible values: [WEIGHT REPLICAS].

WEIGHT

value

string

Batch value.

90

batches

string

Number of batches.

2

deployType

string

Deployment type. Possible values: [Rolling Batch Recreate].

Batch

locator

string

Deployment resource coordinate.

aaa.bbb.ccc

targetReplicas

number

Target number of replicas.

3

timeOutMS

number

Timeout duration.

60000

state

string

Environment state. Possible values: [NEW DEPLOYING RUNNING ERROR].

my-web-service

variableGroupName

string

Unique name of the variable group.

dev

variableGroups

array

Variable groups.

-

object

Generic variable group model.

displayName

string

Display name of the variable group.

Development variable group

name

string

Variable group identifier.

dev

type

string

Variable group type.

GLOBAL

Response example

{
    "appName": "my-web-service",
    "creatorId": "bd9e3c6d-624f-4580-af7d-c5e26f1ed0f0",
    "deployGroupName": "k8s-dev",
    "description": "This is a development environment for demonstration purposes.",
    "descriptiveName": "Staging environment",
    "gmtCreate": "2024-09-01 00:00:00",
    "labelList": [
        {
            "displayName": "Demo tag key",
            "displayValue": "Demo tag value",
            "extraMap": {},
            "name": "demo-label",
            "namespace": "default",
            "value": "demo-label-value"
        }
    ],
    "lockBy": "bd9e3c6d-624f-4580-af7d-c5e26f1ed0f0",
    "name": "dev",
    "replicasManagement": "USER",
    "resourcePoolName": "default",
    "rolloutStrategies": [
        {
            "batchMode": "ConfirmFirstBatch",
            "batchSteps": [
                {
                    "type": "WEIGHT",
                    "value": "90"
                }
            ],
            "batches": "2",
            "deployType": "Batch",
            "locator": "aaa.bbb.ccc",
            "targetReplicas": 3,
            "timeOutMS": 60000
        }
    ],
    "state": "my-web-service",
    "variableGroupName": "dev",
    "variableGroups": [
        {
            "displayName": "Development variable group",
            "name": "dev",
            "type": "GLOBAL"
        }
    ]
}

Error codes

For information about API-related error codes, see the Error Code Center.