UpdateVariableGroup - Update a variable group

Updated at:

Applicable versions

Central and Region editions

Endpoints and authorization information

  • Obtain an endpoint. Replace {domain} in the API request syntax.
  • Obtain a personal access token.
  • Obtain the organization ID: Required only for the Central edition. Go to the Basic Information page in the Tenant Management console to obtain the organization ID.

Product

Resource

Required permission

Application Delivery

Variable group

Read/Write

Request syntax

Central edition

PUT https://{domain}/oapi/v1/appstack/organizations/{organizationId}/apps/{appName}/variableGroup/{variableGroupName}

Region edition

PUT https://{domain}/oapi/v1/appstack/apps/{appName}/variableGroup/{variableGroupName}

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

variableGroupName

string

path

Yes

Variable group name.

dev

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

Organization ID.

ec766e63aee3437d9a51f334d6exe671

-

object

body

No

Variable group model.

branchName

string

body

No

The version branch. Default: master.

master

displayName

string

body

No

The display name of the variable group.

dev

fromRevisionSha

string

body

Yes

The version number of the variable group.

1.0.0

message

string

body

No

The description of the variable group.

message

name

string

body

No

The unique name of the variable group.

dev

vars

array

body

No

A list of variables.

-

object

body

No

Variable model.

description

string

body

No

The description of the variable.

namespace

key

string

body

No

The key of the variable.

namespace

value

string

body

No

The value of the variable.

default

Request examples

Central edition

curl -X 'PUT' \
  'https://{domain}/oapi/v1/appstack/organizations/ec766e63aee3437d9a51f334d6exe671/apps/my-web-service/variableGroup/dev' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "branchName": "master",
        "displayName": "dev",
        "fromRevisionSha": "1.0.0",
        "message": "message",
        "name": "dev",
        "vars": [
            {
                "description": "namespace",
                "key": "namespace",
                "value": "default"
            }
        ]
    }'

Region edition

curl -X 'PUT' \
  'https://{domain}/oapi/v1/appstack/apps/my-web-service/variableGroup/dev' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "branchName": "master",
        "displayName": "dev",
        "fromRevisionSha": "1.0.0",
        "message": "message",
        "name": "dev",
        "vars": [
            {
                "description": "namespace",
                "key": "namespace",
                "value": "default"
            }
        ]
    }'

Response parameters

Parameter

Type

Description

Example value

-

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

Version information.

author

string

Submitter

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

commitTime

number

The commit time.

1.63e+12

message

string

The commit message.

message-xxxx

refs

array[string]

Associated information.

repoMeta

object

Repository information.

name

string

Repository name.

my-repo

type

string

Repository type.

VARIABLE

sha

string

The SHA value of the version.

a80102ee37cca462a23865e7a3e66ac1ca032a5c

type

string

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

GLOBAL

vars

array

A list of variables.

-

object

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, see the Error Code Center.