podman_autogen_api/models/
linux_memory.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/// LinuxMemory : LinuxMemory for Linux cgroup 'memory' resource management
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct LinuxMemory {
17    /// CheckBeforeUpdate enables checking if a new memory limit is lower than the current usage during update, and if so, rejecting the new limit.
18    #[serde(rename = "checkBeforeUpdate", skip_serializing_if = "Option::is_none")]
19    pub check_before_update: Option<bool>,
20    /// DisableOOMKiller disables the OOM killer for out of memory conditions
21    #[serde(rename = "disableOOMKiller", skip_serializing_if = "Option::is_none")]
22    pub disable_oom_killer: Option<bool>,
23    /// Kernel memory limit (in bytes).  Deprecated: kernel-memory limits are not supported in cgroups v2, and were obsoleted in [kernel v5.4]. This field should no longer be used, as it may be ignored by runtimes.  [kernel v5.4]: https://github.com/torvalds/linux/commit/0158115f702b0ba208ab0
24    #[serde(rename = "kernel", skip_serializing_if = "Option::is_none")]
25    pub kernel: Option<i64>,
26    /// Kernel memory limit for tcp (in bytes)
27    #[serde(rename = "kernelTCP", skip_serializing_if = "Option::is_none")]
28    pub kernel_tcp: Option<i64>,
29    /// Memory limit (in bytes).
30    #[serde(rename = "limit", skip_serializing_if = "Option::is_none")]
31    pub limit: Option<i64>,
32    /// Memory reservation or soft_limit (in bytes).
33    #[serde(rename = "reservation", skip_serializing_if = "Option::is_none")]
34    pub reservation: Option<i64>,
35    /// Total memory limit (memory + swap).
36    #[serde(rename = "swap", skip_serializing_if = "Option::is_none")]
37    pub swap: Option<i64>,
38    /// How aggressive the kernel will swap memory pages.
39    #[serde(rename = "swappiness", skip_serializing_if = "Option::is_none")]
40    pub swappiness: Option<i32>,
41    /// Enables hierarchical memory accounting
42    #[serde(rename = "useHierarchy", skip_serializing_if = "Option::is_none")]
43    pub use_hierarchy: Option<bool>,
44}
45
46impl LinuxMemory {
47    /// LinuxMemory for Linux cgroup 'memory' resource management
48    pub fn new() -> LinuxMemory {
49        LinuxMemory {
50            check_before_update: None,
51            disable_oom_killer: None,
52            kernel: None,
53            kernel_tcp: None,
54            limit: None,
55            reservation: None,
56            swap: None,
57            swappiness: None,
58            use_hierarchy: None,
59        }
60    }
61}