Endpoints¶
- GET /health¶
Check the health of the API.
`This endpoint checks the health of the following services::raw-html-md:`
- API:raw-html-md:<br/>- Database:raw-html-md:<br/>- Celery:raw-html-md:<br/>- Status Codes:
200 OK – All services are healthy
403 Forbidden – At least one service is not healthy
- GET /status¶
Check the status of the Celery workers.
`This endpoint checks the status of the Celery workers.:raw-html-md:`- Status Codes:
200 OK – Detailed status of the Celery workers
- GET /count¶
Count the number of records in the person table.
`This endpoint counts the number of records in the person table. It used a:raw-html-md:`
`direct SQL query to the database (So not using the celery workers).:raw-html-md:`- Status Codes:
200 OK – The number of patients in the database
500 Internal Server Error – Something went wrong
- GET /error¶
Produce an error on the query.
`This endpoint is used to test the error handling of the API.:raw-html-md:`- Status Codes:
500 Internal Server Error – As expected the query failed
200 OK – If you get this the test failed.. by succeeding
- GET /result/{id_}¶
Retrieve the status and/or result of a task.
`This endpoint retrieves the status and/or result of a task. The task id is:raw-html-md:`
`returned by the CeleryTest endpoint.:raw-html-md:`- Status Codes:
200 OK – The number of patients in the database
500 Internal Server Error – Something went wrong
- GET /celery¶
Create a count task.
`This endpoint creates a count task and returns the task id. This endpoint:raw-html-md:`
`uses the celery workers. The result can be retrieved with the CeleryStatus:raw-html-md:`
`endpoint.:raw-html-md:`- Status Codes:
200 OK – Task started
503 Service Unavailable – Celery is not available, check the health endpoint