fleet
POST /v1/fleet/register
Attach a booting agent to its declared fleet host.
การยืนยันตัวตน
ส่ง API key เป็น bearer token เอนด์พอยต์นี้ไม่ได้ระบุสิทธิ์การใช้งานเฉพาะในข้อกำหนด ดังนั้นควรให้คีย์ของคุณมีสิทธิ์น้อยที่สุดเท่าที่จำเป็นและให้ตรวจสอบจากการตอบกลับแทนที่จะคาดเดา
ปลายทางนี้ไม่ต้องใช้รหัสองค์กร คีย์ของคุณระบุองค์กรที่เป็นเจ้าของอยู่แล้ว และการตอบกลับจะถูกจำกัดขอบเขตไว้เฉพาะองค์กรนั้น
ทดลองใช้เลย
แทนที่สิ่งใดๆ ที่อยู่ภายในวงเล็บแหลมด้วยค่าของคุณเอง และตัวยึดตำแหน่งคีย์ด้วยคีย์จากแดชบอร์ดของคุณ
curl -X POST https://api.zinndigital.com/v1/fleet/register \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "instance_id": <string> }'เข้าสู่ระบบแล้วใช่ไหม คอนโซล API ในแดชบอร์ดของคุณจะเติมรหัสองค์กรจริงและคีย์ของคุณเองโดยอัตโนมัติ และทำการส่งคำขอไปยัง API จริง เพื่อให้คุณเห็นผลลัพธ์ที่เป็นข้อมูลจริง เปิดจุดสิ้นสุดนี้ในคอนโซล API
รายละเอียด
Called once when a worker-host agent starts. **Idempotent**, and structurally incapable of creating a fleet row: the host is the credential's foreign-key target, so re-registering converges the same row, and a re-register after the host was deleted cannot resurrect it (the delete cascaded the credential away, so the request no longer authenticates). **Registration does not make the box placeable.** It writes no status, no `acceptsDeploys` and no heartbeat stamp — a box that registers and then dies is still `provisioning` with a null heartbeat, and its declared capacity still counts zero toward placeable capacity. Promotion happens on the first *heartbeat*. The request carries only what a box can honestly observe about itself. There is deliberately no capacity/region/pool/driver/`acceptsDeploys` field: those are operator facts set with `manage.py register_worker_host`, and a box that could declare `capacity=100000, pool=pbn` would pull every new PBN site onto itself.
เนื้อหาคำขอ
| ชื่อ | ประเภท | จำเป็นต้องมี | ลักษณะของสิ่งนี้ |
|---|---|---|---|
instance_id | string | ใช่ | This **process's** identity (machine/container name) — not the host's. The host's name is read off the credential and is not accepted from the caller. |
agent_version | string | ไม่ใช่ | — |
python_version | string | ไม่ใช่ | — |
platform | string | ไม่ใช่ | — |
boot_id | string | ไม่ใช่ | `/proc/sys/kernel/random/boot_id`. Distinguishes "the agent restarted" from "the box rebooted" — a crash loop from a kernel panic. |
observed_address | string | ไม่ใช่ | The address this box believes it answers on. **Advisory only**: recorded on the registration audit row so an operator can compare it with the operator-set origin address, and ne… |
การตอบกลับ
| ชื่อ | ประเภท | จำเป็นต้องมี | ลักษณะของสิ่งนี้ |
|---|---|---|---|
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 depl… |
ข้อผิดพลาดที่เอนด์พอยต์นี้สามารถส่งกลับได้
401 · 422 · 429