Expand description
Axum handlers per 20-firecracker-api.md § 2.
Three handler categories:
- Read-only fast path (§ 5.1) —
GET /,GET /version,GET /vm/config,GET /machine-config,GET /balloon,GET /balloon/statistics,GET /mmds. These read directly fromArcSwapand never touch the VMM channel, so a long-runningPUT /snapshot/loadcannot cause liveness probes to time out. - Mutating — every PUT/PATCH/DELETE/POST. Validates the JSON body via
Raw<T> → T::TryFrom, validates phase, dispatches to the VMM throughRuntimeApiController, applies the per-class timeout. - Fallback — unknown paths translated to
400 Bad Requestper the upstream shape (squib has no 404; see 20 § 3).
Functions§
- delete_
drive DELETE /drives/{id}.- delete_
network DELETE /network-interfaces/{id}.- delete_
pmem DELETE /pmem/{id}.- fallback
- Fallback for unmatched paths — translate to 400 with a
fault_message. - get_
balloon GET /balloon— read-only mirror.- get_
balloon_ statistics GET /balloon/statistics— read-only mirror.- get_
hotplug_ memory GET /hotplug/memory— read-only mirror.- get_
machine_ config GET /machine-config— read-only mirror of the last-applied machine config (or an empty object pre-boot).- get_
mmds GET /mmds— return the MMDS data store tree.- get_
root GET /—InstanceInfo. Read-only fast path; never touches the VMM channel.- get_
version GET /version— Firecracker-compat version string.- get_
vm_ config GET /vm/config— materializedVmmConfig(read-only fast path).- patch_
balloon PATCH /balloon.- patch_
balloon_ hinting PATCH /balloon/hinting/{op}handler. The op is validated againststart | status | stop.- patch_
balloon_ statistics PATCH /balloon/statistics.- patch_
drive PATCH /drives/{id}.- patch_
hotplug_ memory PATCH /hotplug/memory.- patch_
machine_ config PATCH /machine-config.- patch_
mmds PATCH /mmds— JSON-merge-patch the data store.- patch_
network PATCH /network-interfaces/{id}.- patch_
pmem PATCH /pmem/{id}.- patch_
vm PATCH /vm— pause/resume.- put_
actions PUT /actions.- put_
balloon PUT /balloon.- put_
boot_ source PUT /boot-source.- put_
cpu_ config PUT /cpu-config.- put_
drive PUT /drives/{id}. The URL{id}must match the bodydrive_id.- put_
entropy PUT /entropy.- put_
hotplug_ memory PUT /hotplug/memory.- put_
logger PUT /logger.- put_
machine_ config PUT /machine-config.- put_
metrics PUT /metrics.- put_
mmds PUT /mmds— replace the data store.- put_
mmds_ config PUT /mmds/config.- put_
network PUT /network-interfaces/{id}.- put_
pmem PUT /pmem/{id}.- put_
serial PUT /serial.- put_
snapshot_ create PUT /snapshot/create.- put_
snapshot_ load PUT /snapshot/load.- put_
vsock PUT /vsock.