Added healthcheck endpoint /status #185
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Related issue (if applicable): refs #51
Added health check endpoint
/status
/status/
200
if the server is working correcty and a417
if there was an unexpected issue. You can set theAccept
header toapplication/json
ortext/plain
for different response outputs.Below is a sample of just a simple text response:
Below is a sample of a JSON response:
curl -X GET -H "Accept: application/json" http://localhost:8000/status
The above output may look like this:
config_lock
always cross references if theAPPRISE_CONFIG_LOCK
is enabled or not.status.can_write_config
defines if the configuration directory is writable or not. If the environment variableAPPRISE_STATEFUL_MODE
is set todisabled
, this value will always readfalse
and it will not impact thestatus.details
status.can_write_attach
defines if the attachment directory is writable or not. If the environment variableAPPRISE_ATTACH_SIZE
orAPPRISE_MAX_ATTACHMENTS
is set to0
(zero) or lower, this value will always readfalse
and it will not impact thestatus.details
.status.details
identifies the overall status. If there is more then 1 issue to report here, they will all show in this list. In a working orderly environment, this will always be set toOK
and the http response type will be200
.Checklist
flake8
)