pub enum CloudCreateSandboxRequest {
Oci {
sandbox: CloudSandboxSpec,
reference: String,
resources: CloudSandboxResources,
patches: Vec<CloudPatch>,
pull_policy: CloudPullPolicy,
},
Bind {
sandbox: CloudSandboxSpec,
path: PathBuf,
resources: CloudSandboxComputeResources,
patches: Vec<CloudPatch>,
},
DiskImage {
sandbox: CloudSandboxSpec,
path: PathBuf,
format: CloudDiskImageFormat,
fstype: Option<String>,
resources: CloudSandboxComputeResources,
patches: Vec<CloudPatch>,
},
DiskSnapshot {
sandbox: CloudSandboxSpec,
disk_snapshot_ref: CloudSnapshotLocation,
resources: CloudSandboxComputeResources,
pull_policy: CloudPullPolicy,
},
}Expand description
Wire shape of a cloud sandbox create request body.
Each root filesystem origin is a distinct source variant. The common
sandbox settings remain flat beside the source-specific fields. Legacy
requests carrying an image object are accepted during migration.
Variants§
Oci
Create a sandbox from an OCI image.
Fields
sandbox: CloudSandboxSpecSettings shared by every sandbox source.
resources: CloudSandboxResourcesCPU, memory, and writable-disk resources.
patches: Vec<CloudPatch>Rootfs patches applied before VM start.
pull_policy: CloudPullPolicyOCI image pull policy.
Bind
Create a sandbox from a host directory.
Fields
sandbox: CloudSandboxSpecSettings shared by every sandbox source.
resources: CloudSandboxComputeResourcesCPU and memory resources.
patches: Vec<CloudPatch>Rootfs patches applied before VM start.
DiskImage
Create a sandbox from a disk image file.
Fields
sandbox: CloudSandboxSpecSettings shared by every sandbox source.
format: CloudDiskImageFormatDisk image format.
resources: CloudSandboxComputeResourcesCPU and memory resources.
patches: Vec<CloudPatch>Rootfs patches applied before VM start.
DiskSnapshot
Create a fresh-booted sandbox from a disk snapshot.
Fields
sandbox: CloudSandboxSpecSettings shared by every sandbox source.
disk_snapshot_ref: CloudSnapshotLocationDisk snapshot to restore.
resources: CloudSandboxComputeResourcesCPU and memory resources.
pull_policy: CloudPullPolicyPull policy used if the snapshot’s pinned base image must be fetched.
Implementations§
Source§impl CloudCreateSandboxRequest
impl CloudCreateSandboxRequest
Sourcepub const fn sandbox_spec(&self) -> &CloudSandboxSpec
pub const fn sandbox_spec(&self) -> &CloudSandboxSpec
Return settings shared by every sandbox source.
Sourcepub const fn sandbox_spec_mut(&mut self) -> &mut CloudSandboxSpec
pub const fn sandbox_spec_mut(&mut self) -> &mut CloudSandboxSpec
Return mutable settings shared by every sandbox source.
Sourcepub const fn disk_snapshot_ref(&self) -> Option<&CloudSnapshotLocation>
pub const fn disk_snapshot_ref(&self) -> Option<&CloudSnapshotLocation>
Return the disk snapshot reference, when restoring one.
Sourcepub fn oci_reference(&self) -> Option<&str>
pub fn oci_reference(&self) -> Option<&str>
Return the OCI image reference, when creating from OCI.
Sourcepub const fn compute_resources(&self) -> CloudSandboxComputeResources
pub const fn compute_resources(&self) -> CloudSandboxComputeResources
Return the requested CPU and memory resources.
Sourcepub const fn oci_disk_size_mib(&self) -> Option<Option<u32>>
pub const fn oci_disk_size_mib(&self) -> Option<Option<u32>>
Return the requested OCI writable-disk size, if this is an OCI source.
Sourcepub fn set_oci_disk_size_mib(&mut self, disk_size_mib: u32) -> bool
pub fn set_oci_disk_size_mib(&mut self, disk_size_mib: u32) -> bool
Set the OCI writable-disk size, returning whether this is an OCI source.
Trait Implementations§
Source§impl Clone for CloudCreateSandboxRequest
impl Clone for CloudCreateSandboxRequest
Source§fn clone(&self) -> CloudCreateSandboxRequest
fn clone(&self) -> CloudCreateSandboxRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more