UpdateGlobalVar - Update a global variable group
Applicable version | Central, Region |
Service endpoint and authorization
- Get a service endpoint: Replace {domain} in the API request syntax.
- Get a personal access token.
- Get the organization ID: Required for Central only. Go to the Basic Information page in Organization settings to get your organization ID.
Product | Resource | Required permissions |
AppStack | global variable group | read and write |
Request syntax
Central
PUT https://{domain}/oapi/v1/appstack/organizations/{organizationId}/globalVars/{name}
Region
PUT https://{domain}/oapi/v1/appstack/globalVars/{name}
Request headers
Parameter | Type | Required | Description | Example value |
x-yunxiao-token | string | Yes | Your personal access token. | pt-0fh3****0fbG_35af****0484 |
Request parameters
Parameter | Type | In | Required | Description | Example value |
name | string | path | Yes | The name of the global variable group. | my-global-var-group |
organizationId | string | path |
| The organization ID. | ec766e63aee3437d9a51f334d6exe671 |
| - | object | body | No | The request body to update the global variable group. | |
| content | array | body | Yes | A list of variables. | |
| - | object | body | No | A variable object. | |
| 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 |
| fromRevisionSha | string | body | Yes | The SHA of the source revision. | a80102ee37cca462a23865e7a3e66ac1ca032a5c |
| message | string | body | No | The commit message for the update. | message-xxx |
Request examples
Central
curl -X 'PUT' \
'https://{domain}/oapi/v1/appstack/organizations/ec766e63aee3437d9a51f334d6exe671/globalVars/my-global-var-group' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"content": [
{
"description": "namespace",
"key": "namespace",
"value": "default"
}
],
"fromRevisionSha": "a80102ee37cca462a23865e7a3e66ac1ca032a5c",
"message": "message-xxx"
}'
Region
curl -X 'PUT' \
'https://{domain}/oapi/v1/appstack/globalVars/my-global-var-group' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"content": [
{
"description": "namespace",
"key": "namespace",
"value": "default"
}
],
"fromRevisionSha": "a80102ee37cca462a23865e7a3e66ac1ca032a5c",
"message": "message-xxx"
}'
Response parameters
Parameter | Type | Description | Example value |
| - | object | The global variable group object. | |
| content | array | The list of variables in the global variable group. | |
| - | object | A variable object. | |
| description | string | The description of the variable. | namespace |
| key | string | The key of the variable. | namespace |
| value | string | The value of the variable. | default |
| creator | string | The ID of the user who created the group. | 10df6011-2837-4fdb-ad92-356a679a60ca |
| displayName | string | The display name of the global variable group. | my-display-name |
| gmtCreate | string | The time when the group was created. | 2024-01-01 00:00:00 |
| gmtModified | string | The time when the group was last modified. | 2024-01-01 00:00:00 |
| modifier | string | The ID of the user who last modified the group. | 10df6011-2837-4fdb-ad92-356a679a60ca |
| name | string | The name of the global variable group. | my-global-var-group |
| revision | object | The revision information. | |
| author | string | The ID of the commit author. | 10df6011-2837-4fdb-ad92-356a679a60ca |
| commitTime | number | The commit time. | 1.63e+12 |
| message | string | The commit message. | message-xxxx |
| refs | array[string] | Associated references. | |
| repoMeta | object | The repository metadata. | |
| name | string | The name of the repository. | my-repo |
| type | string | The type of the repository. | VARIABLE |
| sha | string | The SHA of the revision. | a80102ee37cca462a23865e7a3e66ac1ca032a5c |
Response example
{
"content": [
{
"description": "namespace",
"key": "namespace",
"value": "default"
}
],
"creator": "10df6011-2837-4fdb-ad92-356a679a60ca",
"displayName": "my-display-name",
"gmtCreate": "2024-01-01 00:00:00",
"gmtModified": "2024-01-01 00:00:00",
"modifier": "10df6011-2837-4fdb-ad92-356a679a60ca",
"name": "my-global-var-group",
"revision": {
"author": "10df6011-2837-4fdb-ad92-356a679a60ca",
"commitTime": 1.63e+12,
"message": "message-xxxx",
"refs": [
],
"repoMeta": {
"name": "my-repo",
"type": "VARIABLE"
},
"sha": "a80102ee37cca462a23865e7a3e66ac1ca032a5c"
}
}
Error codes
For a list of error codes, see Error Code Center.