Skip to content

Commit 7391d11

Browse files
committed
docs: Add documentation about internal server endpoints
1 parent 1c18f2b commit 7391d11

File tree

1 file changed

+200
-0
lines changed

1 file changed

+200
-0
lines changed

docs/feature-guide/internal-api.md

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
# Internal API
2+
3+
This API is served by the internal server port and shouldn't be public. The aim of this one it to provide internal services like monitoring, health status or debug configuration.
4+
5+
## /health
6+
7+
This endpoint will give the status of the application. This will either answer with
8+
9+
- a 200 status code and a json body when everything is ok
10+
- a 500 status code and a json body explaining why there is a problem
11+
12+
## /metrics
13+
14+
This endpoint will give metrics with the prometheus format.
15+
16+
## /config
17+
18+
This endpoint will show the latest configuration loaded by the application. Data are changed each time application is reloading the configuration.
19+
20+
Everything is shown in json format with the same keys are in the yaml configuration files.
21+
22+
Important note: Secret values aren't displayed. Only environment variable names and file paths.
23+
24+
Here is a payload example:
25+
26+
```json
27+
{
28+
"config": {
29+
"log": { "level": "info", "format": "json", "filePath": "" },
30+
"tracing": {
31+
"fixedTags": null,
32+
"flushInterval": "",
33+
"udpHost": "",
34+
"queueSize": 0,
35+
"enabled": false,
36+
"logSpan": false
37+
},
38+
"metrics": { "disableRouterPath": false },
39+
"server": {
40+
"timeouts": {
41+
"readTimeout": "",
42+
"readHeaderTimeout": "60s",
43+
"writeTimeout": "",
44+
"idleTimeout": ""
45+
},
46+
"cors": null,
47+
"cache": null,
48+
"compress": {
49+
"enabled": true,
50+
"types": [
51+
"text/html",
52+
"text/css",
53+
"text/plain",
54+
"text/javascript",
55+
"application/javascript",
56+
"application/x-javascript",
57+
"application/json",
58+
"application/atom+xml",
59+
"application/rss+xml",
60+
"image/svg+xml"
61+
],
62+
"level": 5
63+
},
64+
"ssl": null,
65+
"listenAddr": "",
66+
"port": 8080
67+
},
68+
"internalServer": {
69+
"timeouts": {
70+
"readTimeout": "",
71+
"readHeaderTimeout": "60s",
72+
"writeTimeout": "",
73+
"idleTimeout": ""
74+
},
75+
"cors": null,
76+
"cache": null,
77+
"compress": {
78+
"enabled": true,
79+
"types": [
80+
"text/html",
81+
"text/css",
82+
"text/plain",
83+
"text/javascript",
84+
"application/javascript",
85+
"application/x-javascript",
86+
"application/json",
87+
"application/atom+xml",
88+
"application/rss+xml",
89+
"image/svg+xml"
90+
],
91+
"level": 5
92+
},
93+
"ssl": null,
94+
"listenAddr": "",
95+
"port": 9090
96+
},
97+
"targets": {
98+
"test": {
99+
"bucket": {
100+
"credentials": null,
101+
"requestConfig": null,
102+
"name": "bucket1",
103+
"prefix": "",
104+
"region": "us-east-1",
105+
"s3Endpoint": "",
106+
"s3ListMaxKeys": 1000,
107+
"s3MaxUploadParts": 10000,
108+
"s3UploadPartSize": 5,
109+
"s3UploadConcurrency": 5,
110+
"s3UploadLeavePartsOnError": false,
111+
"disableSSL": false,
112+
"credentials": {
113+
"accessKey": { "env": "FAKE", "path": "" },
114+
"secretKey": { "path": "/secret", "env": "" }
115+
}
116+
},
117+
"resources": null,
118+
"mount": { "host": "", "path": ["/test/"] },
119+
"actions": {
120+
"GET": { "config": null, "enabled": true },
121+
"PUT": null,
122+
"DELETE": null
123+
},
124+
"templates": {
125+
"folderList": null,
126+
"notFoundError": null,
127+
"internalServerError": null,
128+
"forbiddenError": null,
129+
"unauthorizedError": null,
130+
"badRequestError": null,
131+
"put": null,
132+
"delete": null,
133+
"helpers": null
134+
},
135+
"keyRewriteList": null
136+
}
137+
},
138+
"templates": {
139+
"folderList": {
140+
"path": "templates/folder-list.tpl",
141+
"headers": {
142+
"Content-Type": "{{ template \"main.headers.contentType\" . }}"
143+
},
144+
"status": "200"
145+
},
146+
"targetList": {
147+
"path": "templates/target-list.tpl",
148+
"headers": {
149+
"Content-Type": "{{ template \"main.headers.contentType\" . }}"
150+
},
151+
"status": "200"
152+
},
153+
"notFoundError": {
154+
"path": "templates/not-found-error.tpl",
155+
"headers": {
156+
"Content-Type": "{{ template \"main.headers.contentType\" . }}"
157+
},
158+
"status": "404"
159+
},
160+
"internalServerError": {
161+
"path": "templates/internal-server-error.tpl",
162+
"headers": {
163+
"Content-Type": "{{ template \"main.headers.contentType\" . }}"
164+
},
165+
"status": "500"
166+
},
167+
"unauthorizedError": {
168+
"path": "templates/unauthorized-error.tpl",
169+
"headers": {
170+
"Content-Type": "{{ template \"main.headers.contentType\" . }}"
171+
},
172+
"status": "401"
173+
},
174+
"forbiddenError": {
175+
"path": "templates/forbidden-error.tpl",
176+
"headers": {
177+
"Content-Type": "{{ template \"main.headers.contentType\" . }}"
178+
},
179+
"status": "403"
180+
},
181+
"badRequestError": {
182+
"path": "templates/bad-request-error.tpl",
183+
"headers": {
184+
"Content-Type": "{{ template \"main.headers.contentType\" . }}"
185+
},
186+
"status": "400"
187+
},
188+
"put": { "path": "templates/put.tpl", "headers": {}, "status": "204" },
189+
"delete": {
190+
"path": "templates/delete.tpl",
191+
"headers": {},
192+
"status": "204"
193+
},
194+
"helpers": ["templates/_helpers.tpl"]
195+
},
196+
"authProviders": null,
197+
"listTargets": { "mount": null, "resource": null, "enabled": false }
198+
}
199+
}
200+
```

0 commit comments

Comments
 (0)