ListEnvironments - List environment details

Updated at:

Applicable editions

Central Edition, Regional Edition

Service endpoint and authorization

Product

Resource

Required permission

AppStack

environment

Read-only

Request syntax

Central Edition

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

Regional Edition

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

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

Your personal access token.

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

Request parameters

Parameter

Type

Location

Required

Description

Example

appName

string

path

Yes

The name of the application.

my-web-service

pagination

string

query

No

The pagination mode. Set to keyset to enable keyset pagination.

keyset

perPage

number

query

No

The maximum number of items to return per page.

20

orderBy

string

query

No

The property to sort the results by. For consistent traversal, use the id property.

id

sort

string

query

No

The sort order. Valid values: asc (ascending) and desc (descending). For consistent traversal, use ascending order.

desc

nextToken

string

query

No

The continuation token for keyset pagination. Omit this parameter to retrieve the first page. To retrieve subsequent pages, pass the value of nextToken from the previous response.

token

page

number

query

No

The page number to retrieve. This parameter is used for page-based pagination.

1

organizationId

string

path

  • Yes (Central Edition)

  • No (Regional Edition)

The organization ID.

ec766e63aee3437d9a51f334d6exe671

Request examples

Central Edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/appstack/organizations/ec766e63aee3437d9a51f334d6exe671/apps/my-web-service/envs?pagination=keyset&perPage=20&orderBy=id&sort=desc&nextToken=token&page=1' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Regional Edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/appstack/apps/my-web-service/envs?pagination=keyset&perPage=20&orderBy=id&sort=desc&nextToken=token&page=1' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example

-

object

The paginated response object.

current

number

The current page number. This field is returned when using page-based pagination.

1

data

array

A list of items on the current page.

-

object

An AppStack environment object.

appName

string

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

my-web-service

creatorId

string

The ID of the user who created the environment.

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

The display name of the environment.

Test Environment

gmtCreate

string

The creation timestamp of the environment.

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 is for descriptive purposes and is not used for label matching.

Test Label Key

displayValue

string

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

Test Label Value

extraMap

object

A map of extended attributes for storing custom properties on the label.

{}

name

string

The label name. Must contain only lowercase letters, digits, and hyphens (-), and must start and end with a lowercase letter or digit.

demo-label

namespace

string

The namespace of the label, which defines its scope.

default

value

string

The label value. Must contain only lowercase letters, digits, and hyphens (-), and must start and end with a lowercase letter or digit.

demo-label-value

lockBy

string

The ID of the user who is currently locking the environment.

bd9e3c6d-624f-4580-af7d-c5e26f1ed0f0

name

string

The unique name of the environment. Must contain only lowercase letters, digits, and hyphens (-), and must start and end with a lowercase letter or 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. Valid values: ConfirmFirstBatch, Auto, and Manual.

ConfirmFirstBatch

batchSteps

array

A list of batch step details.

-

object

A batch step object.

type

string

The batch step type. Valid values: WEIGHT and REPLICAS.

WEIGHT

value

string

The value of the batch step.

90

batches

string

The number of batches.

2

deployType

string

The deployment type. Valid 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 period, in milliseconds.

60000

state

string

The state of the environment. Valid 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 variable group object.

displayName

string

The display name of the variable group.

Development Variable Group

name

string

The identifier of the variable group.

dev

type

string

The type of the variable group.

GLOBAL

nextToken

string

The continuation token for keyset pagination. To retrieve the next page, pass this value in the 'nextToken' parameter of your subsequent request.

token

pages

number

The total number of pages. This field is returned when using page-based pagination.

10

perPage

number

The number of items per page. This field is returned when using page-based pagination.

10

total

number

The total number of items. This field is returned when using page-based pagination.

100

Response example

{
    "current": 1,
    "data": [
        {
            "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"
                }
            ]
        }
    ],
    "nextToken": "token",
    "pages": 10,
    "perPage": 10,
    "total": 100
}

Error codes

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