Skip to content

Commit

Permalink
docs(chore): improve syntax highlighting and formatting of code bits
Browse files Browse the repository at this point in the history
Use `bash` instead of `sh` for nicer highlighting by prism.

I've also broken large json blobs over multiple lines.
  • Loading branch information
thomasheartman committed Mar 3, 2022
1 parent d264f30 commit f92d860
Showing 1 changed file with 65 additions and 30 deletions.
95 changes: 65 additions & 30 deletions website/docs/api/admin/feature-toggles-api-v2.md
Expand Up @@ -24,7 +24,10 @@ This endpoint will give you an general overview of a project. It will return ess

**Example Query**

`http GET http://localhost:4242/api/admin/projects/default Authorization:$KEY`
```bash
http GET http://localhost:4242/api/admin/projects/default Authorization:$KEY
```



**Example response:**
Expand Down Expand Up @@ -90,7 +93,11 @@ This endpoint will return all feature toggles and high level environment details

**Example Query**

`http GET http://localhost:4242/api/admin/projects/default/features Authorization:$KEY`
``` bash
http GET http://localhost:4242/api/admin/projects/default/features \
Authorization:$KEY
```



**Example response:**
Expand Down Expand Up @@ -162,7 +169,8 @@ This endpoint accepts the following toggle options:

```bash
echo '{"name": "demo2", "description": "A new feature toggle"}' | \
http POST http://localhost:4242/api/admin/projects/default/features Authorization:$KEY`
http POST http://localhost:4242/api/admin/projects/default/features \
Authorization:$KEY`
```


Expand Down Expand Up @@ -205,8 +213,9 @@ This endpoint will return the feature toggles with the defined name and _project

**Example Query**

```sh
http GET http://localhost:4242/api/admin/projects/default/features/demo Authorization:$KEY`
```bash
http GET http://localhost:4242/api/admin/projects/default/features/demo \
Authorization:$KEY`
```

**Example response:**
Expand Down Expand Up @@ -256,8 +265,10 @@ This endpoint will accept HTTP PUT request to update the feature toggle metadata

**Example Query**

```sh
echo '{"name": "demo", "description": "An update feature toggle", "type": "kill-switch"}' | http PUT http://localhost:4242/api/admin/projects/default/features/demo Authorization:$KEY`
```bash
echo '{"name": "demo", "description": "An update feature toggle", "type": "kill-switch"}' | \
http PUT http://localhost:4242/api/admin/projects/default/features/demo \
Authorization:$KEY`
```


Expand Down Expand Up @@ -291,8 +302,10 @@ This endpoint will accept HTTP PATCH request to update the feature toggle metada

**Example Query**

```sh
echo '[{"op": "replace", "path": "/description", "value": "patched desc"}]' | http PATCH http://localhost:4242/api/admin/projects/default/features/demo Authorization:$KEY`
```bash
echo '[{"op": "replace", "path": "/description", "value": "patched desc"}]' | \
http PATCH http://localhost:4242/api/admin/projects/default/features/demo \
Authorization:$KEY`
```


Expand Down Expand Up @@ -327,8 +340,10 @@ This endpoint will accept HTTP POST request to clone an existing feature toggle

**Example Query**

```sh
echo '{ "name": "newName" }' | http POST http://localhost:4242/api/admin/projects/default/features/Demo/clone Authorization:$KEY`
```bash
echo '{ "name": "newName" }' | \
http POST http://localhost:4242/api/admin/projects/default/features/Demo/clone \
Authorization:$KEY`
```


Expand Down Expand Up @@ -379,21 +394,21 @@ This endpoint will accept HTTP PUT request to update the feature toggle metadata

**Example Query**

```sh
http DELETE http://localhost:4242/api/admin/projects/default/features/demo Authorization:$KEY`
```bash
http DELETE http://localhost:4242/api/admin/projects/default/features/demo \
Authorization:$KEY`
```


**Example response:**

```sh
```
HTTP/1.1 202 Accepted
Access-Control-Allow-Origin: *
Connection: keep-alive
Date: Wed, 08 Sep 2021 20:09:21 GMT
Keep-Alive: timeout=60
Transfer-Encoding: chunked

```


