fleet
POST /v1/fleet/heartbeat
Stamp fleet liveness, ship the host report, collect queued commands.
Autenticação
Envie uma chave de API como um token bearer. Este endpoint não especifica uma permissão específica na documentação, portanto, conceda à sua chave o mínimo necessário e verifique a resposta em vez de assumir.
Este endpoint não requer um ID de organização. Sua chave já identifica a organização à qual pertence, e a resposta é delimitada a ela.
Experimente
Substitua qualquer item entre colchetes por seus próprios valores e o espaço reservado para a chave por uma chave do seu painel.
curl -X POST https://api.zinndigital.com/v1/fleet/heartbeat \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "instance_id": <string> }'Conectado? O console da API no seu painel preenche o ID da sua organização real e a sua própria chave, e executa a requisição contra a API de produção para que você possa ver a resposta real. Abra este endpoint no console da API
Detalhes
Sent every `heartbeatIntervalSeconds`. Carries the host health report — the same document the console has always shown — because the heartbeat and the report answer the same question, and one call means the report can never be fresher than the heartbeat it is judged against. **This is where a declared box becomes real capacity.** A host that has never heartbeated is promoted to `active` **and** starts accepting deploys on its first successful beat; every beat after that leaves `acceptsDeploys` untouched, so an operator's drain sticks across an agent restart. A `down` host that heartbeats again is revived to `active` or `draining` according to the operator's existing intent. A `decommissioned` host gets `continue: false` and nothing is written. The response carries any commands the engine claimed for this host (bounded per tick). The claim is still `SELECT … FOR UPDATE SKIP LOCKED`, so exactly-once semantics are unchanged; only *who runs the query* moved, because a worker box has no database connection.
Corpo da requisição
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
instance_id | string | Sim | — |
agent_version | string | Não | — |
report | WorkerHostReport | Não | One heartbeat's observed host state. |
Resposta
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
worker_id | string | Não | — |
hostname | string | Não | — |
status | string<provisioning, active, draining, down, decommissioned> | Não | — |
accepts_deploys | boolean | Não | — |
region | string | Não | — |
pool | string | Não | — |
driver | string | Não | — |
capacity | integer | Não | — |
product_lines | string[] | Não | — |
heartbeat_interval_seconds | integer | Não | How often to heartbeat, decided engine-side. The box no longer reads its own interval from an env file, so "the host-down window is ten missed beats" stays a fact about the depl… |
continue_running | boolean | Não | False only for an **answered** "this host is gone" (decommissioned or removed). An error is never reported as one — that distinction is what stops a transient failure retiring a… |
commands | WorkerClaimedCommand[] | Não | — |
Erros que este endpoint pode retornar
401 · 422 · 429