Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/project_level_variables.md')
-rw-r--r--doc/api/project_level_variables.md85
1 files changed, 46 insertions, 39 deletions
diff --git a/doc/api/project_level_variables.md b/doc/api/project_level_variables.md
index fa699c34a8a..46e491453f9 100644
--- a/doc/api/project_level_variables.md
+++ b/doc/api/project_level_variables.md
@@ -15,9 +15,9 @@ Get list of a project's variables.
GET /projects/:id/variables
```
-| Attribute | Type | Required | Description |
-| --------- | -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
-| `id` | integer/string | yes | The ID of a project or [URL-encoded NAMESPACE/PROJECT_NAME of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) |
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables"
@@ -32,7 +32,8 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a
"protected": false,
"masked": true,
"raw": false,
- "environment_scope": "*"
+ "environment_scope": "*",
+ "description": null
},
{
"variable_type": "env_var",
@@ -41,7 +42,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,11 +57,11 @@ use `filter` to select the correct `environment_scope`.
GET /projects/:id/variables/:key
```
-| Attribute | Type | Required | Description |
-| --------- | -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
-| `id` | integer/string | yes | The ID of a project or [URL-encoded NAMESPACE/PROJECT_NAME of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
-| `key` | string | yes | The `key` of a variable |
-| `filter` | hash | no | Available filters: `[environment_scope]`. See the [`filter` parameter details](#the-filter-parameter). |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) |
+| `key` | string | Yes | The `key` of a variable |
+| `filter` | hash | No | Available filters: `[environment_scope]`. See the [`filter` parameter details](#the-filter-parameter). |
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/TEST_VARIABLE_1"
@@ -73,7 +75,8 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a
"protected": false,
"masked": true,
"raw": false,
- "environment_scope": "*"
+ "environment_scope": "*",
+ "description": null
}
```
@@ -87,16 +90,17 @@ must have a different `environment_scope`. Otherwise, GitLab returns a message s
POST /projects/:id/variables
```
-| Attribute | Type | Required | Description |
-| ------------------- | -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
-| `id` | integer/string | yes | The ID of a project or [URL-encoded NAMESPACE/PROJECT_NAME of the project](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. Default: `false` |
-| `masked` | boolean | no | Whether the variable is masked. Default: `false` |
-| `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` | string | no | The `environment_scope` of the variable. Default: `*` |
+| Attribute | Type | Required | Description |
+|---------------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](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. Default: `false` |
+| `masked` | boolean | No | Whether the variable is masked. Default: `false` |
+| `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` | string | No | The `environment_scope` of the variable. Default: `*` |
+| `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 POST --header "PRIVATE-TOKEN: <your_access_token>" \
@@ -111,7 +115,8 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
"protected": false,
"masked": false,
"raw": false,
- "environment_scope": "*"
+ "environment_scope": "*",
+ "description": null
}
```
@@ -124,17 +129,18 @@ use `filter` to select the correct `environment_scope`.
PUT /projects/:id/variables/:key
```
-| Attribute | Type | Required | Description |
-| ------------------- | -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
-| `id` | integer/string | yes | The ID of a project or [URL-encoded NAMESPACE/PROJECT_NAME of the project](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` | string | no | The `environment_scope` of the variable |
-| `filter` | hash | no | Available filters: `[environment_scope]`. See the [`filter` parameter details](#the-filter-parameter). |
+| Attribute | Type | Required | Description |
+|---------------------|----------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](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` | string | No | The `environment_scope` of the variable |
+| `filter` | hash | No | Available filters: `[environment_scope]`. See the [`filter` parameter details](#the-filter-parameter). |
+| `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>" \
@@ -149,7 +155,8 @@ curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
"protected": true,
"masked": false,
"raw": false,
- "environment_scope": "*"
+ "environment_scope": "*",
+ "description": "null"
}
```
@@ -162,11 +169,11 @@ use `filter` to select the correct `environment_scope`.
DELETE /projects/:id/variables/:key
```
-| Attribute | Type | Required | Description |
-| --------- | -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
-| `id` | integer/string | yes | The ID of a project or [URL-encoded NAMESPACE/PROJECT_NAME of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
-| `key` | string | yes | The `key` of a variable |
-| `filter` | hash | no | Available filters: `[environment_scope]`. See the [`filter` parameter details](#the-filter-parameter). |
+| Attribute | Type | Required | Description |
+|-----------|----------------|----------|-------------|
+| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) |
+| `key` | string | Yes | The `key` of a variable |
+| `filter` | hash | No | Available filters: `[environment_scope]`. See the [`filter` parameter details](#the-filter-parameter). |
```shell
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/VARIABLE_1"