API Reference¶
This is a quick reference to API endpoints that are available after configuring Django Health Monitor in a Django project. For a full explanation of configuring and using Django Health Monitor, see Usage.
Health¶
The following endpoints and actions describe the behavior of models derived from the Health model, which store the ‘health state’, ‘health severity’, and cached ‘health history’.
- /health/?detail=<detail>
- GET a list of all health uids
- /health/<uid>/
- GET the health of a particular uid
- DELETE the health of a particular uid
- /health/<uid>/<group>/
- GET the health of a particular uid and group
- DELETE health of a particular uid and group
- /health/<uid>/<group>/<test>/
- GET the health of a particular uid and group and test
- DELETE the health of a particular uid and group and test
Where:
- <uid> is a unique identifier of an asset.
- <group> is the name of a group of tests.
- <test> is the name of a health test.
And query string arguments:
- <detail> is a boolean value that if set to 1 or true will return a list of dictionaries with keys of ‘uid’, ‘state’, and ‘severity’ and corresponding values (optional). If not set, a list of uids will be returned.
Health Test¶
The following endpoints and actions describe the behavior of models derived from the HealthTest model, which store test results.
- /health_test/
- GET a list of all health tests
- /health_tests/<test>/?uids=<uids>&start_time=<start_time>&end_time=<end_time>
- GET test results of a particular test with filters
- /health_test/<test>/<uid>/?start_time=<start_time>&end_time=<end_time>&latest=<latest>
- GET test results of a particular test and uid with filters
- /health_test/<test>/<uid>/
- POST test results of a particular test and uid
Where:
- <uid> is a unique identifier of an asset.
- <test> is the name of a health test.
And query string arguments:
- <uids> is a comma-separated list of uids (optional).
- <start_time> is a datetime string in ISO 8601 format (optional).
- <end_time> is a datetime string in ISO 8601 format (optional).
- <latest> is a boolean value that if set to 1 or true will return the latest result in combination with start_time and end_time if provided.
- example: /health_test/heart/?uids=1,2,3&start_time=xxx&end_time=xxx
Health Alarm¶
The following endpoints and actions describe the behavior of models derived from the HealthAlarm model, which calculates which assets in a ‘population’ or ‘system’ exhibit elevated status based on four filters - score, aggregate_percent, repetition, repetition_percent.
- /health_alarm/
- GET a list of all groups
- /health_alarm/<group>/
- GET a list of all health tests for a particular group
- /health_alarm/<group>/<test>/?score=<score>&aggregate_percent=<aggregate_percent>&repetition=<repetition>&repetition_percent=<repetition_percent>
- GET a health alarm for a particular test (calculate whether or not an alarm condition exists and return uids in failure state)
Where:
- <group> is the name of a group of tests.
- <test> is the name of a health test.
And query string arguments:
- <score> is the minimum score needed to trigger a failure.
- <aggregate_percent> is the minimum percent of total assets in a failure state needed to trigger an alarm (optional). This is by default 0.
- <repetition> is the minimum number of successive test results in a failure state needed to trigger an alarm (optional). This is by default 1.
- <repetition_percent> is the minimum percent within the prior defined repetition in a failure state needed to trigger an alarm (optional). This is by default 100.