fleet
POST /v1/fleet/heartbeat
Stamp fleet liveness, ship the host report, collect queued commands.
Πισtoποίηση
Στείλτε ένα κλειδί API ως διακριτικό φορέα (bearer token). Αυτό το τελικό σημείο δεν ορίζει μια συγκεκριμένη άδεια στην προδιαγραφή, οπότε δώστε στο κλειδί σας τα ελάχιστα δυνατά δικαιώματα και ελέγξτε την απόκριση αντί να κάνετε υποθέσεις.
Αυτό το τελικό σημείο δεν δέχεται αναγνωριστικό οργανισμού. Το κλειδί σας προσδιορίζει ήδη τον οργανισμό στον οποίο ανήκει, και η απάντηση περιορίζεται σε αυτόν.
Δοκιμάστε το
Ατικatastήstε ό,τι βρίskεtai μέσα σe γώniaδeς μe τis δikές sas timές, kai to placeholder klεidioύ μe éna klεidi apó ton pinaka ελέgchou sas.
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 στον πίνακα ελέγχου σας συμπληρώνει το πραγματικό αναγνωριστικό του οργανισμού σας και το δικό σας κλειδί, και εκτελεί το αίτημα στο ζωντανό 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.
Σώμα αίτησης
| Όνομα | Τύpος | Υποχρεωτικό | Τι είναι |
|---|---|---|---|
instance_id | string | Ναι | — |
agent_version | string | Όχι | — |
report | WorkerHostReport | Όχι | One heartbeat's observed host state. |
Απάντηση
| Όνομα | Τύpος | Υποχρεωτικό | Τι είναι |
|---|---|---|---|
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