delonix serve node-api
O contrato de nó (gRPC + HTTP/JSON do delonix.node.v1) num socket unix.
The node contract (gRPC + HTTP/JSON of delonix.node.v1) on a unix socket.
O contrato versionado proto/delonix/node/v1 servido pelo binário
delonix-node-api (ADR-0040 P5): gRPC e HTTP/JSON dos MESMOS ficheiros, num socket
unix local, só para o próprio uid. Hoje serve o NodeService, a partir da entrada
GET /v1, que traz um link para cada recurso servido (o cabeçalho Link
espelha-os): GET /v1/providers[?kind=] devolve os mesmos providers e capacidades que
delonix provider ls -o json (ADR-0050 D5), e GET /v1/node,
/v1/node/health e /v1/node/capacity dizem o que o nó é, se pode correr
workloads e que espaço tem (ADR-0042 passo C) — um valor que não se mediu vem nomeado em
unmeasured, nunca como zero. GET /openapi.json serve o documento gerado
(docs/api/openapi.yaml), e GET /docs (Swagger UI) e GET /redoc
desenham-no a partir de ficheiros embebidos no binário, sem carregar nada de fora (um
Content-Security-Policy só deixa o próprio socket); chega-se a elas por um port-forward ou um
túnel SSH até ao socket. GET /v1/namespaces/default/networks[/<nome>] lê as redes do nó
(ADR-0042 passo E): a condição Realized vem do registo do dataplane, a lista aceita
label_selector e pagina com page.page_size/page.page_token, e uma rede traz
ETag (If-None-Match responde 304). O WatchEvents responde UNIMPLEMENTED a nomear o
passo que o traz.
The versioned contract proto/delonix/node/v1 served by the
delonix-node-api binary (ADR-0040 P5): gRPC and HTTP/JSON from the SAME files, on a
local unix socket, for the owning uid only. Today it serves the NodeService, from the
entry point GET /v1, which links every resource served (mirrored in the
Link header): GET /v1/providers[?kind=] returns the same providers and capabilities as
delonix provider ls -o json (ADR-0050 D5), and GET /v1/node,
/v1/node/health and /v1/node/capacity say what the node is, whether it can
run workloads and what room it has (ADR-0042 step C) — a value that was not measured is named in
unmeasured, never reported as zero. GET /openapi.json serves the generated
document (docs/api/openapi.yaml), and GET /docs (Swagger UI) and
GET /redoc render it from UI files embedded in the binary, loading nothing from
elsewhere (a Content-Security-Policy allows only the socket itself); a browser reaches them through
a port-forward or an SSH tunnel to the socket. GET /v1/namespaces/default/networks[/<name>]
reads the node's networks (ADR-0042 step E): the Realized condition comes from the dataplane
record, the list takes label_selector and pages with page.page_size/page.page_token,
and a network carries an ETag (If-None-Match answers 304). WatchEvents answers
UNIMPLEMENTED naming the step that brings it.
📄 Implementação real em Rust: cmd/serve.rs
Usage: delonix serve node-api [OPTIONS]
Options:
--addr <ADDR>
Socket address (default: `$DELONIX_NODE_API_ADDR` or `unix:///run/delonix-node.sock`)
--idle-timeout <DURATION>
Exit after this long with no connection open and no operation running: `120`, `90s`, `5m`, `0` for never. Default: 300s when started by socket activation, never otherwise
--install-units
Write a systemd socket unit and its service (user units when rootless, system units as root), reload systemd and enable the socket, instead of serving. The node API then starts on the first connection and exits when idle (default `--idle-timeout` in the unit: 120s)
-h, --help
Print help (see a summary with '-h')
EXAMPLES:
# the node contract on the default unix socket — gRPC and HTTP/JSON of
# delonix.node.v1
delonix serve node-api
# a socket of your own, then read the providers as JSON
delonix serve node-api --addr unix:///tmp/delonix-node.sock
SEE ALSO:
delonix serve api · delonix provider ls · delonix system info
delonix › serve › node-api