debian-mirror-gitlab/doc/api/experiments.md

79 lines
2.1 KiB
Markdown
Raw Normal View History

2021-01-03 14:25:43 +05:30
---
stage: Growth
group: Expansion
2021-02-22 17:27:13 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2021-01-03 14:25:43 +05:30
---
# Experiments API
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/262725) in GitLab 13.5.
2021-01-29 00:20:46 +05:30
This API is for listing A/B experiments [defined in GitLab](../development/experiment_guide/index.md).
2021-01-03 14:25:43 +05:30
2021-01-29 00:20:46 +05:30
The user must be a [GitLab team member](https://gitlab.com/groups/gitlab-com/-/group_members) to access the API.
2021-01-03 14:25:43 +05:30
## List all experiments
2021-01-29 00:20:46 +05:30
Get a list of all experiments. Each experiment has an `enabled` status that indicates whether the experiment is enabled globally, or only in specific contexts.
2021-01-03 14:25:43 +05:30
```plaintext
GET /experiments
```
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/experiments"
```
Example response:
```json
[
2021-10-27 15:23:28 +05:30
{
"key": "code_quality_walkthrough",
"definition": {
"name": "code_quality_walkthrough",
"introduced_by_url": "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/58900",
"rollout_issue_url": "https://gitlab.com/gitlab-org/gitlab/-/issues/327229",
"milestone": "13.12",
"type": "experiment",
"group": "group::activation",
"default_enabled": false
2021-01-03 14:25:43 +05:30
},
2021-10-27 15:23:28 +05:30
"current_status": {
"state": "conditional",
"gates": [
{
"key": "boolean",
"value": false
},
{
"key": "percentage_of_actors",
"value": 25
}
]
2021-01-03 14:25:43 +05:30
}
2021-10-27 15:23:28 +05:30
},
{
"key": "ci_runner_templates",
"definition": {
"name": "ci_runner_templates",
"introduced_by_url": "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/58357",
"rollout_issue_url": "https://gitlab.com/gitlab-org/gitlab/-/issues/326725",
"milestone": "14.0",
"type": "experiment",
"group": "group::activation",
"default_enabled": false
},
"current_status": {
"state": "off",
"gates": [
{
"key": "boolean",
"value": false
}
]
}
}
2021-01-03 14:25:43 +05:30
]
```