Struct PostParams

Source
pub struct PostParams {
Show 43 fields pub arch: Option<Arch>, pub bwlimit: Option<()>, pub cmode: Option<Cmode>, pub console: Option<bool>, pub cores: Option<u64>, pub cpulimit: Option<f64>, pub cpuunits: Option<()>, pub debug: Option<bool>, pub description: Option<String>, pub devs: HashMap<u32, String>, pub features: Option<String>, pub force: Option<bool>, pub hookscript: Option<String>, pub hostname: Option<String>, pub ignore_unpack_errors: Option<bool>, pub lock: Option<Lock>, pub memory: Option<u64>, pub mps: HashMap<u32, String>, pub nameserver: Option<String>, pub nets: HashMap<u32, String>, pub onboot: Option<bool>, pub ostemplate: String, pub ostype: Option<Ostype>, pub password: Option<String>, pub pool: Option<String>, pub protection: Option<bool>, pub restore: Option<bool>, pub rootfs: Option<String>, pub searchdomain: Option<String>, pub ssh_public_keys: Option<String>, pub start: Option<bool>, pub startup: Option<String>, pub storage: Option<String>, pub swap: Option<u64>, pub tags: Option<String>, pub template: Option<bool>, pub timezone: Option<String>, pub tty: Option<u64>, pub unique: Option<bool>, pub unprivileged: Option<bool>, pub unuseds: HashMap<u32, String>, pub vmid: VmId, pub additional_properties: HashMap<String, Value>,
}

Fields§

§arch: Option<Arch>

OS architecture type.

§bwlimit: Option<()>

Override I/O bandwidth limit (in KiB/s).

§cmode: Option<Cmode>

Console mode. By default, the console command tries to open a connection to one of the available tty devices. By setting cmode to ‘console’ it tries to attach to /dev/console instead. If you set cmode to ‘shell’, it simply invokes a shell inside the container (no login).

§console: Option<bool>

Attach a console device (/dev/console) to the container.

§cores: Option<u64>

The number of cores assigned to the container. A container can use all available cores by default.

§cpulimit: Option<f64>

Limit of CPU usage.

NOTE: If the computer has 2 CPUs, it has a total of ‘2’ CPU time. Value ‘0’ indicates no CPU limit.

§cpuunits: Option<()>

CPU weight for a container, will be clamped to [1, 10000] in cgroup v2. CPU weight for a container. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this container gets. Number is relative to the weights of all the other running guests.

§debug: Option<bool>

Try to be more verbose. For now this only enables debug log-level on start.

§description: Option<String>

Description for the Container. Shown in the web-interface CT’s summary. This is saved as comment inside the configuration file.

§devs: HashMap<u32, String>

Device to pass through to the container

§features: Option<String>

Allow containers access to advanced features.

§force: Option<bool>

Allow to overwrite existing container.

§hookscript: Option<String>

Script that will be exectued during various steps in the containers lifetime.

§hostname: Option<String>

Set a host name for the container.

§ignore_unpack_errors: Option<bool>

Ignore errors when extracting the template.

§lock: Option<Lock>

Lock/unlock the container.

§memory: Option<u64>

Amount of RAM for the container in MB.

§mps: HashMap<u32, String>

Use volume as container mount point. Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume.

§nameserver: Option<String>

Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.

§nets: HashMap<u32, String>

Specifies network interfaces for the container.

§onboot: Option<bool>

Specifies whether a container will be started during system bootup.

§ostemplate: String

The OS template or backup file.

§ostype: Option<Ostype>

OS type. This is used to setup configuration inside the container, and corresponds to lxc setup scripts in /usr/share/lxc/config/<ostype>.common.conf. Value ‘unmanaged’ can be used to skip and OS specific setup.

§password: Option<String>

Sets root password inside container.

§pool: Option<String>

Add the VM to the specified pool.

§protection: Option<bool>

Sets the protection flag of the container. This will prevent the CT or CT’s disk remove/update operation.

§restore: Option<bool>

Mark this as restore task.

§rootfs: Option<String>

Use volume as container root.

§searchdomain: Option<String>

Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.

§ssh_public_keys: Option<String>

Setup public SSH keys (one key per line, OpenSSH format).

§start: Option<bool>

Start the CT after its creation finished successfully.

§startup: Option<String>

Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the ‘up’ or ‘down’ delay in seconds, which specifies a delay to wait before the next VM is started or stopped.

§storage: Option<String>

Default Storage.

§swap: Option<u64>

Amount of SWAP for the container in MB.

§tags: Option<String>

Tags of the Container. This is only meta information.

§template: Option<bool>

Enable/disable Template.

§timezone: Option<String>

Time zone to use in the container. If option isn’t set, then nothing will be done. Can be set to ‘host’ to match the host time zone, or an arbitrary time zone option from /usr/share/zoneinfo/zone.tab

§tty: Option<u64>

Specify the number of tty available to the container

§unique: Option<bool>

Assign a unique random ethernet address.

§unprivileged: Option<bool>

Makes the container run as unprivileged user. (Should not be modified manually.)

§unuseds: HashMap<u32, String>

Reference to unused volumes. This is used internally, and should not be modified manually.

§vmid: VmId

The (unique) ID of the VM.

§additional_properties: HashMap<String, Value>

Implementations§

Source§

impl PostParams

Source

pub fn new(ostemplate: String, vmid: VmId) -> Self

Trait Implementations§

Source§

impl Clone for PostParams

Source§

fn clone(&self) -> PostParams

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PostParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PostParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PostParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Test for PostParams

Source§

fn test_fn() -> fn(&str) -> bool

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,