Health Checks
Section titled “Health Checks”The health endpoint provides a liveness probe for the daemon. It returns a standardized 9-field response and is unauthenticated — useful for load balancers and uptime monitors.
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://prj-ctnr-daemon-1.us-east-1.containers.hoody.icu/api/v1/daemon/health"await client.daemon.health.check(){ "status": "ok", "service": "hoody-daemon", "built": "2024-11-12T08:23:11Z", "started": "2024-11-12T14:01:42Z", "memory": { "rss": 18237440, "heap": null }, "fds": 14, "pid": 4711, "ip": "10.0.12.87", "userAgent": "hoody-cli/1.4.2"}Program Status
Section titled “Program Status”The status endpoints expose the runtime state of every program managed by the daemon. You can fetch all programs at once or drill down to a specific program by ID. For port-range programs, you can request a particular port instance.
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://prj-ctnr-daemon-1.us-east-1.containers.hoody.icu/api/v1/daemon/status"await client.daemon.status.getAll()Mixed-status example
{ "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" } } ]}All-running example
{ "success": true, "statuses": [ { "id": 1, "name": "web-server", "enabled": true, "status": { "id": 1, "status": "RUNNING", "pid": 1234, "uptime": "0:42:11" } }, { "id": 2, "name": "worker", "enabled": true, "status": { "id": 2, "status": "RUNNING", "pid": 1235, "uptime": "0:42:11" } } ]}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://prj-ctnr-daemon-1.us-east-1.containers.hoody.icu/api/v1/daemon/status/1?include_stats=true"await client.daemon.status.get(1, { include_stats: "true" })Running example
{ "success": true, "status": { "id": 1, "status": "RUNNING", "pid": 1234, "uptime": "2:15:30" }}Stopped example
{ "success": true, "status": { "id": 1, "status": "STOPPED" }}Fatal example
{ "success": true, "status": { "id": 1, "status": "FATAL" }}{ "success": false, "error": "Program with ID 999 not found"}Program Logs
Section titled “Program Logs”The logs endpoint returns the tail of a program’s stdout or stderr log file. For port-range programs, specify the port query parameter to target a specific instance.
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://prj-ctnr-daemon-1.us-east-1.containers.hoody.icu/api/v1/daemon/programs/1/logs?type=stdout&lines=50"await client.daemon.status.getLogs(1, { type: "stdout", lines: 50 }){ "success": true, "logs": "2024-11-12T14:01:42Z server listening on :8080\n2024-11-12T14:01:43Z GET / 200 12ms\n2024-11-12T14:01:44Z GET /health 200 1ms\n", "type": "stdout", "lines": 3, "log_file": "/var/log/hoody/programs/1.stdout.log"}{ "success": false, "error": "Invalid 'type' value: must be 'stdout' or 'stderr'"}