podman_autogen_api/models/
inspect_network_settings.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/// InspectNetworkSettings : InspectNetworkSettings holds information about the network settings of the container. Many fields are maintained only for compatibility with `docker inspect` and are unused within Libpod.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct InspectNetworkSettings {
17    /// AdditionalMacAddresses is a set of additional MAC Addresses beyond the first. CNI may configure more than one interface for a single network, which can cause this.
18    #[serde(
19        rename = "AdditionalMACAddresses",
20        skip_serializing_if = "Option::is_none"
21    )]
22    pub additional_mac_addresses: Option<Vec<String>>,
23    #[serde(rename = "Bridge", skip_serializing_if = "Option::is_none")]
24    pub bridge: Option<String>,
25    /// EndpointID is unused, maintained exclusively for compatibility.
26    #[serde(rename = "EndpointID", skip_serializing_if = "Option::is_none")]
27    pub endpoint_id: Option<String>,
28    /// Gateway is the IP address of the gateway this network will use.
29    #[serde(rename = "Gateway", skip_serializing_if = "Option::is_none")]
30    pub gateway: Option<String>,
31    /// GlobalIPv6Address is the global-scope IPv6 Address for this network.
32    #[serde(rename = "GlobalIPv6Address", skip_serializing_if = "Option::is_none")]
33    pub global_ipv6_address: Option<String>,
34    /// GlobalIPv6PrefixLen is the length of the subnet mask of this network.
35    #[serde(
36        rename = "GlobalIPv6PrefixLen",
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub global_ipv6_prefix_len: Option<i64>,
40    #[serde(rename = "HairpinMode", skip_serializing_if = "Option::is_none")]
41    pub hairpin_mode: Option<bool>,
42    /// IPAddress is the IP address for this network.
43    #[serde(rename = "IPAddress", skip_serializing_if = "Option::is_none")]
44    pub ip_address: Option<String>,
45    /// IPPrefixLen is the length of the subnet mask of this network.
46    #[serde(rename = "IPPrefixLen", skip_serializing_if = "Option::is_none")]
47    pub ip_prefix_len: Option<i64>,
48    /// IPv6Gateway is the IPv6 gateway this network will use.
49    #[serde(rename = "IPv6Gateway", skip_serializing_if = "Option::is_none")]
50    pub ipv6_gateway: Option<String>,
51    #[serde(
52        rename = "LinkLocalIPv6Address",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub link_local_ipv6_address: Option<String>,
56    #[serde(
57        rename = "LinkLocalIPv6PrefixLen",
58        skip_serializing_if = "Option::is_none"
59    )]
60    pub link_local_ipv6_prefix_len: Option<i64>,
61    /// MacAddress is the MAC address for the interface in this network.
62    #[serde(rename = "MacAddress", skip_serializing_if = "Option::is_none")]
63    pub mac_address: Option<String>,
64    /// Networks contains information on non-default networks this container has joined. It is a map of network name to network information.
65    #[serde(rename = "Networks", skip_serializing_if = "Option::is_none")]
66    pub networks: Option<std::collections::HashMap<String, models::InspectAdditionalNetwork>>,
67    #[serde(rename = "Ports", skip_serializing_if = "Option::is_none")]
68    pub ports: Option<std::collections::HashMap<String, Option<Vec<models::InspectHostPort>>>>,
69    #[serde(rename = "SandboxID", skip_serializing_if = "Option::is_none")]
70    pub sandbox_id: Option<String>,
71    #[serde(rename = "SandboxKey", skip_serializing_if = "Option::is_none")]
72    pub sandbox_key: Option<String>,
73    /// SecondaryIPAddresses is a list of extra IP Addresses that the container has been assigned in this network.
74    #[serde(
75        rename = "SecondaryIPAddresses",
76        skip_serializing_if = "Option::is_none"
77    )]
78    pub secondary_ip_addresses: Option<Vec<models::Address>>,
79    /// SecondaryIPv6Addresses is a list of extra IPv6 Addresses that the container has been assigned in this network.
80    #[serde(
81        rename = "SecondaryIPv6Addresses",
82        skip_serializing_if = "Option::is_none"
83    )]
84    pub secondary_ipv6_addresses: Option<Vec<models::Address>>,
85}
86
87impl InspectNetworkSettings {
88    /// InspectNetworkSettings holds information about the network settings of the container. Many fields are maintained only for compatibility with `docker inspect` and are unused within Libpod.
89    pub fn new() -> InspectNetworkSettings {
90        InspectNetworkSettings {
91            additional_mac_addresses: None,
92            bridge: None,
93            endpoint_id: None,
94            gateway: None,
95            global_ipv6_address: None,
96            global_ipv6_prefix_len: None,
97            hairpin_mode: None,
98            ip_address: None,
99            ip_prefix_len: None,
100            ipv6_gateway: None,
101            link_local_ipv6_address: None,
102            link_local_ipv6_prefix_len: None,
103            mac_address: None,
104            networks: None,
105            ports: None,
106            sandbox_id: None,
107            sandbox_key: None,
108            secondary_ip_addresses: None,
109            secondary_ipv6_addresses: None,
110        }
111    }
112}