podman_autogen_api/models/
network.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 Network {
16    /// Created contains the timestamp when this network was created.
17    #[serde(rename = "created", skip_serializing_if = "Option::is_none")]
18    pub created: Option<String>,
19    /// DNSEnabled is whether name resolution is active for container on this Network. Only supported with the bridge driver.
20    #[serde(rename = "dns_enabled", skip_serializing_if = "Option::is_none")]
21    pub dns_enabled: Option<bool>,
22    /// Driver for this Network, e.g. bridge, macvlan...
23    #[serde(rename = "driver", skip_serializing_if = "Option::is_none")]
24    pub driver: Option<String>,
25    /// ID of the Network.
26    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
27    pub id: Option<String>,
28    /// Internal is whether the Network should not have external routes to public or other Networks.
29    #[serde(rename = "internal", skip_serializing_if = "Option::is_none")]
30    pub internal: Option<bool>,
31    /// IPAMOptions contains options used for the ip assignment.
32    #[serde(rename = "ipam_options", skip_serializing_if = "Option::is_none")]
33    pub ipam_options: Option<std::collections::HashMap<String, String>>,
34    /// IPv6Enabled if set to true an ipv6 subnet should be created for this net.
35    #[serde(rename = "ipv6_enabled", skip_serializing_if = "Option::is_none")]
36    pub ipv6_enabled: Option<bool>,
37    /// Labels is a set of key-value labels that have been applied to the Network.
38    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
39    pub labels: Option<std::collections::HashMap<String, String>>,
40    /// Name of the Network.
41    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
42    pub name: Option<String>,
43    /// List of custom DNS server for podman's DNS resolver at network level, all the containers attached to this network will consider resolvers configured at network level.
44    #[serde(
45        rename = "network_dns_servers",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub network_dns_servers: Option<Vec<String>>,
49    /// NetworkInterface is the network interface name on the host.
50    #[serde(rename = "network_interface", skip_serializing_if = "Option::is_none")]
51    pub network_interface: Option<String>,
52    /// Options is a set of key-value options that have been applied to the Network.
53    #[serde(rename = "options", skip_serializing_if = "Option::is_none")]
54    pub options: Option<std::collections::HashMap<String, String>>,
55    /// Routes to use for this network.
56    #[serde(rename = "routes", skip_serializing_if = "Option::is_none")]
57    pub routes: Option<Vec<models::Route>>,
58    /// Subnets to use for this network.
59    #[serde(rename = "subnets", skip_serializing_if = "Option::is_none")]
60    pub subnets: Option<Vec<models::Subnet>>,
61}
62
63impl Network {
64    pub fn new() -> Network {
65        Network {
66            created: None,
67            dns_enabled: None,
68            driver: None,
69            id: None,
70            internal: None,
71            ipam_options: None,
72            ipv6_enabled: None,
73            labels: None,
74            name: None,
75            network_dns_servers: None,
76            network_interface: None,
77            options: None,
78            routes: None,
79            subnets: None,
80        }
81    }
82}