1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527
/*
* supports a RESTful API for the Libpod library
*
* 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
*
* The version of the OpenAPI document: 5.0.0
* Contact: podman@lists.podman.io
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// SpecGenerator : SpecGenerator creates an OCI spec and Libpod configuration options to create a container based on the given configuration.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SpecGenerator {
/// Map of networks names or ids that the container should join. You can request additional settings for each network, you can set network aliases, static ips, static mac address and the network interface name for this container on the specific network. If the map is empty and the bridge network mode is set the container will be joined to the default network. Optional.
#[serde(rename = "Networks", skip_serializing_if = "Option::is_none")]
pub networks: Option<std::collections::HashMap<String, models::PerNetworkOptions>>,
/// Annotations are key-value options passed into the container runtime that can be used to trigger special behavior. Optional.
#[serde(rename = "annotations", skip_serializing_if = "Option::is_none")]
pub annotations: Option<std::collections::HashMap<String, String>>,
/// ApparmorProfile is the name of the Apparmor profile the container will use. Optional.
#[serde(rename = "apparmor_profile", skip_serializing_if = "Option::is_none")]
pub apparmor_profile: Option<String>,
/// BaseHostsFile is the path to a hosts file, the entries from this file are added to the containers hosts file. As special value \"image\" is allowed which uses the /etc/hosts file from within the image and \"none\" which uses no base file at all. If it is empty we should default to the base_hosts_file configuration in containers.conf. Optional.
#[serde(rename = "base_hosts_file", skip_serializing_if = "Option::is_none")]
pub base_hosts_file: Option<String>,
/// CapAdd are capabilities which will be added to the container. Conflicts with Privileged. Optional.
#[serde(rename = "cap_add", skip_serializing_if = "Option::is_none")]
pub cap_add: Option<Vec<String>>,
/// CapDrop are capabilities which will be removed from the container. Conflicts with Privileged. Optional.
#[serde(rename = "cap_drop", skip_serializing_if = "Option::is_none")]
pub cap_drop: Option<Vec<String>>,
/// CgroupParent is the container's Cgroup parent. If not set, the default for the current cgroup driver will be used. Optional.
#[serde(rename = "cgroup_parent", skip_serializing_if = "Option::is_none")]
pub cgroup_parent: Option<String>,
#[serde(rename = "cgroupns", skip_serializing_if = "Option::is_none")]
pub cgroupns: Option<Box<models::Namespace>>,
/// CgroupsMode sets a policy for how cgroups will be created for the container, including the ability to disable creation entirely. Optional.
#[serde(rename = "cgroups_mode", skip_serializing_if = "Option::is_none")]
pub cgroups_mode: Option<String>,
/// ChrootDirs is an additional set of directories that need to be treated as root directories. Standard bind mounts will be mounted into paths relative to these directories. Optional.
#[serde(rename = "chroot_directories", skip_serializing_if = "Option::is_none")]
pub chroot_directories: Option<Vec<String>>,
/// CNINetworks is a list of CNI networks to join the container to. If this list is empty, the default CNI network will be joined instead. If at least one entry is present, we will not join the default network (unless it is part of this list). Only available if NetNS is set to bridge. Optional. Deprecated: as of podman 4.0 use \"Networks\" instead.
#[serde(rename = "cni_networks", skip_serializing_if = "Option::is_none")]
pub cni_networks: Option<Vec<String>>,
/// Command is the container's command. If not given and Image is specified, this will be populated by the image's configuration. Optional.
#[serde(rename = "command", skip_serializing_if = "Option::is_none")]
pub command: Option<Vec<String>>,
/// ConmonPidFile is a path at which a PID file for Conmon will be placed. If not given, a default location will be used. Optional.
#[serde(rename = "conmon_pid_file", skip_serializing_if = "Option::is_none")]
pub conmon_pid_file: Option<String>,
/// ContainerCreateCommand is the command that was used to create this container. This will be shown in the output of Inspect() on the container, and may also be used by some tools that wish to recreate the container (e.g. `podman generate systemd --new`). Optional.
#[serde(
rename = "containerCreateCommand",
skip_serializing_if = "Option::is_none"
)]
pub container_create_command: Option<Vec<String>>,
/// Create the working directory if it doesn't exist. If unset, it doesn't create it. Optional.
#[serde(rename = "create_working_dir", skip_serializing_if = "Option::is_none")]
pub create_working_dir: Option<bool>,
/// DependencyContainers is an array of containers this container depends on. Dependency containers must be started before this container. Dependencies can be specified by name or full/partial ID. Optional.
#[serde(
rename = "dependencyContainers",
skip_serializing_if = "Option::is_none"
)]
pub dependency_containers: Option<Vec<String>>,
/// DeviceCgroupRule are device cgroup rules that allow containers to use additional types of devices.
#[serde(rename = "device_cgroup_rule", skip_serializing_if = "Option::is_none")]
pub device_cgroup_rule: Option<Vec<models::LinuxDeviceCgroup>>,
/// Devices are devices that will be added to the container. Optional.
#[serde(rename = "devices", skip_serializing_if = "Option::is_none")]
pub devices: Option<Vec<models::LinuxDevice>>,
/// DevicesFrom specifies that this container will mount the device(s) from other container(s). Optional.
#[serde(rename = "devices_from", skip_serializing_if = "Option::is_none")]
pub devices_from: Option<Vec<String>>,
/// DNSOptions is a set of DNS options that will be used in the container's resolv.conf, replacing the host's DNS options which are used by default. Conflicts with UseImageResolvConf. Optional.
#[serde(rename = "dns_option", skip_serializing_if = "Option::is_none")]
pub dns_option: Option<Vec<String>>,
/// DNSSearch is a set of DNS search domains that will be used in the container's resolv.conf, replacing the host's DNS search domains which are used by default. Conflicts with UseImageResolvConf. Optional.
#[serde(rename = "dns_search", skip_serializing_if = "Option::is_none")]
pub dns_search: Option<Vec<String>>,
/// DNSServers is a set of DNS servers that will be used in the container's resolv.conf, replacing the host's DNS Servers which are used by default. Conflicts with UseImageResolvConf. Optional.
#[serde(rename = "dns_server", skip_serializing_if = "Option::is_none")]
pub dns_server: Option<Vec<String>>,
/// Entrypoint is the container's entrypoint. If not given and Image is specified, this will be populated by the image's configuration. Optional.
#[serde(rename = "entrypoint", skip_serializing_if = "Option::is_none")]
pub entrypoint: Option<Vec<String>>,
/// Env is a set of environment variables that will be set in the container. Optional.
#[serde(rename = "env", skip_serializing_if = "Option::is_none")]
pub env: Option<std::collections::HashMap<String, String>>,
/// EnvHost indicates that the host environment should be added to container Optional.
#[serde(rename = "env_host", skip_serializing_if = "Option::is_none")]
pub env_host: Option<bool>,
/// EnvMerge takes the specified environment variables from image and preprocess them before injecting them into the container. Optional.
#[serde(rename = "envmerge", skip_serializing_if = "Option::is_none")]
pub envmerge: Option<Vec<String>>,
/// Expose is a number of ports that will be forwarded to the container if PublishExposedPorts is set. Expose is a map of uint16 (port number) to a string representing protocol i.e map[uint16]string. Allowed protocols are \"tcp\", \"udp\", and \"sctp\", or some combination of the three separated by commas. If protocol is set to \"\" we will assume TCP. Only available if NetNS is set to Bridge or Slirp, and PublishExposedPorts is set. Optional.
#[serde(rename = "expose", skip_serializing_if = "Option::is_none")]
pub expose: Option<serde_json::Value>,
/// GroupEntry specifies an arbitrary string to append to the container's /etc/group file. Optional.
#[serde(rename = "group_entry", skip_serializing_if = "Option::is_none")]
pub group_entry: Option<String>,
/// Groups are a list of supplemental groups the container's user will be granted access to. Optional.
#[serde(rename = "groups", skip_serializing_if = "Option::is_none")]
pub groups: Option<Vec<String>>,
/// HealthCheckOnFailureAction defines how Podman reacts when a container's health status turns unhealthy.
#[serde(
rename = "health_check_on_failure_action",
skip_serializing_if = "Option::is_none"
)]
pub health_check_on_failure_action: Option<i64>,
#[serde(rename = "healthconfig", skip_serializing_if = "Option::is_none")]
pub healthconfig: Option<Box<models::Schema2HealthConfig>>,
/// HostDeviceList is used to recreate the mounted device on inherited containers
#[serde(rename = "host_device_list", skip_serializing_if = "Option::is_none")]
pub host_device_list: Option<Vec<models::LinuxDevice>>,
/// HostAdd is a set of hosts which will be added to the container's etc/hosts file. Conflicts with UseImageHosts. Optional.
#[serde(rename = "hostadd", skip_serializing_if = "Option::is_none")]
pub hostadd: Option<Vec<String>>,
/// Hostname is the container's hostname. If not set, the hostname will not be modified (if UtsNS is not private) or will be set to the container ID (if UtsNS is private). Conflicts with UtsNS if UtsNS is not set to private. Optional.
#[serde(rename = "hostname", skip_serializing_if = "Option::is_none")]
pub hostname: Option<String>,
/// HostUsers is a list of host usernames or UIDs to add to the container etc/passwd file
#[serde(rename = "hostusers", skip_serializing_if = "Option::is_none")]
pub hostusers: Option<Vec<String>>,
/// EnvHTTPProxy indicates that the http host proxy environment variables should be added to container Optional.
#[serde(rename = "httpproxy", skip_serializing_if = "Option::is_none")]
pub httpproxy: Option<bool>,
#[serde(rename = "idmappings", skip_serializing_if = "Option::is_none")]
pub idmappings: Option<Box<models::IdMappingOptions>>,
/// Image is the image the container will be based on. The image will be used as the container's root filesystem, and its environment vars, volumes, and other configuration will be applied to the container. Conflicts with Rootfs. At least one of Image or Rootfs must be specified.
#[serde(rename = "image", skip_serializing_if = "Option::is_none")]
pub image: Option<String>,
/// ImageArch is the user-specified image architecture. Used to select a different variant from a manifest list. Optional.
#[serde(rename = "image_arch", skip_serializing_if = "Option::is_none")]
pub image_arch: Option<String>,
/// ImageOS is the user-specified OS of the image. Used to select a different variant from a manifest list. Optional.
#[serde(rename = "image_os", skip_serializing_if = "Option::is_none")]
pub image_os: Option<String>,
/// ImageVariant is the user-specified image variant. Used to select a different variant from a manifest list. Optional.
#[serde(rename = "image_variant", skip_serializing_if = "Option::is_none")]
pub image_variant: Option<String>,
/// ImageVolumeMode indicates how image volumes will be created. Supported modes are \"ignore\" (do not create), \"tmpfs\" (create as tmpfs), and \"anonymous\" (create as anonymous volumes). The default if unset is anonymous. Optional.
#[serde(rename = "image_volume_mode", skip_serializing_if = "Option::is_none")]
pub image_volume_mode: Option<String>,
/// Image volumes bind-mount a container-image mount into the container. Optional.
#[serde(rename = "image_volumes", skip_serializing_if = "Option::is_none")]
pub image_volumes: Option<Vec<models::ImageVolume>>,
/// Init specifies that an init binary will be mounted into the container, and will be used as PID1. Optional.
#[serde(rename = "init", skip_serializing_if = "Option::is_none")]
pub init: Option<bool>,
/// InitContainerType describes if this container is an init container and if so, what type: always or once. Optional.
#[serde(
rename = "init_container_type",
skip_serializing_if = "Option::is_none"
)]
pub init_container_type: Option<String>,
/// InitPath specifies the path to the init binary that will be added if Init is specified above. If not specified, the default set in the Libpod config will be used. Ignored if Init above is not set. Optional.
#[serde(rename = "init_path", skip_serializing_if = "Option::is_none")]
pub init_path: Option<String>,
#[serde(rename = "intelRdt", skip_serializing_if = "Option::is_none")]
pub intel_rdt: Option<Box<models::LinuxIntelRdt>>,
#[serde(rename = "ipcns", skip_serializing_if = "Option::is_none")]
pub ipcns: Option<Box<models::Namespace>>,
/// LabelNested indicates whether or not the container is allowed to run fully nested containers including SELinux labelling. Optional.
#[serde(rename = "label_nested", skip_serializing_if = "Option::is_none")]
pub label_nested: Option<bool>,
/// Labels are key-value pairs that are used to add metadata to containers. Optional.
#[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
pub labels: Option<std::collections::HashMap<String, String>>,
#[serde(rename = "log_configuration", skip_serializing_if = "Option::is_none")]
pub log_configuration: Option<Box<models::LogConfigLibpod>>,
/// Passwd is a container run option that determines if we are validating users/groups before running the container
#[serde(rename = "manage_password", skip_serializing_if = "Option::is_none")]
pub manage_password: Option<bool>,
/// Mask is the path we want to mask in the container. This masks the paths given in addition to the default list. Optional
#[serde(rename = "mask", skip_serializing_if = "Option::is_none")]
pub mask: Option<Vec<String>>,
/// Mounts are mounts that will be added to the container. These will supersede Image Volumes and VolumesFrom volumes where there are conflicts. Optional.
#[serde(rename = "mounts", skip_serializing_if = "Option::is_none")]
pub mounts: Option<Vec<models::Mount>>,
/// Name is the name the container will be given. If no name is provided, one will be randomly generated. Optional.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "netns", skip_serializing_if = "Option::is_none")]
pub netns: Option<Box<models::Namespace>>,
/// NetworkOptions are additional options for each network Optional.
#[serde(rename = "network_options", skip_serializing_if = "Option::is_none")]
pub network_options: Option<std::collections::HashMap<String, Vec<String>>>,
/// NoNewPrivileges is whether the container will set the no new privileges flag on create, which disables gaining additional privileges (e.g. via setuid) in the container. Optional.
#[serde(rename = "no_new_privileges", skip_serializing_if = "Option::is_none")]
pub no_new_privileges: Option<bool>,
/// OCIRuntime is the name of the OCI runtime that will be used to create the container. If not specified, the default will be used. Optional.
#[serde(rename = "oci_runtime", skip_serializing_if = "Option::is_none")]
pub oci_runtime: Option<String>,
/// OOMScoreAdj adjusts the score used by the OOM killer to determine processes to kill for the container's process. Optional.
#[serde(rename = "oom_score_adj", skip_serializing_if = "Option::is_none")]
pub oom_score_adj: Option<i64>,
/// Overlay volumes are named volumes that will be added to the container. Optional.
#[serde(rename = "overlay_volumes", skip_serializing_if = "Option::is_none")]
pub overlay_volumes: Option<Vec<models::OverlayVolume>>,
/// PasswdEntry specifies an arbitrary string to append to the container's /etc/passwd file. Optional.
#[serde(rename = "passwd_entry", skip_serializing_if = "Option::is_none")]
pub passwd_entry: Option<String>,
#[serde(rename = "personality", skip_serializing_if = "Option::is_none")]
pub personality: Option<Box<models::LinuxPersonality>>,
#[serde(rename = "pidns", skip_serializing_if = "Option::is_none")]
pub pidns: Option<Box<models::Namespace>>,
/// Pod is the ID of the pod the container will join. Optional.
#[serde(rename = "pod", skip_serializing_if = "Option::is_none")]
pub pod: Option<String>,
/// PortBindings is a set of ports to map into the container. Only available if NetNS is set to bridge, slirp, or pasta. Optional.
#[serde(rename = "portmappings", skip_serializing_if = "Option::is_none")]
pub portmappings: Option<Vec<models::PortMapping>>,
/// Privileged is whether the container is privileged. Privileged does the following: Adds all devices on the system to the container. Adds all capabilities to the container. Disables Seccomp, SELinux, and Apparmor confinement. (Though SELinux can be manually re-enabled). TODO: this conflicts with things. TODO: this does more. Optional.
#[serde(rename = "privileged", skip_serializing_if = "Option::is_none")]
pub privileged: Option<bool>,
/// ProcOpts are the options used for the proc mount.
#[serde(rename = "procfs_opts", skip_serializing_if = "Option::is_none")]
pub procfs_opts: Option<Vec<String>>,
/// PublishExposedPorts will publish ports specified in the image to random unused ports (guaranteed to be above 1024) on the host. This is based on ports set in Expose below, and any ports specified by the Image (if one is given). Only available if NetNS is set to Bridge or Slirp. Optional.
#[serde(
rename = "publish_image_ports",
skip_serializing_if = "Option::is_none"
)]
pub publish_image_ports: Option<bool>,
/// Rlimits are POSIX rlimits to apply to the container. Optional.
#[serde(rename = "r_limits", skip_serializing_if = "Option::is_none")]
pub r_limits: Option<Vec<models::PosixRlimit>>,
/// RawImageName is the user-specified and unprocessed input referring to a local or a remote image. Optional, but strongly encouraged to be set if Image is set.
#[serde(rename = "raw_image_name", skip_serializing_if = "Option::is_none")]
pub raw_image_name: Option<String>,
/// ReadOnlyFilesystem indicates that everything will be mounted as read-only. Optional.
#[serde(
rename = "read_only_filesystem",
skip_serializing_if = "Option::is_none"
)]
pub read_only_filesystem: Option<bool>,
/// ReadWriteTmpfs indicates that when running with a ReadOnlyFilesystem mount temporary file systems. Optional.
#[serde(rename = "read_write_tmpfs", skip_serializing_if = "Option::is_none")]
pub read_write_tmpfs: Option<bool>,
/// Remove indicates if the container should be removed once it has been started and exits. Optional.
#[serde(rename = "remove", skip_serializing_if = "Option::is_none")]
pub remove: Option<bool>,
#[serde(rename = "resource_limits", skip_serializing_if = "Option::is_none")]
pub resource_limits: Option<Box<models::LinuxResources>>,
/// RestartPolicy is the container's restart policy - an action which will be taken when the container exits. If not given, the default policy, which does nothing, will be used. Optional.
#[serde(rename = "restart_policy", skip_serializing_if = "Option::is_none")]
pub restart_policy: Option<String>,
/// RestartRetries is the number of attempts that will be made to restart the container. Only available when RestartPolicy is set to \"on-failure\". Optional.
#[serde(rename = "restart_tries", skip_serializing_if = "Option::is_none")]
pub restart_tries: Option<i32>,
/// Rootfs is the path to a directory that will be used as the container's root filesystem. No modification will be made to the directory, it will be directly mounted into the container as root. Conflicts with Image. At least one of Image or Rootfs must be specified.
#[serde(rename = "rootfs", skip_serializing_if = "Option::is_none")]
pub rootfs: Option<String>,
/// RootfsMapping specifies if there are UID/GID mappings to apply to the rootfs. Optional.
#[serde(rename = "rootfs_mapping", skip_serializing_if = "Option::is_none")]
pub rootfs_mapping: Option<String>,
/// RootfsOverlay tells if rootfs is actually an overlay on top of base path. Optional.
#[serde(rename = "rootfs_overlay", skip_serializing_if = "Option::is_none")]
pub rootfs_overlay: Option<bool>,
/// RootfsPropagation is the rootfs propagation mode for the container. If not set, the default of rslave will be used. Optional.
#[serde(rename = "rootfs_propagation", skip_serializing_if = "Option::is_none")]
pub rootfs_propagation: Option<String>,
/// Determine how to handle the NOTIFY_SOCKET - do we participate or pass it through \"container\" - let the OCI runtime deal with it, advertise conmon's MAINPID \"conmon-only\" - advertise conmon's MAINPID, send READY when started, don't pass to OCI \"ignore\" - unset NOTIFY_SOCKET Optional.
#[serde(rename = "sdnotifyMode", skip_serializing_if = "Option::is_none")]
pub sdnotify_mode: Option<String>,
/// SeccompPolicy determines which seccomp profile gets applied the container. valid values: empty,default,image
#[serde(rename = "seccomp_policy", skip_serializing_if = "Option::is_none")]
pub seccomp_policy: Option<String>,
/// SeccompProfilePath is the path to a JSON file containing the container's Seccomp profile. If not specified, no Seccomp profile will be used. Optional.
#[serde(
rename = "seccomp_profile_path",
skip_serializing_if = "Option::is_none"
)]
pub seccomp_profile_path: Option<String>,
/// EnvSecrets are secrets that will be set as environment variables Optional.
#[serde(rename = "secret_env", skip_serializing_if = "Option::is_none")]
pub secret_env: Option<std::collections::HashMap<String, String>>,
/// Secrets are the secrets that will be added to the container Optional.
#[serde(rename = "secrets", skip_serializing_if = "Option::is_none")]
pub secrets: Option<Vec<models::Secret>>,
/// SelinuxProcessLabel is the process label the container will use. If SELinux is enabled and this is not specified, a label will be automatically generated if not specified. Optional.
#[serde(rename = "selinux_opts", skip_serializing_if = "Option::is_none")]
pub selinux_opts: Option<Vec<String>>,
/// ShmSize is the size of the tmpfs to mount in at /dev/shm, in bytes. Conflicts with ShmSize if IpcNS is not private. Optional.
#[serde(rename = "shm_size", skip_serializing_if = "Option::is_none")]
pub shm_size: Option<i64>,
/// ShmSizeSystemd is the size of systemd-specific tmpfs mounts specifically /run, /run/lock, /var/log/journal and /tmp. Optional
#[serde(rename = "shm_size_systemd", skip_serializing_if = "Option::is_none")]
pub shm_size_systemd: Option<i64>,
#[serde(
rename = "startupHealthConfig",
skip_serializing_if = "Option::is_none"
)]
pub startup_health_config: Option<Box<models::StartupHealthCheck>>,
/// Stdin is whether the container will keep its STDIN open. Optional.
#[serde(rename = "stdin", skip_serializing_if = "Option::is_none")]
pub stdin: Option<bool>,
/// It implements the os.Signal interface.
#[serde(rename = "stop_signal", skip_serializing_if = "Option::is_none")]
pub stop_signal: Option<i64>,
/// StopTimeout is a timeout between the container's stop signal being sent and SIGKILL being sent. If not provided, the default will be used. If 0 is used, stop signal will not be sent, and SIGKILL will be sent instead. Optional.
#[serde(rename = "stop_timeout", skip_serializing_if = "Option::is_none")]
pub stop_timeout: Option<i32>,
/// StorageOpts is the container's storage options Optional.
#[serde(rename = "storage_opts", skip_serializing_if = "Option::is_none")]
pub storage_opts: Option<std::collections::HashMap<String, String>>,
/// Sysctl sets kernel parameters for the container
#[serde(rename = "sysctl", skip_serializing_if = "Option::is_none")]
pub sysctl: Option<std::collections::HashMap<String, String>>,
/// Systemd is whether the container will be started in systemd mode. Valid options are \"true\", \"false\", and \"always\". \"true\" enables this mode only if the binary run in the container is sbin/init or systemd. \"always\" unconditionally enables systemd mode. \"false\" unconditionally disables systemd mode. If enabled, mounts and stop signal will be modified. If set to \"always\" or set to \"true\" and conditionally triggered, conflicts with StopSignal. If not specified, \"false\" will be assumed. Optional.
#[serde(rename = "systemd", skip_serializing_if = "Option::is_none")]
pub systemd: Option<String>,
/// Terminal is whether the container will create a PTY. Optional.
#[serde(rename = "terminal", skip_serializing_if = "Option::is_none")]
pub terminal: Option<bool>,
/// IO read rate limit per cgroup per device, bytes per second
#[serde(
rename = "throttleReadBpsDevice",
skip_serializing_if = "Option::is_none"
)]
pub throttle_read_bps_device:
Option<std::collections::HashMap<String, models::LinuxThrottleDevice>>,
/// IO read rate limit per cgroup per device, IO per second
#[serde(
rename = "throttleReadIOPSDevice",
skip_serializing_if = "Option::is_none"
)]
pub throttle_read_iops_device:
Option<std::collections::HashMap<String, models::LinuxThrottleDevice>>,
/// IO write rate limit per cgroup per device, bytes per second
#[serde(
rename = "throttleWriteBpsDevice",
skip_serializing_if = "Option::is_none"
)]
pub throttle_write_bps_device:
Option<std::collections::HashMap<String, models::LinuxThrottleDevice>>,
/// IO write rate limit per cgroup per device, IO per second
#[serde(
rename = "throttleWriteIOPSDevice",
skip_serializing_if = "Option::is_none"
)]
pub throttle_write_iops_device:
Option<std::collections::HashMap<String, models::LinuxThrottleDevice>>,
/// Timeout is a maximum time in seconds the container will run before main process is sent SIGKILL. If 0 is used, signal will not be sent. Container can run indefinitely if they do not stop after the default termination signal. Optional.
#[serde(rename = "timeout", skip_serializing_if = "Option::is_none")]
pub timeout: Option<i32>,
/// Timezone is the timezone inside the container. Local means it has the same timezone as the host machine Optional.
#[serde(rename = "timezone", skip_serializing_if = "Option::is_none")]
pub timezone: Option<String>,
/// Umask is the umask the init process of the container will be run with.
#[serde(rename = "umask", skip_serializing_if = "Option::is_none")]
pub umask: Option<String>,
/// CgroupConf are key-value options passed into the container runtime that are used to configure cgroup v2. Optional.
#[serde(rename = "unified", skip_serializing_if = "Option::is_none")]
pub unified: Option<std::collections::HashMap<String, String>>,
/// Unmask a path in the container. Some paths are masked by default, preventing them from being accessed within the container; this undoes that masking. If ALL is passed, all paths will be unmasked. Optional.
#[serde(rename = "unmask", skip_serializing_if = "Option::is_none")]
pub unmask: Option<Vec<String>>,
/// UnsetEnv unsets the specified default environment variables from the image or from buildin or containers.conf Optional.
#[serde(rename = "unsetenv", skip_serializing_if = "Option::is_none")]
pub unsetenv: Option<Vec<String>>,
/// UnsetEnvAll unsetall default environment variables from the image or from buildin or containers.conf UnsetEnvAll unsets all default environment variables from the image or from buildin Optional.
#[serde(rename = "unsetenvall", skip_serializing_if = "Option::is_none")]
pub unsetenvall: Option<bool>,
/// UseImageHosts indicates that /etc/hosts should not be managed by Podman, and instead sourced from the image. Conflicts with HostAdd. Optional.
#[serde(rename = "use_image_hosts", skip_serializing_if = "Option::is_none")]
pub use_image_hosts: Option<bool>,
/// UseImageResolvConf indicates that resolv.conf should not be managed by Podman, but instead sourced from the image. Conflicts with DNSServer, DNSSearch, DNSOption. Optional.
#[serde(
rename = "use_image_resolve_conf",
skip_serializing_if = "Option::is_none"
)]
pub use_image_resolve_conf: Option<bool>,
/// User is the user the container will be run as. Can be given as a UID or a username; if a username, it will be resolved within the container, using the container's /etc/passwd. If unset, the container will be run as root. Optional.
#[serde(rename = "user", skip_serializing_if = "Option::is_none")]
pub user: Option<String>,
#[serde(rename = "userns", skip_serializing_if = "Option::is_none")]
pub userns: Option<Box<models::Namespace>>,
#[serde(rename = "utsns", skip_serializing_if = "Option::is_none")]
pub utsns: Option<Box<models::Namespace>>,
/// Volatile specifies whether the container storage can be optimized at the cost of not syncing all the dirty files in memory. Optional.
#[serde(rename = "volatile", skip_serializing_if = "Option::is_none")]
pub volatile: Option<bool>,
/// Volumes are named volumes that will be added to the container. These will supersede Image Volumes and VolumesFrom volumes where there are conflicts. Optional.
#[serde(rename = "volumes", skip_serializing_if = "Option::is_none")]
pub volumes: Option<Vec<models::NamedVolume>>,
/// VolumesFrom is a set of containers whose volumes will be added to this container. The name or ID of the container must be provided, and may optionally be followed by a : and then one or more comma-separated options. Valid options are 'ro', 'rw', and 'z'. Options will be used for all volumes sourced from the container. Optional.
#[serde(rename = "volumes_from", skip_serializing_if = "Option::is_none")]
pub volumes_from: Option<Vec<String>>,
/// Weight per cgroup per device, can override BlkioWeight
#[serde(rename = "weightDevice", skip_serializing_if = "Option::is_none")]
pub weight_device: Option<std::collections::HashMap<String, models::LinuxWeightDevice>>,
/// WorkDir is the container's working directory. If unset, the default, /, will be used. Optional.
#[serde(rename = "work_dir", skip_serializing_if = "Option::is_none")]
pub work_dir: Option<String>,
}
impl SpecGenerator {
/// SpecGenerator creates an OCI spec and Libpod configuration options to create a container based on the given configuration.
pub fn new() -> SpecGenerator {
SpecGenerator {
networks: None,
annotations: None,
apparmor_profile: None,
base_hosts_file: None,
cap_add: None,
cap_drop: None,
cgroup_parent: None,
cgroupns: None,
cgroups_mode: None,
chroot_directories: None,
cni_networks: None,
command: None,
conmon_pid_file: None,
container_create_command: None,
create_working_dir: None,
dependency_containers: None,
device_cgroup_rule: None,
devices: None,
devices_from: None,
dns_option: None,
dns_search: None,
dns_server: None,
entrypoint: None,
env: None,
env_host: None,
envmerge: None,
expose: None,
group_entry: None,
groups: None,
health_check_on_failure_action: None,
healthconfig: None,
host_device_list: None,
hostadd: None,
hostname: None,
hostusers: None,
httpproxy: None,
idmappings: None,
image: None,
image_arch: None,
image_os: None,
image_variant: None,
image_volume_mode: None,
image_volumes: None,
init: None,
init_container_type: None,
init_path: None,
intel_rdt: None,
ipcns: None,
label_nested: None,
labels: None,
log_configuration: None,
manage_password: None,
mask: None,
mounts: None,
name: None,
netns: None,
network_options: None,
no_new_privileges: None,
oci_runtime: None,
oom_score_adj: None,
overlay_volumes: None,
passwd_entry: None,
personality: None,
pidns: None,
pod: None,
portmappings: None,
privileged: None,
procfs_opts: None,
publish_image_ports: None,
r_limits: None,
raw_image_name: None,
read_only_filesystem: None,
read_write_tmpfs: None,
remove: None,
resource_limits: None,
restart_policy: None,
restart_tries: None,
rootfs: None,
rootfs_mapping: None,
rootfs_overlay: None,
rootfs_propagation: None,
sdnotify_mode: None,
seccomp_policy: None,
seccomp_profile_path: None,
secret_env: None,
secrets: None,
selinux_opts: None,
shm_size: None,
shm_size_systemd: None,
startup_health_config: None,
stdin: None,
stop_signal: None,
stop_timeout: None,
storage_opts: None,
sysctl: None,
systemd: None,
terminal: None,
throttle_read_bps_device: None,
throttle_read_iops_device: None,
throttle_write_bps_device: None,
throttle_write_iops_device: None,
timeout: None,
timezone: None,
umask: None,
unified: None,
unmask: None,
unsetenv: None,
unsetenvall: None,
use_image_hosts: None,
use_image_resolve_conf: None,
user: None,
userns: None,
utsns: None,
volatile: None,
volumes: None,
volumes_from: None,
weight_device: None,
work_dir: None,
}
}
}