Skip to main content

clientapi_pve/models/
nodes_network_create_network_request.rs

1/*
2 * Proxmox Virtual Environment API
3 *
4 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
5 *
6 * The version of the OpenAPI document: 9.x
7 * 
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 NodesNetworkCreateNetworkRequest {
16
17    /// IP address.
18    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
19    pub address: Option<String>,
20
21    /// IP address.
22    #[serde(rename = "address6", skip_serializing_if = "Option::is_none")]
23    pub address6: Option<String>,
24
25    /// Automatically start interface on boot.
26    #[serde(rename = "autostart", skip_serializing_if = "Option::is_none")]
27    pub autostart: Option<models::PveBoolean>,
28
29    /// Specify the primary interface for active-backup bond.
30    #[serde(rename = "bond-primary", skip_serializing_if = "Option::is_none")]
31    pub bond_primary: Option<String>,
32
33    /// Bonding mode.
34    #[serde(rename = "bond_mode", skip_serializing_if = "Option::is_none")]
35    pub bond_mode: Option<models::PveBondModeEnum>,
36
37    /// Selects the transmit hash policy to use for slave selection in balance-xor and 802.3ad modes.
38    #[serde(rename = "bond_xmit_hash_policy", skip_serializing_if = "Option::is_none")]
39    pub bond_xmit_hash_policy: Option<models::PveBondXmitHashPolicyEnum>,
40
41    /// Specify the interfaces you want to add to your bridge.
42    #[serde(rename = "bridge_ports", skip_serializing_if = "Option::is_none")]
43    pub bridge_ports: Option<String>,
44
45    /// Specify the allowed VLANs. For example: '2 4 100-200'. Only used if the bridge is VLAN aware.
46    #[serde(rename = "bridge_vids", skip_serializing_if = "Option::is_none")]
47    pub bridge_vids: Option<String>,
48
49    /// Enable bridge vlan support.
50    #[serde(rename = "bridge_vlan_aware", skip_serializing_if = "Option::is_none")]
51    pub bridge_vlan_aware: Option<models::PveBoolean>,
52
53    /// IPv4 CIDR.
54    #[serde(rename = "cidr", skip_serializing_if = "Option::is_none")]
55    pub cidr: Option<String>,
56
57    /// IPv6 CIDR.
58    #[serde(rename = "cidr6", skip_serializing_if = "Option::is_none")]
59    pub cidr6: Option<String>,
60
61    /// Comments
62    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
63    pub comments: Option<String>,
64
65    /// Comments
66    #[serde(rename = "comments6", skip_serializing_if = "Option::is_none")]
67    pub comments6: Option<String>,
68
69    /// Default gateway address.
70    #[serde(rename = "gateway", skip_serializing_if = "Option::is_none")]
71    pub gateway: Option<String>,
72
73    /// Default ipv6 gateway address.
74    #[serde(rename = "gateway6", skip_serializing_if = "Option::is_none")]
75    pub gateway6: Option<String>,
76
77    /// Network interface name.
78    #[serde(rename = "iface")]
79    pub iface: String,
80
81    /// MTU.
82    #[serde(rename = "mtu", skip_serializing_if = "Option::is_none")]
83    pub mtu: Option<i32>,
84
85    /// Network mask.
86    #[serde(rename = "netmask", skip_serializing_if = "Option::is_none")]
87    pub netmask: Option<String>,
88
89    /// Network mask.
90    #[serde(rename = "netmask6", skip_serializing_if = "Option::is_none")]
91    pub netmask6: Option<i32>,
92
93    /// Specify the interfaces used by the bonding device.
94    #[serde(rename = "ovs_bonds", skip_serializing_if = "Option::is_none")]
95    pub ovs_bonds: Option<String>,
96
97    /// The OVS bridge associated with a OVS port. This is required when you create an OVS port.
98    #[serde(rename = "ovs_bridge", skip_serializing_if = "Option::is_none")]
99    pub ovs_bridge: Option<String>,
100
101    /// OVS interface options.
102    #[serde(rename = "ovs_options", skip_serializing_if = "Option::is_none")]
103    pub ovs_options: Option<String>,
104
105    /// Specify the interfaces you want to add to your bridge.
106    #[serde(rename = "ovs_ports", skip_serializing_if = "Option::is_none")]
107    pub ovs_ports: Option<String>,
108
109    /// Specify a VLan tag (used by OVSPort, OVSIntPort, OVSBond)
110    #[serde(rename = "ovs_tag", skip_serializing_if = "Option::is_none")]
111    pub ovs_tag: Option<i32>,
112
113    /// Specify the interfaces used by the bonding device.
114    #[serde(rename = "slaves", skip_serializing_if = "Option::is_none")]
115    pub slaves: Option<String>,
116
117    /// Network interface type
118    #[serde(rename = "type")]
119    pub r#type: models::PveNodesNetworkTypeTypeEnum,
120
121    /// vlan-id for a custom named vlan interface (ifupdown2 only).
122    #[serde(rename = "vlan-id", skip_serializing_if = "Option::is_none")]
123    pub vlan_id: Option<i32>,
124
125    /// Specify the raw interface for the vlan interface.
126    #[serde(rename = "vlan-raw-device", skip_serializing_if = "Option::is_none")]
127    pub vlan_raw_device: Option<String>,
128
129
130}
131
132impl NodesNetworkCreateNetworkRequest {
133    pub fn new(iface: String, r#type: models::PveNodesNetworkTypeTypeEnum) -> NodesNetworkCreateNetworkRequest {
134        NodesNetworkCreateNetworkRequest {
135            
136            address: None,
137            
138            address6: None,
139            
140            autostart: None,
141            
142            bond_primary: None,
143            
144            bond_mode: None,
145            
146            bond_xmit_hash_policy: None,
147            
148            bridge_ports: None,
149            
150            bridge_vids: None,
151            
152            bridge_vlan_aware: None,
153            
154            cidr: None,
155            
156            cidr6: None,
157            
158            comments: None,
159            
160            comments6: None,
161            
162            gateway: None,
163            
164            gateway6: None,
165            
166            iface,
167            
168            mtu: None,
169            
170            netmask: None,
171            
172            netmask6: None,
173            
174            ovs_bonds: None,
175            
176            ovs_bridge: None,
177            
178            ovs_options: None,
179            
180            ovs_ports: None,
181            
182            ovs_tag: None,
183            
184            slaves: None,
185            
186            r#type,
187            
188            vlan_id: None,
189            
190            vlan_raw_device: None,
191            
192        }
193    }
194}
195
196