Expand All @@ -405,9 +420,17 @@ This endpoint will allow you to add a new strategy to a feature toggle in a give

**Example Query**

```sh
echo '{"name": "flexibleRollout", "parameters": { "rollout": 20, "groupId": "demo", "stickiness": "default" }}' | \
http POST http://localhost:4242/api/admin/projects/default/features/demo/environments/production/strategies Authorization:$KEY
```bash
echo '{"name": "flexibleRollout",
"parameters": {
"rollout": 20,
"groupId": "demo",
"stickiness": "default"
}
}' | \
http POST \
http://localhost:4242/api/admin/projects/default/features/demo/environments/production/strategies \
Authorization:$KEY
```

**Example response:**
Expand All @@ -429,9 +452,17 @@ This endpoint will allow you to add a new strategy to a feature toggle in a give

**Example Query**

```sh
echo '{"name": "flexibleRollout", "parameters": { "rollout": 25, "groupId": "demo","stickiness": "default" }}' | \
http PUT http://localhost:4242/api/admin/projects/default/features/demo/environments/production/strategies/77bbe972-ffce-49b2-94d9-326593e2228e Authorization:$KEY
```bash
echo '{"name": "flexibleRollout",
"parameters": {
"rollout": 25,
"groupId": "demo",
"stickiness": "default"
}
}' | \
http PUT \
http://localhost:4242/api/admin/projects/default/features/demo/environments/production/strategies/77bbe972-ffce-49b2-94d9-326593e2228e \
Authorization:$KEY
```

**Example response:**
Expand All @@ -453,9 +484,11 @@ http PUT http://localhost:4242/api/admin/projects/default/features/demo/environm

**Example Query**

```sh
```bash
echo '[{"op": "replace", "path": "/parameters/rollout", "value": 50}]' | \
http PATCH http://localhost:4242/api/admin/projects/default/features/demo/environments/production/strategies/ea5404e5-0c0d-488c-93b2-0a2200534827 Authorization:$KEY
http PATCH \
http://localhost:4242/api/admin/projects/default/features/demo/environments/production/strategies/ea5404e5-0c0d-488c-93b2-0a2200534827 \
Authorization:$KEY
```

**Example response:**
Expand All @@ -478,13 +511,13 @@ http PATCH http://localhost:4242/api/admin/projects/default/features/demo/enviro

**Example Query**

```sh
```bash
http DELETE http://localhost:4242/api/admin/projects/default/features/demo/environments/production/strategies/77bbe972-ffce-49b2-94d9-326593e2228e Authorization:$KEY
```

**Example response:**

```sh
```
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Connection: keep-alive
Expand All @@ -499,13 +532,13 @@ Vary: Accept-Encoding

**Example Query**

```sh
```bash
http POST http://localhost:4242/api/admin/projects/default/features/demo/environments/development/on Authorization:$KEY --json
```

**Example response:**

```sh
```
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Connection: keep-alive
Expand Down Expand Up @@ -549,7 +582,7 @@ http PUT http://localhost:4242/api/admin/projects/default/features/demo/variants

**Example response:**

```sh
```bash
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Connection: keep-alive
Expand Down Expand Up @@ -579,13 +612,15 @@ Content-Type: application/json; charset=utf-8

**Example Query**

```sh
```bash
echo '[{"op": "add", "path": "/1", "value": {
"name": "new-variant",
"weightType": "fix",
"weight": 200
}}]' | \
http PATCH http://localhost:4242/api/admin/projects/default/features/demo/variants Authorization:$KEY
http PATCH \
http://localhost:4242/api/admin/projects/default/features/demo/variants \
Authorization:$KEY
```

** Example Response **
Expand Down

0 comments on commit f92d860

Please sign in to comment.