Status & Monitoring
Section titled “Status & Monitoring”Use these endpoints to check the daemon’s health, retrieve runtime status for individual programs or the full program set, and fetch recent log output for debugging.
Health check
Section titled “Health check”GET /api/v1/daemon/health
Section titled “GET /api/v1/daemon/health”Returns the standardized 9-field health response. Unauthenticated. Always returns HTTP 200 with Content-Type: application/json when the service is up.
This endpoint takes no parameters.
curl -X GET https://daemon.hoody.com/api/v1/daemon/healthconst health = await client.daemon.health.check();{ "status": "ok", "service": "hoody-daemon", "built": "2025-01-15T10:30:00Z", "started": "2025-01-20T08:00:00Z", "memory": { "rss": 12582912, "heap": null }, "fds": 42, "pid": 1234, "ip": "192.168.1.100", "userAgent": "hoody-cli/1.0.0"}Program status
Section titled “Program status”GET /api/v1/daemon/status
Section titled “GET /api/v1/daemon/status”Retrieves the current runtime status of all configured programs. Returns information about whether each program is running, stopped, or in another state, along with process details for running programs.
This endpoint takes no parameters.
curl -X GET https://daemon.hoody.com/api/v1/daemon/statusconst allStatus = await client.daemon.status.getAll();{ "success": true, "statuses": [ { "id": 1, "name": "web-server", "enabled": true, "status": { "id": 1, "status": "RUNNING", "pid": 1234, "uptime": "2:15:30" } }, { "id": 2, "name": "nodejs-app", "enabled": false, "status": { "id": 2, "status": "STOPPED" } } ]}{ "success": true, "statuses": [ { "id": 1, "name": "web-server", "enabled": true, "status": { "id": 1, "status": "RUNNING", "pid": 1234, "uptime": "0:05:12" } }, { "id": 2, "name": "api-service", "enabled": true, "status": { "id": 2, "status": "RUNNING", "pid": 1235, "uptime": "0:04:58" } } ]}GET /api/v1/daemon/status/{id}
Section titled “GET /api/v1/daemon/status/{id}”Retrieves the current runtime status of a specific program by ID. For port-range programs, returns all running instances unless a specific port is requested via query parameter. Returns detailed process information including PID and uptime.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | Yes | Unique numeric identifier of the program |
port | query | integer | No | Filter to specific port instance (for port-range programs only) |
include_stats | query | string | No | Include resource stats (CPU, memory, process tree) for running programs. Adds a stats field with pid, started_at, cpu_percent, memory_rss_bytes, process_count, and per-process breakdown. Allowed values: "true", "false". |
curl -X GET "https://daemon.hoody.com/api/v1/daemon/status/1?port=8080&include_stats=true"const status = await client.daemon.status.get({ id: 1, port: 8080, include_stats: "true",});{ "success": true, "status": { "id": 1, "status": "RUNNING", "pid": 1234, "uptime": "2:15:30" }}{ "success": true, "status": { "id": 2, "status": "STOPPED" }}{ "success": true, "status": { "id": 3, "status": "FATAL" }}{ "success": false, "error": "Program with ID 999 not found"}Program logs
Section titled “Program logs”GET /api/v1/daemon/programs/{id}/logs
Section titled “GET /api/v1/daemon/programs/{id}/logs”Retrieve the last N lines from a program’s stdout or stderr log file.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | Yes | Program ID |
type | query | string | No | Log stream: stdout or stderr. Default: "stdout". |
lines | query | integer | No | Number of lines to return from end of file. Default: 100. |
port | query | integer | No | Port number (required for port-range programs) |
curl -X GET "https://daemon.hoody.com/api/v1/daemon/programs/1/logs?type=stdout&lines=50&port=8080"const logs = await client.daemon.status.getLogs({ id: 1, type: "stdout", lines: 50, port: 8080,});{ "success": true, "logs": "[2025-01-20T10:00:00Z] Server started on port 8080\n[2025-01-20T10:00:01Z] Listening for connections\n", "type": "stdout", "lines": 2, "log_file": "/var/log/hoody/web-server.out.log"}{ "success": false, "error": "Invalid type parameter: must be 'stdout' or 'stderr'"}