fleet
POST /v1/fleet/heartbeat
Stamp fleet liveness, ship the host report, collect queued commands.
Аутентификација
Пошаљите API кључ као bearer токен. Ова крајња тачка не наводи конкретну дозволу у спецификацији, па свом кључу доделите најмања неопходна овлашћења и проверите одговор уместо да претпостављате.
Ова крајња тачка не прихвата id организације. Ваш кључ већ идентификује организацију којој припада, а одговор је ограничен на њу.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
curl -X POST https://api.zinndigital.com/v1/fleet/heartbeat \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "instance_id": <string> }'Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
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.
Тело захтева
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
instance_id | string | Да | — |
agent_version | string | Не | — |
report | WorkerHostReport | Не | One heartbeat's observed host state. |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
worker_id | string | Не | — |
hostname | string | Не | — |
status | string<provisioning, active, draining, down, decommissioned> | Не | — |
accepts_deploys | boolean | Не | — |
region | string | Не | — |
pool | string | Не | — |
driver | string | Не | — |
capacity | integer | Не | — |
product_lines | string[] | Не | — |
heartbeat_interval_seconds | integer | Не | 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… |
continue_running | boolean | Не | 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[] | Не | — |
Грешке које ова крајња тачка може вратити
401 · 422 · 429