fleet
POST /v1/fleet/drain
Take this host out of placement on graceful shutdown.
Authentication
This endpoint does not take an API key. It takes its own credential, issued to the plugin or service that calls it, as a bearer token; see the description above.
This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.
Try it
Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.
curl -X POST https://api.zinndigital.com/v1/fleet/drain \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "instance_id": <string> }'Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console
Details
The only availability change a box may make for itself, and safe in the direction it moves: a host can take itself out of service and never back in. Returning requires either the once-only first-heartbeat promotion or a staff undrain (setWorkerDrain). Idempotent; a decommissioned host is left alone.
Request body
| Name | Type | Required | What it is |
|---|---|---|---|
instance_id | string | Yes | — |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
worker_id | string | No | — |
hostname | string | No | — |
status | string<provisioning, active, draining, down, decommissioned> | No | — |
accepts_deploys | boolean | No | — |
region | string | No | — |
pool | string | No | — |
driver | string | No | — |
capacity | integer | No | — |
product_lines | string[] | No | — |
heartbeat_interval_seconds | integer | No | 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… |
Errors this endpoint can return
401 · 422 · 429