UnLockEnv - Unlock environment

Updated at:

Editions

Centralized Edition, Regional Edition

Endpoints and authorization

  • Obtain the endpoint: Replace the {domain} placeholder in the API request syntax.
  • Obtain a personal access token.
  • Obtain the organizationId from the Basic Information page in the organization admin console. This parameter is required for the Centralized Edition only.

Product

Resource

Permissions

application delivery

environment

Read and write

Request syntax

Centralized Edition

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

Regional Edition

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

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

The personal access token.

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

Request parameters

Parameter

Type

In

Required

Description

Example

appName

string

path

Yes

The application name.

my-web-service

envName

string

path

Yes

The environment name.

dev

organizationId

string

path

  • Yes: Centralized Edition

  • No: Regional Edition

The organization ID.

ec766e63aee3437d9a51f334d6exe671

Request examples

Centralized Edition

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

Regional Edition

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

Response parameters

Parameter

Type

Description

Example

-

object

The AppStack environment object.

appName

string

The unique name of the application to which the environment belongs.

my-web-service

creatorId

string

The user ID of the environment creator.

bd9e3c6d-624f-4580-af7d-c5e26f1ed0f0

deployGroupName

string

The unique name of the deployment group.

k8s-dev

description

string

The description of the environment.

This is a development environment for demonstration purposes.

descriptiveName

string

Test Environment

gmtCreate

string

The time when the environment was created.

2024-09-01 00:00:00

labelList

array

A list of labels.

-

object

An AppStack label object.

displayName

string

The display name of the label. This name is for descriptive purposes only and is not used for matching.

Test Label Key

displayValue

string

The display value of the label. This value is for descriptive purposes only and is not used for matching.

Test Label Value

extraMap

object

A map of extended attributes for the label. You can use this to store custom fields when defining the label.

{}

name

string

The name of the label. The name can contain only lowercase letters, hyphens (-), and digits, and must begin and end with a lowercase letter or a digit.

demo-label

namespace

string

The namespace of the label, which determines its scope.

default

value

string

The value of the label. The value can contain only lowercase letters, hyphens (-), and digits, and must begin and end with a lowercase letter or a digit.

demo-label-value

lockBy

string

The ID of the user who locked the environment.

bd9e3c6d-624f-4580-af7d-c5e26f1ed0f0

name

string

The unique name of the environment. The name can contain only lowercase letters, hyphens (-), and digits, and must begin and end with a lowercase letter or a digit.

dev

replicasManagement

string

The replica management mode.

USER

resourcePoolName

string

The unique name of the resource pool.

default

rolloutStrategies

array

A list of rollout strategies.

-

object

A rollout strategy object.

batchMode

string

The batch mode. Possible values: ConfirmFirstBatch, Auto, and Manual.

ConfirmFirstBatch

batchSteps

array

A list of batch step details.

-

object

Details of a batch step.

type

string

The batch type. Possible values: WEIGHT and REPLICAS.

WEIGHT

value

string

The value for the batch step.

90

batches

string

The number of batches.

2

deployType

string

The deployment type. Possible values: Rolling, Batch, and Recreate.

Batch

locator

string

The deployment resource locator.

aaa.bbb.ccc

targetReplicas

number

The target number of replicas.

3

timeOutMS

number

The timeout duration, in milliseconds.

60000

state

string

The status of the environment. Possible values: NEW, DEPLOYING, RUNNING, and ERROR.

RUNNING

variableGroupName

string

The unique name of the variable group.

dev

variableGroups

array

A list of variable groups.

-

object

A generic variable group object.

displayName

string

The display name of the variable group.

Development Variable Group

name

string

The variable group identifier.

dev

type

string

The 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": "Test Environment",
    "gmtCreate": "2024-09-01 00:00:00",
    "labelList": [
        {
            "displayName": "Test Label Key",
            "displayValue": "Test Label 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": "RUNNING",
    "variableGroupName": "dev",
    "variableGroups": [
        {
            "displayName": "Development Variable Group",
            "name": "dev",
            "type": "GLOBAL"
        }
    ]
}

Error codes

For a list of API error codes, see the Error Code Center.