podman_autogen_api/models/
resources.rs

1/*
2 * supports a RESTful API for the Libpod library
3 *
4 * This documentation describes the Podman v2.x+ RESTful API. It consists of a Docker-compatible API and a Libpod API providing support for Podman’s unique features such as pods.  To start the service and keep it running for 5,000 seconds (-t 0 runs forever):  podman system service -t 5000 &  You can then use cURL on the socket using requests documented below.  NOTE: if you install the package podman-docker, it will create a symbolic link for /run/docker.sock to /run/podman/podman.sock  NOTE: Some fields in the API response JSON are encoded as omitempty, which means that if said field has a zero value, they will not be encoded in the API response. This is a feature to help reduce the size of the JSON responses returned via the API.  NOTE: Due to the limitations of [go-swagger](https://github.com/go-swagger/go-swagger), some field values that have a complex type show up as null in the docs as well as in the API responses. This is because the zero value for the field type is null. The field description in the docs will state what type the field is expected to be for such cases.  See podman-system-service(1) for more information.  Quick Examples:  'podman info'  curl --unix-socket /run/podman/podman.sock http://d/v5.0.0/libpod/info  'podman pull quay.io/containers/podman'  curl -XPOST --unix-socket /run/podman/podman.sock -v 'http://d/v5.0.0/images/create?fromImage=quay.io%2Fcontainers%2Fpodman'  'podman list images'  curl --unix-socket /run/podman/podman.sock -v 'http://d/v5.0.0/libpod/images/json' | jq
5 *
6 * The version of the OpenAPI document: 5.0.0
7 * Contact: podman@lists.podman.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Resources : Resources contains container's resources (cgroups config, ulimits...)
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Resources {
17    #[serde(rename = "BlkioDeviceReadBps", skip_serializing_if = "Option::is_none")]
18    pub blkio_device_read_bps: Option<Vec<models::ThrottleDevice>>,
19    #[serde(
20        rename = "BlkioDeviceReadIOps",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub blkio_device_read_i_ops: Option<Vec<models::ThrottleDevice>>,
24    #[serde(
25        rename = "BlkioDeviceWriteBps",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub blkio_device_write_bps: Option<Vec<models::ThrottleDevice>>,
29    #[serde(
30        rename = "BlkioDeviceWriteIOps",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub blkio_device_write_i_ops: Option<Vec<models::ThrottleDevice>>,
34    #[serde(rename = "BlkioWeight", skip_serializing_if = "Option::is_none")]
35    pub blkio_weight: Option<i32>,
36    #[serde(rename = "BlkioWeightDevice", skip_serializing_if = "Option::is_none")]
37    pub blkio_weight_device: Option<Vec<models::WeightDevice>>,
38    /// Applicable to UNIX platforms
39    #[serde(rename = "CgroupParent", skip_serializing_if = "Option::is_none")]
40    pub cgroup_parent: Option<String>,
41    /// Applicable to Windows
42    #[serde(rename = "CpuCount", skip_serializing_if = "Option::is_none")]
43    pub cpu_count: Option<i64>,
44    #[serde(rename = "CpuPercent", skip_serializing_if = "Option::is_none")]
45    pub cpu_percent: Option<i64>,
46    #[serde(rename = "CpuPeriod", skip_serializing_if = "Option::is_none")]
47    pub cpu_period: Option<i64>,
48    #[serde(rename = "CpuQuota", skip_serializing_if = "Option::is_none")]
49    pub cpu_quota: Option<i64>,
50    #[serde(rename = "CpuRealtimePeriod", skip_serializing_if = "Option::is_none")]
51    pub cpu_realtime_period: Option<i64>,
52    #[serde(rename = "CpuRealtimeRuntime", skip_serializing_if = "Option::is_none")]
53    pub cpu_realtime_runtime: Option<i64>,
54    /// Applicable to all platforms
55    #[serde(rename = "CpuShares", skip_serializing_if = "Option::is_none")]
56    pub cpu_shares: Option<i64>,
57    #[serde(rename = "CpusetCpus", skip_serializing_if = "Option::is_none")]
58    pub cpuset_cpus: Option<String>,
59    #[serde(rename = "CpusetMems", skip_serializing_if = "Option::is_none")]
60    pub cpuset_mems: Option<String>,
61    #[serde(rename = "DeviceCgroupRules", skip_serializing_if = "Option::is_none")]
62    pub device_cgroup_rules: Option<Vec<String>>,
63    #[serde(rename = "DeviceRequests", skip_serializing_if = "Option::is_none")]
64    pub device_requests: Option<Vec<models::DeviceRequest>>,
65    #[serde(rename = "Devices", skip_serializing_if = "Option::is_none")]
66    pub devices: Option<Vec<models::DeviceMapping>>,
67    #[serde(rename = "IOMaximumBandwidth", skip_serializing_if = "Option::is_none")]
68    pub io_maximum_bandwidth: Option<i32>,
69    #[serde(rename = "IOMaximumIOps", skip_serializing_if = "Option::is_none")]
70    pub io_maximum_i_ops: Option<i32>,
71    /// KernelMemory specifies the kernel memory limit (in bytes) for the container. Deprecated: kernel 5.4 deprecated kmem.limit_in_bytes.
72    #[serde(rename = "KernelMemory", skip_serializing_if = "Option::is_none")]
73    pub kernel_memory: Option<i64>,
74    #[serde(rename = "KernelMemoryTCP", skip_serializing_if = "Option::is_none")]
75    pub kernel_memory_tcp: Option<i64>,
76    #[serde(rename = "Memory", skip_serializing_if = "Option::is_none")]
77    pub memory: Option<i64>,
78    #[serde(rename = "MemoryReservation", skip_serializing_if = "Option::is_none")]
79    pub memory_reservation: Option<i64>,
80    #[serde(rename = "MemorySwap", skip_serializing_if = "Option::is_none")]
81    pub memory_swap: Option<i64>,
82    #[serde(rename = "MemorySwappiness", skip_serializing_if = "Option::is_none")]
83    pub memory_swappiness: Option<i64>,
84    #[serde(rename = "NanoCpus", skip_serializing_if = "Option::is_none")]
85    pub nano_cpus: Option<i64>,
86    #[serde(rename = "OomKillDisable", skip_serializing_if = "Option::is_none")]
87    pub oom_kill_disable: Option<bool>,
88    #[serde(rename = "PidsLimit", skip_serializing_if = "Option::is_none")]
89    pub pids_limit: Option<i64>,
90    #[serde(rename = "Ulimits", skip_serializing_if = "Option::is_none")]
91    pub ulimits: Option<Vec<models::Ulimit>>,
92}
93
94impl Resources {
95    /// Resources contains container's resources (cgroups config, ulimits...)
96    pub fn new() -> Resources {
97        Resources {
98            blkio_device_read_bps: None,
99            blkio_device_read_i_ops: None,
100            blkio_device_write_bps: None,
101            blkio_device_write_i_ops: None,
102            blkio_weight: None,
103            blkio_weight_device: None,
104            cgroup_parent: None,
105            cpu_count: None,
106            cpu_percent: None,
107            cpu_period: None,
108            cpu_quota: None,
109            cpu_realtime_period: None,
110            cpu_realtime_runtime: None,
111            cpu_shares: None,
112            cpuset_cpus: None,
113            cpuset_mems: None,
114            device_cgroup_rules: None,
115            device_requests: None,
116            devices: None,
117            io_maximum_bandwidth: None,
118            io_maximum_i_ops: None,
119            kernel_memory: None,
120            kernel_memory_tcp: None,
121            memory: None,
122            memory_reservation: None,
123            memory_swap: None,
124            memory_swappiness: None,
125            nano_cpus: None,
126            oom_kill_disable: None,
127            pids_limit: None,
128            ulimits: None,
129        }
130    }
131}