podman_autogen_api/models/
pod_network_config.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct PodNetworkConfig {
16    /// Map of networks names to ids the container should join to. 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.
17    #[serde(rename = "Networks", skip_serializing_if = "Option::is_none")]
18    pub networks: Option<std::collections::HashMap<String, models::PerNetworkOptions>>,
19    /// 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.
20    #[serde(rename = "cni_networks", skip_serializing_if = "Option::is_none")]
21    pub cni_networks: Option<Vec<String>>,
22    /// DNSOption is a set of DNS options that will be used in the infra container's resolv.conf, which will, by default, be shared with all containers in the pod. Conflicts with NoInfra=true. Optional.
23    #[serde(rename = "dns_option", skip_serializing_if = "Option::is_none")]
24    pub dns_option: Option<Vec<String>>,
25    /// DNSSearch is a set of DNS search domains that will be used in the infra container's resolv.conf, which will, by default, be shared with all containers in the pod. If not provided, DNS search domains from the host's resolv.conf will be used. Conflicts with NoInfra=true. Optional.
26    #[serde(rename = "dns_search", skip_serializing_if = "Option::is_none")]
27    pub dns_search: Option<Vec<String>>,
28    /// DNSServer is a set of DNS servers that will be used in the infra container's resolv.conf, which will, by default, be shared with all containers in the pod. If not provided, the host's DNS servers will be used, unless the only server set is a localhost address. As the container cannot connect to the host's localhost, a default server will instead be set. Conflicts with NoInfra=true. Optional.
29    #[serde(rename = "dns_server", skip_serializing_if = "Option::is_none")]
30    pub dns_server: Option<Vec<String>>,
31    /// HostAdd is a set of hosts that will be added to the infra container's etc/hosts that will, by default, be shared with all containers in the pod. Conflicts with NoInfra=true and NoManageHosts. Optional.
32    #[serde(rename = "hostadd", skip_serializing_if = "Option::is_none")]
33    pub hostadd: Option<Vec<String>>,
34    #[serde(rename = "netns", skip_serializing_if = "Option::is_none")]
35    pub netns: Option<Box<models::Namespace>>,
36    /// NetworkOptions are additional options for each network Optional.
37    #[serde(rename = "network_options", skip_serializing_if = "Option::is_none")]
38    pub network_options: Option<std::collections::HashMap<String, Vec<String>>>,
39    /// NoManageHosts indicates that /etc/hosts should not be managed by the pod. Instead, each container will create a separate /etc/hosts as they would if not in a pod. Conflicts with HostAdd.
40    #[serde(rename = "no_manage_hosts", skip_serializing_if = "Option::is_none")]
41    pub no_manage_hosts: Option<bool>,
42    /// NoManageResolvConf indicates that /etc/resolv.conf should not be managed by the pod. Instead, each container will create and manage a separate resolv.conf as if they had not joined a pod. Conflicts with NoInfra=true and DNSServer, DNSSearch, DNSOption. Optional.
43    #[serde(
44        rename = "no_manage_resolv_conf",
45        skip_serializing_if = "Option::is_none"
46    )]
47    pub no_manage_resolv_conf: Option<bool>,
48    /// PortMappings is a set of ports to map into the infra container. As, by default, containers share their network with the infra container, this will forward the ports to the entire pod. Only available if NetNS is set to Bridge, Slirp, or Pasta. Optional.
49    #[serde(rename = "portmappings", skip_serializing_if = "Option::is_none")]
50    pub portmappings: Option<Vec<models::PortMapping>>,
51}
52
53impl PodNetworkConfig {
54    pub fn new() -> PodNetworkConfig {
55        PodNetworkConfig {
56            networks: None,
57            cni_networks: None,
58            dns_option: None,
59            dns_search: None,
60            dns_server: None,
61            hostadd: None,
62            netns: None,
63            network_options: None,
64            no_manage_hosts: None,
65            no_manage_resolv_conf: None,
66            portmappings: None,
67        }
68    }
69}