caronc / apprise-api

A lightweight REST framework that wraps the Apprise Notification Library
https://hub.docker.com/r/caronc/apprise
MIT License
575 stars 49 forks source link

Added healthcheck endpoint /status #185

Closed caronc closed 1 month ago

caronc commented 2 months ago

Description:

Related issue (if applicable): refs #51

Added health check endpoint /status Path Method Description
/status/ GET Simply returns a server status. The server http response code is a 200 if the server is working correcty and a 417 if there was an unexpected issue. You can set the Accept header to application/json or text/plain for different response outputs.

Below is a sample of just a simple text response:

# Request a general text response
# Output will read `OK` if everything is fine, otherwise it will return
# one or more of the following separated by a comma:
#  - ATTACH_PERMISSION_ISSUE: Can not write attachments (likely a permission issue)
#  - CONFIG_PERMISSION_ISSUE: Can not write configuration (likely a permission issue)
curl -X GET http://localhost:8000/status

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": false,
  "status": {
    "can_write_config": true,
    "can_write_attach": true,
    "details": ["OK"]
  }
}

Checklist