feat: add all safe experiments to the deployment page (#10276)

* added new option table type for experiments

* added tests

* fixed go tests

* added go test for new param

* removing query change

* clearing ExperimentsAll

* dont mutate ExperimentsAll

* added new route for safe experiments

* added new route for safe experiments

* added test for new route

* PR feedback

* altered design

* alias children
This commit is contained in:
Kira Pilot
2023-10-17 14:49:19 -04:00
committed by GitHub
parent 35f9e2ef7f
commit 1656249e07
17 changed files with 360 additions and 39 deletions

41
docs/api/general.md generated
View File

@ -535,7 +535,7 @@ curl -X GET http://coder-server:8080/api/v2/deployment/stats \
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Get experiments
## Get enabled experiments
### Code samples
@ -562,7 +562,44 @@ curl -X GET http://coder-server:8080/api/v2/experiments \
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Experiment](schemas.md#codersdkexperiment) |
<h3 id="get-experiments-responseschema">Response Schema</h3>
<h3 id="get-enabled-experiments-responseschema">Response Schema</h3>
Status Code **200**
| Name | Type | Required | Restrictions | Description |
| -------------- | ----- | -------- | ------------ | ----------- |
| `[array item]` | array | false | | |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Get safe experiments
### Code samples
```shell
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/experiments/available \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
`GET /experiments/available`
### Example responses
> 200 Response
```json
["moons"]
```
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Experiment](schemas.md#codersdkexperiment) |
<h3 id="get-safe-experiments-responseschema">Response Schema</h3>
Status Code **200**