liboci_cli/update.rs
1use std::path::PathBuf;
2
3use clap::Parser;
4
5/// Update running container resource constraints
6#[derive(Parser, Debug)]
7pub struct Update {
8 /// Read the new resource limits from the given json file. Use - to read from stdin.
9 /// If this option is used, all other options are ignored.
10 #[clap(short, long)]
11 pub resources: Option<PathBuf>,
12
13 /// Set a new I/O weight
14 #[clap(long)]
15 pub blkio_weight: Option<u64>,
16
17 /// Set CPU CFS period to be used for hardcapping (in microseconds)
18 #[clap(long)]
19 pub cpu_period: Option<u64>,
20
21 /// Set CPU usage limit within a given period (in microseconds)
22 #[clap(long)]
23 pub cpu_quota: Option<u64>,
24
25 /// Set CPU realtime period to be used for hardcapping (in microseconds)
26 #[clap(long)]
27 pub cpu_rt_period: Option<u64>,
28
29 /// Set CPU realtime hardcap limit (in microseconds)
30 #[clap(long)]
31 pub cpu_rt_runtime: Option<u64>,
32
33 /// Set CPU shares (relative weight vs. other containers)
34 #[clap(long)]
35 pub cpu_share: Option<u64>,
36
37 /// Set CPU(s) to use. The list can contain commas and ranges. For example: 0-3,7
38 #[clap(long)]
39 pub cpuset_cpus: Option<String>,
40
41 /// Set memory node(s) to use. The list format is the same as for --cpuset-cpus.
42 #[clap(long)]
43 pub cpuset_mems: Option<String>,
44
45 /// Set memory limit to num bytes.
46 #[clap(long)]
47 pub memory: Option<u64>,
48
49 /// Set memory reservation (or soft limit) to num bytes.
50 #[clap(long)]
51 pub memory_reservation: Option<u64>,
52
53 /// Set total memory + swap usage to num bytes. Use -1 to unset the limit (i.e. use unlimited swap).
54 #[clap(long)]
55 pub memory_swap: Option<i64>,
56
57 /// Set the maximum number of processes allowed in the container
58 #[clap(long)]
59 pub pids_limit: Option<i64>,
60
61 /// Set the value for Intel RDT/CAT L3 cache schema.
62 #[clap(long)]
63 pub l3_cache_schema: Option<String>,
64
65 /// Set the Intel RDT/MBA memory bandwidth schema.
66 #[clap(long)]
67 pub mem_bw_schema: Option<String>,
68
69 #[clap(value_parser = clap::builder::NonEmptyStringValueParser::new(), required = true)]
70 pub container_id: String,
71}