pub struct ContainerUpdateRequest {Show 14 fields
pub cpu_shares: Option<i64>,
pub memory: Option<i64>,
pub cpu_period: Option<i64>,
pub cpu_quota: Option<i64>,
pub cpu_realtime_period: Option<i64>,
pub cpu_realtime_runtime: Option<i64>,
pub cpuset_cpus: Option<String>,
pub cpuset_mems: Option<String>,
pub memory_reservation: Option<i64>,
pub memory_swap: Option<i64>,
pub kernel_memory: Option<i64>,
pub blkio_weight: Option<u16>,
pub pids_limit: Option<i64>,
pub restart_policy: Option<ContainerUpdateRestartPolicy>,
}Expand description
Request body for POST /api/v1/containers/{id}/update.
Mirrors Docker Engine’s POST /containers/{id}/update body 1:1 so the
zlayer-docker compatibility shim can pass the wire payload straight
through. Every field is optional — only the fields present on the wire
are applied; unset fields are left untouched on the running container.
Field naming uses Docker’s PascalCase on the wire (CpuShares,
Memory, …) and snake_case on the Rust side. Subset of the full
Docker schema: ZLayer supports the resource knobs (cpu, memory, pids,
blkio) plus RestartPolicy. Windows-only fields (CpuCount,
IOMaximumIOps) and ulimits/devices are accepted on the wire but
silently ignored by the Linux runtimes.
Fields§
Relative CPU weight (cgroup cpu.weight or cpu.shares). Range
2-262144 on cgroup v2; 2-262144 mapped from 1-10000 on v1.
memory: Option<i64>Memory limit in bytes. Set 0 to remove the limit.
cpu_period: Option<i64>CPU CFS period in microseconds.
cpu_quota: Option<i64>CPU CFS quota in microseconds. Together with cpu_period defines
the fraction of a CPU the container may use.
cpu_realtime_period: Option<i64>CPU real-time period in microseconds.
cpu_realtime_runtime: Option<i64>CPU real-time runtime in microseconds.
cpuset_cpus: Option<String>CPUs allowed for execution (e.g. "0-3", "0,1").
cpuset_mems: Option<String>Memory nodes (NUMA) allowed for execution (e.g. "0-3").
memory_reservation: Option<i64>Soft memory limit in bytes. The kernel reclaims pages above this reservation when the host comes under memory pressure.
memory_swap: Option<i64>Total memory limit (memory + swap) in bytes. -1 removes the swap
limit, matching Docker semantics.
kernel_memory: Option<i64>Kernel memory limit in bytes (deprecated upstream; accepted for wire compatibility).
blkio_weight: Option<u16>Block IO weight (relative weight, range 10-1000).
pids_limit: Option<i64>PIDs limit. Set 0 or -1 for unlimited.
restart_policy: Option<ContainerUpdateRestartPolicy>New restart policy. When present, replaces the container’s stored restart policy. Docker applies this asynchronously: the next time the supervisor decides whether to restart, it consults the new policy.
Trait Implementations§
Source§impl Clone for ContainerUpdateRequest
impl Clone for ContainerUpdateRequest
Source§fn clone(&self) -> ContainerUpdateRequest
fn clone(&self) -> ContainerUpdateRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ComposeSchema for ContainerUpdateRequest
impl ComposeSchema for ContainerUpdateRequest
Source§impl Debug for ContainerUpdateRequest
impl Debug for ContainerUpdateRequest
Source§impl Default for ContainerUpdateRequest
impl Default for ContainerUpdateRequest
Source§fn default() -> ContainerUpdateRequest
fn default() -> ContainerUpdateRequest
Source§impl<'de> Deserialize<'de> for ContainerUpdateRequest
impl<'de> Deserialize<'de> for ContainerUpdateRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ContainerUpdateRequest
impl PartialEq for ContainerUpdateRequest
Source§impl Serialize for ContainerUpdateRequest
impl Serialize for ContainerUpdateRequest
Source§impl ToSchema for ContainerUpdateRequest
impl ToSchema for ContainerUpdateRequest
impl Eq for ContainerUpdateRequest
impl StructuralPartialEq for ContainerUpdateRequest
Auto Trait Implementations§
impl Freeze for ContainerUpdateRequest
impl RefUnwindSafe for ContainerUpdateRequest
impl Send for ContainerUpdateRequest
impl Sync for ContainerUpdateRequest
impl Unpin for ContainerUpdateRequest
impl UnsafeUnpin for ContainerUpdateRequest
impl UnwindSafe for ContainerUpdateRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.