Skip to main content

Module schemas

Module schemas 

Source
Expand description

Request and response types that mirror Firecracker’s OpenAPI shapes.

Two-shape pattern per 10-data-model.md § 2.3: every external-facing struct is split into a Raw* shape (the literal serde target with no validation rules) and a validated newtype with private fields. Validation runs inside TryFrom, not after serde. This makes “unvalidated DriveConfig” unrepresentable: the only path from JSON to the domain type is through the validating constructor.

Field names match upstream’s swagger exactly (snake_case in nested JSON, derived from firecracker.yaml); the static-config envelope uses kebab-case only at the top level.

Re-exports§

pub use actions::InstanceAction;
pub use actions::InstanceActionInfo;
pub use balloon::BalloonConfig;
pub use balloon::BalloonHintingOp;
pub use balloon::BalloonStatsUpdate;
pub use balloon::BalloonUpdate;
pub use boot_source::BootSourceConfig;
pub use common::DriveId;
pub use common::IfaceId;
pub use common::InstanceId;
pub use common::MAX_DRIVES;
pub use common::MAX_NICS;
pub use common::MAX_PMEM;
pub use common::MAX_VIRTIO_MEM;
pub use common::MacAddr;
pub use common::MemSizeMib;
pub use common::SafePath;
pub use common::UdsPath;
pub use common::VsockId;
pub use config_file::ConfigFile;
pub use cpu_config::CpuConfig;
pub use drive::DriveConfig;
pub use drive::DrivePatch;
pub use entropy::EntropyConfig;
pub use hotplug_memory::HotplugMemoryConfig;
pub use hotplug_memory::HotplugMemoryUpdate;
pub use logger::LoggerConfig;
pub use machine_config::MachineConfig;
pub use machine_config::MachineConfigPatch;
pub use metrics::MetricsConfig;
pub use mmds::MmdsConfig;
pub use mmds::MmdsContents;
pub use network::NetworkInterfaceConfig;
pub use network::NetworkPatch;
pub use pmem::PmemConfig;
pub use pmem::PmemPatch;
pub use serial::SerialConfig;
pub use snapshot::SnapshotCreateConfig;
pub use snapshot::SnapshotLoadConfig;
pub use vm::VmStateChange;
pub use vsock::VsockConfig;

Modules§

actions
/actions PUT body.
balloon
/balloon, /balloon/statistics, /balloon/hinting/{op} bodies.
boot_source
/boot-source PUT body.
common
Boundary newtypes shared across endpoint schemas.
config_file
--config-file static-config envelope (20-firecracker-api.md § 6).
cpu_config
/cpu-config PUT body.
drive
/drives/{id} PUT and PATCH bodies.
entropy
/entropy PUT body — virtio-rng configuration.
hotplug_memory
/hotplug/memory PUT and PATCH bodies — virtio-mem hotplug.
logger
/logger PUT body.
machine_config
/machine-config request and response shapes.
metrics
/metrics PUT body.
mmds
/mmds and /mmds/config bodies.
network
/network-interfaces/{id} PUT and PATCH bodies.
pmem
/pmem/{id} PUT and PATCH bodies — virtio-pmem on a memory-mapped file.
serial
/serial PUT body — guest-side serial console destination.
snapshot
/snapshot/create and /snapshot/load bodies.
vm
PATCH /vm body — pause / resume.
vsock
/vsock PUT body.

Structs§

InstanceInfo
Body of GET / (the InstanceInfo resource).
VersionResponse
Body of GET /version.

Enums§

VmState
Wire-shape lifecycle state served by GET / and inside snapshot metadata.