Command Syntax
Options
This command takes no options.What It Checks
The health command monitors these API endpoints:- services -
/services - events -
/events - photos -
/photos - population -
/population - resources -
/resources
- Sends an HTTP GET request
- Measures response time
- Checks HTTP status code (200-299 = healthy)
- Reports connection errors if any
Output Format
The command displays results in a formatted table:Usage Examples
Check API Health
Connection Failure Output
HTTP Error Output
Status Indicators
- ✓ (green) - Endpoint is healthy (HTTP 200-299)
- ✗ (red) - Endpoint is unhealthy (connection error or HTTP error)
Response Time
Response times are measured in seconds and displayed with 2 decimal places. This helps identify:- Network latency issues
- API performance problems
- Slow endpoints that may need optimization
Exit Codes
- 0 - All endpoints are healthy
- 1 - One or more endpoints are unhealthy or unreachable
Configuration
The health check uses settings from your CLI configuration:- API URL - Base URL for API requests (default:
https://services.dzaleka.com/api) - Timeout - Maximum wait time per request (default: 30 seconds)
Troubleshooting
Connection Refused
If you see “Connection refused” errors:- Verify the API server is running
- Check if the API URL is correct using
dzdk show-config - Test network connectivity:
ping services.dzaleka.com - Update the API URL if needed:
dzdk config --url "https://correct-url.com"
Timeout Errors
If requests time out:- Check network latency
- Increase timeout:
dzdk config --timeout 60 - Verify API server performance
HTTP Errors
If you see HTTP 404, 500, or other errors:- Check if the endpoint exists in the API
- Verify API server logs for errors
- Ensure the API version is compatible
Related Commands
- dzdk config - Update API URL and timeout settings
dzdk show-config- View current configuration (see config command page)