GetEnvVariableGroups - Find details of variable groups attached to an environment

Updated at:

Applicable versions

Central Edition, Region Edition

Endpoint and authorization information

  • Obtain an endpoint. Use the endpoint to replace {domain} in the API request syntax.
  • Obtain a personal access token.
  • Obtain an organizationId. This parameter is required only for the Central Edition. You can obtain the organization ID on the Basic Information page in the Organization Management console.

Product

Resource

Required permission

Application Delivery

Variable group

Read-only

Request syntax

Central Edition

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

Region Edition

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

Request header

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

Personal access token.

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

Request parameters

Parameter

Type

Position

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: Central Edition

  • No: Region Edition

The organization ID.

ec766e63aee3437d9a51f334d6exe671

Request examples

Central Edition

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

Region Edition

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

Response parameters

Parameter

Type

Description

Example

-

array

-

object

The version record of the variable group.

displayName

string

The display name of the variable group.

dev-xxxx

name

string

The name of the variable group.

dev

revision

object

The version information.

author

string

The user who submitted the version.

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

commitTime

number

The time when the version was submitted.

1.63e+12

message

string

The commit message for the version.

message-xxxx

refs

array[string]

The association information.

repoMeta

object

Repository information

name

string

The repository name.

my-repo

type

string

The repository type.

VARIABLE

sha

string

The SHA value of the version.

a80102ee37cca462a23865e7a3e66ac1ca032a5c

type

string

The type. Valid values: GLOBAL, TEMPLATE, and APP.

GLOBAL

vars

array

The list of variables.

-

object

The variable model.

description

string

The description of the variable.

namespace

key

string

The key of the variable.

namespace

value

string

The value of the variable.

default

Response example

[
    {
        "displayName": "dev-xxxx",
        "name": "dev",
        "revision": {
            "author": "10df6011-2837-4fdb-ad92-356a679a60ca",
            "commitTime": 1.63e+12,
            "message": "message-xxxx",
            "refs": [
                
            ],
            "repoMeta": {
                "name": "my-repo",
                "type": "VARIABLE"
            },
            "sha": "a80102ee37cca462a23865e7a3e66ac1ca032a5c"
        },
        "type": "GLOBAL",
        "vars": [
            {
                "description": "namespace",
                "key": "namespace",
                "value": "default"
            }
        ]
    }
]

Error codes

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