diff options
Diffstat (limited to 'doc/api/group_level_variables.md')
-rw-r--r-- | doc/api/group_level_variables.md | 81 |
1 files changed, 43 insertions, 38 deletions
diff --git a/doc/api/group_level_variables.md b/doc/api/group_level_variables.md index 921a9922c9b..08fb9e55f32 100644 --- a/doc/api/group_level_variables.md +++ b/doc/api/group_level_variables.md @@ -6,8 +6,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w # Group-level Variables API **(FREE)** -> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/34519) in GitLab 9.5 - ## List group variables Get list of a group's variables. @@ -16,9 +14,9 @@ Get list of a group's variables. GET /groups/:id/variables ``` -| Attribute | Type | required | Description | -|-----------|---------|----------|---------------------| -| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) owned by the authenticated user | +| Attribute | Type | Required | Description | +|-----------|----------------|----------|-------------| +| `id` | integer/string | Yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) | ```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/variables" @@ -33,7 +31,8 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a "protected": false, "masked": false, "raw": false, - "environment_scope": "*" + "environment_scope": "*", + "description": null }, { "key": "TEST_VARIABLE_2", @@ -42,7 +41,8 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a "protected": false, "masked": false, "raw": false, - "environment_scope": "*" + "environment_scope": "*", + "description": null } ] ``` @@ -55,10 +55,10 @@ Get the details of a group's specific variable. GET /groups/:id/variables/:key ``` -| Attribute | Type | required | Description | -|-----------|---------|----------|-----------------------| -| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) owned by the authenticated user | -| `key` | string | yes | The `key` of a variable | +| Attribute | Type | Required | Description | +|-----------|----------------|----------|-------------| +| `id` | integer/string | Yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) | +| `key` | string | Yes | The `key` of a variable | ```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/variables/TEST_VARIABLE_1" @@ -72,7 +72,8 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a "protected": false, "masked": false, "raw": false, - "environment_scope": "*" + "environment_scope": "*", + "description": null } ``` @@ -84,16 +85,17 @@ Create a new variable. POST /groups/:id/variables ``` -| Attribute | Type | required | Description | -|-----------------|---------|----------|-----------------------| -| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) owned by the authenticated user | -| `key` | string | yes | The `key` of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9`, and `_` are allowed | -| `value` | string | yes | The `value` of a variable | -| `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file` | -| `protected` | boolean | no | Whether the variable is protected | -| `masked` | boolean | no | Whether the variable is masked | -| `raw` | boolean | no | Whether the variable is treated as a raw string. Default: `false`. When `true`, variables in the value are not [expanded](../ci/variables/index.md#prevent-cicd-variable-expansion). | -| `environment_scope` **(PREMIUM)** | string | no | The [environment scope](../ci/environments/index.md#limit-the-environment-scope-of-a-cicd-variable) of a variable | +| Attribute | Type | Required | Description | +|-----------------------------------|----------------|----------|-------------| +| `id` | integer/string | Yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) | +| `key` | string | Yes | The `key` of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9`, and `_` are allowed | +| `value` | string | Yes | The `value` of a variable | +| `variable_type` | string | No | The type of a variable. Available types are: `env_var` (default) and `file` | +| `protected` | boolean | No | Whether the variable is protected | +| `masked` | boolean | No | Whether the variable is masked | +| `raw` | boolean | No | Whether the variable is treated as a raw string. Default: `false`. When `true`, variables in the value are not [expanded](../ci/variables/index.md#prevent-cicd-variable-expansion). | +| `environment_scope` **(PREMIUM)** | string | No | The [environment scope](../ci/environments/index.md#limit-the-environment-scope-of-a-cicd-variable) of a variable | +| `description` | string | No | The `description` of the variable. Default: `null` | ```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \ @@ -108,7 +110,8 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \ "protected": false, "masked": false, "raw": false, - "environment_scope": "*" + "environment_scope": "*", + "description": null } ``` @@ -120,16 +123,17 @@ Update a group's variable. PUT /groups/:id/variables/:key ``` -| Attribute | Type | required | Description | -|-----------------|---------|----------|-------------------------| -| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) owned by the authenticated user | -| `key` | string | yes | The `key` of a variable | -| `value` | string | yes | The `value` of a variable | -| `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file` | -| `protected` | boolean | no | Whether the variable is protected | -| `masked` | boolean | no | Whether the variable is masked | -| `raw` | boolean | no | Whether the variable is treated as a raw string. Default: `false`. When `true`, variables in the value are not [expanded](../ci/variables/index.md#prevent-cicd-variable-expansion). | -| `environment_scope` **(PREMIUM)** | string | no | The [environment scope](../ci/environments/index.md#limit-the-environment-scope-of-a-cicd-variable) of a variable | +| Attribute | Type | Required | Description | +|-----------------------------------|----------------|----------|-------------| +| `id` | integer/string | Yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) | +| `key` | string | Yes | The `key` of a variable | +| `value` | string | Yes | The `value` of a variable | +| `variable_type` | string | No | The type of a variable. Available types are: `env_var` (default) and `file` | +| `protected` | boolean | No | Whether the variable is protected | +| `masked` | boolean | No | Whether the variable is masked | +| `raw` | boolean | No | Whether the variable is treated as a raw string. Default: `false`. When `true`, variables in the value are not [expanded](../ci/variables/index.md#prevent-cicd-variable-expansion). | +| `environment_scope` **(PREMIUM)** | string | No | The [environment scope](../ci/environments/index.md#limit-the-environment-scope-of-a-cicd-variable) of a variable | +| `description` | string | No | The description of the variable. Default: `null`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/409641) in GitLab 16.2. | ```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \ @@ -144,7 +148,8 @@ curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \ "protected": true, "masked": true, "raw": true, - "environment_scope": "*" + "environment_scope": "*", + "description": null } ``` @@ -156,10 +161,10 @@ Remove a group's variable. DELETE /groups/:id/variables/:key ``` -| Attribute | Type | required | Description | -|-----------|---------|----------|-------------------------| -| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) owned by the authenticated user | -| `key` | string | yes | The `key` of a variable | +| Attribute | Type | Required | Description | +|-----------|----------------|----------|-------------| +| `id` | integer/string | Yes | The ID of a group or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) | +| `key` | string | Yes | The `key` of a variable | ```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" \ |