Health & Status Endpoints¶
Health Check¶
GET /api/v1/health
Simple health check endpoint (no authentication required).
Request¶
Response¶
Status Codes¶
| Code | Description |
|---|---|
| 200 | Service is healthy |
Example¶
Readiness Check¶
GET /api/v1/ready
Comprehensive readiness check including zone directory and BIND9 connectivity (no authentication required).
Request¶
Response (Ready)¶
Response (Not Ready)¶
{
"ready": false,
"checks": [
"zone_dir_accessible: /var/cache/bind",
"rndc_error: connection refused"
]
}
Status Codes¶
| Code | Description |
|---|---|
| 200 | Service is ready |
| 503 | Service not ready |
Example¶
Server Status¶
GET /api/v1/server/status
Retrieves BIND9 server status via rndc.
Request¶
Response¶
Status Codes¶
| Code | Description |
|---|---|
| 200 | Status retrieved successfully |
| 401 | Unauthorized |
| 500 | RNDC command failed |
Example¶
Health Check Flow¶
flowchart TD
A[Health Check Request] --> B{Endpoint}
B -->|/health| C[Return 200 OK]
B -->|/ready| D{Check Components}
B -->|/server/status| E{Auth Valid?}
D --> F{Zone Dir OK?}
F -->|Yes| G{RNDC OK?}
F -->|No| H[Return 503 Not Ready]
G -->|Yes| I[Return 200 Ready]
G -->|No| H
E -->|Yes| J[Execute rndc status]
E -->|No| K[Return 401 Unauthorized]
J --> L{Success?}
L -->|Yes| M[Return 200 + Status]
L -->|No| N[Return 500 Internal Server Error]