diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-08 12:09:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-08 12:09:17 +0300 |
commit | 21341457a8c422d890a9ec30838b597dea565d62 (patch) | |
tree | aa8aca2a9bce4e16936cc8d7b40aa1c79ca82e35 /doc/api/project_level_variables.md | |
parent | 0a319374e7784aa5c2d1c30dd832d2a0509edbab (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/api/project_level_variables.md')
-rw-r--r-- | doc/api/project_level_variables.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/api/project_level_variables.md b/doc/api/project_level_variables.md index fbeba9d6c7d..407e506e082 100644 --- a/doc/api/project_level_variables.md +++ b/doc/api/project_level_variables.md @@ -43,6 +43,7 @@ GET /projects/:id/variables/:key |-----------|---------|----------|-----------------------| | `id` | integer/string | yes | The ID of a project or [urlencoded NAMESPACE/PROJECT_NAME of the project](README.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). | ```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/TEST_VARIABLE_1" @@ -108,6 +109,7 @@ PUT /projects/:id/variables/:key | `protected` | boolean | no | Whether the variable is protected | | `masked` | boolean | no | Whether the variable is masked | | `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). | ```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/NEW_VARIABLE" --form "value=updated value" @@ -136,7 +138,40 @@ DELETE /projects/:id/variables/:key |-----------|---------|----------|-------------------------| | `id` | integer/string | yes | The ID of a project or [urlencoded NAMESPACE/PROJECT_NAME of the project](README.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). | ```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/VARIABLE_1" ``` + +## The `filter` parameter + +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34490) in GitLab 13.2. +> - It's deployed behind a feature flag, disabled by default. +> - It's disabled on GitLab.com. +> - To use it in GitLab self-managed instances, ask a GitLab administrator to enable it. + +This parameter is used for filtering by attributes, such as `environment_scope`. + +Example usage: + +```shell +curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/VARIABLE_1?filter[environment_scope]=production" +``` + +### Enable or disable + +[GitLab administrators with access to the GitLab Rails console](../administration/feature_flags.md) +can enable it for your instance. + +To enable it: + +```ruby +Feature.enable(:ci_variables_api_filter_environment_scope) +``` + +To disable it: + +```ruby +Feature.disable(:ci_variables_api_filter_environment_scope) +``` |