Skip to content

Commit 7a7b762

Browse files
docs: add API documentation for /flows/state
- Add description for HTTP GET `/flows/state` - Add description for HTTP POST `/flows/state` - Add index pages to the methods table for rendering Signed-off-by: Shantanoo 'Shan' Desai <[email protected]>
1 parent 1e6ea97 commit 7a7b762

File tree

3 files changed

+93
-1
lines changed

3 files changed

+93
-1
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
layout: docs-api
3+
toc: toc-api-admin.html
4+
title: GET /flows/state
5+
slug:
6+
- url: "/docs/api/admin"
7+
label: "admin"
8+
- url: "/docs/api/admin/methods"
9+
label: "methods"
10+
- get flows state
11+
---
12+
13+
Get the current runtime state of flows. Note that runtime state of flows is available only if
14+
`runtimeState` value is set to `enabled: true` in the `settings.js` file.
15+
16+
### Headers
17+
18+
Header | Value
19+
-------|-------
20+
`Authorization` | `Bearer [token]` - if authentication is enabled
21+
22+
### Response
23+
24+
Status Code | Reason | Response
25+
------------|----------------|--------------
26+
`200` | Success | See example response body
27+
`401` | Not authorized | _none_
28+
29+
{% highlight json %}
30+
{
31+
"state": "stop"
32+
}
33+
{% endhighlight %}
34+
35+
The response object contains the following fields:
36+
37+
Field | Description
38+
---------------|------------
39+
`state` | runtime state of the flows. Can be either `start` or `stop`

docs/api/admin/methods/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ slug:
1515
[<span class="method">POST</span>/auth/token](post/auth/token) | Exchange credentials for access token
1616
[<span class="method">POST</span>/auth/revoke](post/auth/revoke) | Revoke an access token
1717
[<span class="method">GET</span>/settings](get/settings) | Get the runtime settings
18-
[<span class="method">GET</span>/diagnostics](get/diagnostics) | Get the runtime diagnostics
18+
[<span class="method">GET</span>/diagnostics](get/diagnostics) | Get the runtime diagnostics
1919
[<span class="method">GET</span>/flows](get/flows) | Get the active flow configuration
20+
[<span class="method">GET</span>/flows/state](get/flows/state) | Get the active flow's runtime state
2021
[<span class="method">POST</span>/flows](post/flows) | Set the active flow configuration
22+
[<span class="method">POST</span>/flows/state](post/flows/state) | Set the active flow's runtime state
2123
[<span class="method">POST</span>/flow](post/flow) | Add a flow to the active configuration
2224
[<span class="method">GET</span>/flow/:id](get/flow) | Get an individual flow configuration
2325
[<span class="method">PUT</span>/flow/:id](put/flow) | Update an individual flow configuration
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
layout: docs-api
3+
toc: toc-api-admin.html
4+
title: POST /flows/state
5+
slug:
6+
- url: "/docs/api/admin"
7+
label: "admin"
8+
- url: "/docs/api/admin/methods"
9+
label: "methods"
10+
- set flows state
11+
---
12+
13+
Set the runtime state of flows. Note that runtime state of flows is available only if
14+
`runtimeState` value is set to `enabled: true` in the `settings.js` file.
15+
16+
Requires permission: <code>flows.write</code>
17+
18+
### Headers
19+
20+
Header | Value
21+
-------|-------
22+
`Authorization` | `Bearer [token]` - if authentication is enabled
23+
24+
25+
### Arguments
26+
27+
The request body must be a URL-Encoded parameter with the following field:
28+
29+
30+
Field | Description
31+
-------------|------------------------
32+
`state` | Required runtime state of the flow. Can be either `start` or `stop`
33+
34+
### Response
35+
36+
Status Code | Reason | Response
37+
------------|----------------|--------------
38+
`200` | Success | See example response body
39+
`401` | Not authorized | _none_
40+
41+
{% highlight json %}
42+
{
43+
"state": "stop"
44+
}
45+
{% endhighlight %}
46+
47+
The response object contains the following fields:
48+
49+
Field | Description
50+
---------------|------------
51+
`state` | runtime state of the flows. Can be either `start` or `stop`

0 commit comments

Comments
 (0)