Skip to content

Commit 1e6ea97

Browse files
docs: add API documentation for /diagnostics
- Keep structure of documentation similar to `/settings`. - Add a note that `/diagnostics` endpoint is available only when `settings.js` has `diagnostics` option enabled - add the `GET /diagnostics` endpoint in the API table Signed-off-by: Shantanoo 'Shan' Desai <[email protected]>
1 parent 78ce134 commit 1e6ea97

File tree

2 files changed

+144
-0
lines changed

2 files changed

+144
-0
lines changed
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
---
2+
layout: docs-api
3+
toc: toc-api-admin.html
4+
title: GET /diagnostics
5+
slug:
6+
- url: "/docs/api/admin"
7+
label: "admin"
8+
- url: "/docs/api/admin/methods"
9+
label: "methods"
10+
- get diagnostics
11+
---
12+
13+
Get the runtime diagnostics. Note that runtime diagnostics are available only if
14+
`diagnostics` value is set to `enabled: true` in the `settings.js` file.
15+
16+
17+
Requires permission: <code>settings.read</code>
18+
19+
### Headers
20+
21+
Header | Value
22+
-------|-------
23+
`Authorization` | `Bearer [token]` - if authentication is enabled
24+
25+
### Response
26+
27+
Status Code | Reason | Response
28+
------------|----------------|--------------
29+
`200` | Success | See example response body
30+
`401` | Not authorized | _none_
31+
32+
{% highlight json %}
33+
{
34+
"report": "diagnostics",
35+
"scope": "basic",
36+
"time": {
37+
"utc": "Mon, 23 Jan 2023 20:15:08 GMT",
38+
"local": "1/23/2023, 8:15:08 PM"
39+
},
40+
"intl": {
41+
"locale": "en-US",
42+
"timeZone": "UTC"
43+
},
44+
"nodejs": {
45+
"version": "v16.16.0",
46+
"arch": "x64",
47+
"platform": "linux",
48+
"memoryUsage": {
49+
"rss": 106336256,
50+
"heapTotal": 36225024,
51+
"heapUsed": 33527912,
52+
"external": 1905248,
53+
"arrayBuffers": 145556
54+
}
55+
},
56+
"os": {
57+
"containerised": true,
58+
"wsl": false,
59+
"totalmem": 32841064448,
60+
"freemem": 28394344448,
61+
"arch": "x64",
62+
"loadavg": [
63+
1,
64+
1.01,
65+
0.89
66+
],
67+
"platform": "linux",
68+
"release": "5.15.85-1-MANJARO",
69+
"type": "Linux",
70+
"uptime": 5554.97,
71+
"version": "#1 SMP PREEMPT Wed Dec 21 21:15:06 UTC 2022"
72+
},
73+
"runtime": {
74+
"version": "3.0.2",
75+
"isStarted": true,
76+
"flows": {
77+
"state": "start",
78+
"started": true
79+
},
80+
"modules": {
81+
"node-red": "3.0.2"
82+
},
83+
"settings": {
84+
"available": true,
85+
"apiMaxLength": "UNSET",
86+
"disableEditor": false,
87+
"contextStorage": {},
88+
"debugMaxLength": 1000,
89+
"editorTheme": {
90+
"palette": {},
91+
"projects": {
92+
"enabled": false,
93+
"workflow": {
94+
"mode": "manual"
95+
}
96+
},
97+
"codeEditor": {
98+
"lib": "ace",
99+
"options": {
100+
"theme": "vs"
101+
}
102+
}
103+
},
104+
"flowFile": "flows.json",
105+
"mqttReconnectTime": 15000,
106+
"serialReconnectTime": 15000,
107+
"socketReconnectTime": "UNSET",
108+
"socketTimeout": "UNSET",
109+
"tcpMsgQueueSize": "UNSET",
110+
"inboundWebSocketTimeout": "UNSET",
111+
"runtimeState": {
112+
"enabled": false,
113+
"ui": false
114+
},
115+
"adminAuth": "SET",
116+
"httpAdminRoot": "/",
117+
"httpAdminCors": "UNSET",
118+
"httpNodeAuth": "UNSET",
119+
"httpNodeRoot": "/",
120+
"httpNodeCors": "UNSET",
121+
"httpStatic": "UNSET",
122+
"httpStaticRoot": "UNSET",
123+
"httpStaticCors": "UNSET",
124+
"uiHost": "SET",
125+
"uiPort": "SET",
126+
"userDir": "SET",
127+
"nodesDir": "UNSET"
128+
}
129+
}
130+
}
131+
{% endhighlight %}
132+
133+
The response object contains the following fields:
134+
135+
Field | Description
136+
---------------|------------
137+
`intl` | The internationalization (i8n) language for the node-red instance
138+
`nodejs` | NodeJS version for underlying architecture / platform
139+
`os` | Operating System information and statistics for current memory usage
140+
`runtime` | Current Node-RED runtime information
141+
`modules` | Node-RED modules and their respective versions
142+
`settings` | Detailed description for the current settings of the node-RED instance
143+

docs/api/admin/methods/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ 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
1819
[<span class="method">GET</span>/flows](get/flows) | Get the active flow configuration
1920
[<span class="method">POST</span>/flows](post/flows) | Set the active flow configuration
2021
[<span class="method">POST</span>/flow](post/flow) | Add a flow to the active configuration

0 commit comments

Comments
 (0)