Skip to main content

proxmox_api/generated/cluster/sdn/
zones.rs

1pub mod zone;
2#[derive(Debug, Clone)]
3pub struct ZonesClient<T> {
4    client: T,
5    path: String,
6}
7impl<T> ZonesClient<T>
8where
9    T: crate::client::Client,
10{
11    pub fn new(client: T, parent_path: &str) -> Self {
12        Self {
13            client,
14            path: format!("{}{}", parent_path, "/zones"),
15        }
16    }
17}
18impl<T> ZonesClient<T>
19where
20    T: crate::client::Client,
21{
22    #[doc = "SDN zones index."]
23    #[doc = ""]
24    #[doc = "Only list entries where you have 'SDN.Audit' or 'SDN.Allocate' permissions on '/sdn/zones/\\<zone\\>'"]
25    pub async fn get(&self, params: GetParams) -> Result<Vec<GetOutputItems>, T::Error> {
26        let path = self.path.to_string();
27        let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &params).await?;
28        Ok(optional_vec.unwrap_or_default())
29    }
30}
31impl<T> ZonesClient<T>
32where
33    T: crate::client::Client,
34{
35    #[doc = "Create a new sdn zone object."]
36    #[doc = ""]
37    #[doc = "Permission check: perm(\"/sdn/zones\", [\"SDN.Allocate\"])"]
38    pub async fn post(&self, params: PostParams) -> Result<(), T::Error> {
39        let path = self.path.to_string();
40        self.client.post(&path, &params).await
41    }
42}
43impl GetOutputItems {
44    pub fn new(ty: Type, zone: String) -> Self {
45        Self {
46            ty,
47            zone,
48            advertise_subnets: ::std::default::Default::default(),
49            bridge: ::std::default::Default::default(),
50            bridge_disable_mac_learning: ::std::default::Default::default(),
51            controller: ::std::default::Default::default(),
52            dhcp: ::std::default::Default::default(),
53            digest: ::std::default::Default::default(),
54            disable_arp_nd_suppression: ::std::default::Default::default(),
55            dns: ::std::default::Default::default(),
56            dnszone: ::std::default::Default::default(),
57            exitnodes: ::std::default::Default::default(),
58            exitnodes_local_routing: ::std::default::Default::default(),
59            exitnodes_primary: ::std::default::Default::default(),
60            ipam: ::std::default::Default::default(),
61            mac: ::std::default::Default::default(),
62            mtu: ::std::default::Default::default(),
63            nodes: ::std::default::Default::default(),
64            peers: ::std::default::Default::default(),
65            pending: ::std::default::Default::default(),
66            reversedns: ::std::default::Default::default(),
67            rt_import: ::std::default::Default::default(),
68            state: ::std::default::Default::default(),
69            tag: ::std::default::Default::default(),
70            vlan_protocol: ::std::default::Default::default(),
71            vrf_vxlan: ::std::default::Default::default(),
72            vxlan_port: ::std::default::Default::default(),
73            additional_properties: ::std::default::Default::default(),
74        }
75    }
76}
77#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
78pub struct GetOutputItems {
79    #[serde(rename = "advertise-subnets")]
80    #[serde(
81        serialize_with = "crate::types::serialize_bool_optional",
82        deserialize_with = "crate::types::deserialize_bool_optional"
83    )]
84    #[serde(skip_serializing_if = "Option::is_none", default)]
85    #[doc = "Advertise IP prefixes (Type-5 routes) instead of MAC/IP pairs (Type-2 routes). EVPN zone only."]
86    #[doc = ""]
87    pub advertise_subnets: Option<bool>,
88    #[serde(skip_serializing_if = "Option::is_none", default)]
89    #[doc = "the bridge for which VLANs should be managed. VLAN & QinQ zone only."]
90    #[doc = ""]
91    pub bridge: Option<String>,
92    #[serde(rename = "bridge-disable-mac-learning")]
93    #[serde(
94        serialize_with = "crate::types::serialize_bool_optional",
95        deserialize_with = "crate::types::deserialize_bool_optional"
96    )]
97    #[serde(skip_serializing_if = "Option::is_none", default)]
98    #[doc = "Disable auto mac learning. VLAN zone only."]
99    #[doc = ""]
100    pub bridge_disable_mac_learning: Option<bool>,
101    #[serde(skip_serializing_if = "Option::is_none", default)]
102    #[doc = "ID of the controller for this zone. EVPN zone only."]
103    #[doc = ""]
104    pub controller: Option<String>,
105    #[serde(skip_serializing_if = "Option::is_none", default)]
106    #[doc = "Name of DHCP server backend for this zone."]
107    #[doc = ""]
108    pub dhcp: Option<Dhcp>,
109    #[serde(skip_serializing_if = "Option::is_none", default)]
110    #[doc = "Digest of the controller section."]
111    #[doc = ""]
112    pub digest: Option<String>,
113    #[serde(rename = "disable-arp-nd-suppression")]
114    #[serde(
115        serialize_with = "crate::types::serialize_bool_optional",
116        deserialize_with = "crate::types::deserialize_bool_optional"
117    )]
118    #[serde(skip_serializing_if = "Option::is_none", default)]
119    #[doc = "Suppress IPv4 ARP && IPv6 Neighbour Discovery messages. EVPN zone only."]
120    #[doc = ""]
121    pub disable_arp_nd_suppression: Option<bool>,
122    #[serde(skip_serializing_if = "Option::is_none", default)]
123    #[doc = "ID of the DNS server for this zone."]
124    #[doc = ""]
125    pub dns: Option<String>,
126    #[serde(skip_serializing_if = "Option::is_none", default)]
127    #[doc = "Domain name for this zone."]
128    #[doc = ""]
129    pub dnszone: Option<String>,
130    #[serde(skip_serializing_if = "Option::is_none", default)]
131    #[doc = "List of PVE Nodes that should act as exit node for this zone. EVPN zone only."]
132    #[doc = ""]
133    pub exitnodes: Option<String>,
134    #[serde(rename = "exitnodes-local-routing")]
135    #[serde(
136        serialize_with = "crate::types::serialize_bool_optional",
137        deserialize_with = "crate::types::deserialize_bool_optional"
138    )]
139    #[serde(skip_serializing_if = "Option::is_none", default)]
140    #[doc = "Create routes on the exit nodes, so they can connect to EVPN guests. EVPN zone only."]
141    #[doc = ""]
142    pub exitnodes_local_routing: Option<bool>,
143    #[serde(rename = "exitnodes-primary")]
144    #[serde(skip_serializing_if = "Option::is_none", default)]
145    #[doc = "Force traffic through this exitnode first. EVPN zone only."]
146    #[doc = ""]
147    pub exitnodes_primary: Option<String>,
148    #[serde(skip_serializing_if = "Option::is_none", default)]
149    #[doc = "ID of the IPAM for this zone."]
150    #[doc = ""]
151    pub ipam: Option<String>,
152    #[serde(skip_serializing_if = "Option::is_none", default)]
153    #[doc = "MAC address of the anycast router for this zone."]
154    #[doc = ""]
155    pub mac: Option<String>,
156    #[serde(
157        serialize_with = "crate::types::serialize_int_optional",
158        deserialize_with = "crate::types::deserialize_int_optional"
159    )]
160    #[serde(skip_serializing_if = "Option::is_none", default)]
161    #[doc = "MTU of the zone, will be used for the created VNet bridges."]
162    #[doc = ""]
163    pub mtu: Option<i64>,
164    #[serde(skip_serializing_if = "Option::is_none", default)]
165    #[doc = "Nodes where this zone should be created."]
166    #[doc = ""]
167    pub nodes: Option<String>,
168    #[serde(skip_serializing_if = "Option::is_none", default)]
169    #[doc = "Comma-separated list of peers, that are part of the VXLAN zone. Usually the IPs of the nodes. VXLAN zone only."]
170    #[doc = ""]
171    pub peers: Option<String>,
172    #[serde(skip_serializing_if = "Option::is_none", default)]
173    #[doc = "Changes that have not yet been applied to the running configuration."]
174    #[doc = ""]
175    pub pending: Option<PendingGetOutputItemsPending>,
176    #[serde(skip_serializing_if = "Option::is_none", default)]
177    #[doc = "ID of the reverse DNS server for this zone."]
178    #[doc = ""]
179    pub reversedns: Option<String>,
180    #[serde(rename = "rt-import")]
181    #[serde(skip_serializing_if = "Option::is_none", default)]
182    #[doc = "Route-Targets that should be imported into the VRF of this zone via BGP. EVPN zone only."]
183    #[doc = ""]
184    pub rt_import: Option<String>,
185    #[serde(skip_serializing_if = "Option::is_none", default)]
186    #[doc = "State of the SDN configuration object."]
187    #[doc = ""]
188    pub state: Option<State>,
189    #[serde(
190        serialize_with = "crate::types::serialize_unsigned_int_optional",
191        deserialize_with = "crate::types::deserialize_unsigned_int_optional"
192    )]
193    #[serde(skip_serializing_if = "Option::is_none", default)]
194    #[doc = "Service-VLAN Tag (outer VLAN). QinQ zone only"]
195    #[doc = ""]
196    pub tag: Option<u64>,
197    #[serde(rename = "type")]
198    #[doc = "Type of the zone."]
199    #[doc = ""]
200    pub ty: Type,
201    #[serde(rename = "vlan-protocol")]
202    #[serde(skip_serializing_if = "Option::is_none", default)]
203    #[doc = "VLAN protocol for the creation of the QinQ zone. QinQ zone only."]
204    #[doc = ""]
205    pub vlan_protocol: Option<VlanProtocol>,
206    #[serde(rename = "vrf-vxlan")]
207    #[serde(skip_serializing_if = "Option::is_none", default)]
208    #[doc = "VNI for the zone VRF. EVPN zone only."]
209    #[doc = ""]
210    pub vrf_vxlan: Option<VrfVxlanInt>,
211    #[serde(rename = "vxlan-port")]
212    #[serde(skip_serializing_if = "Option::is_none", default)]
213    #[doc = "UDP port that should be used for the VXLAN tunnel (default 4789). VXLAN zone only."]
214    #[doc = ""]
215    pub vxlan_port: Option<VxlanPortInt>,
216    #[doc = "Name of the zone."]
217    #[doc = ""]
218    pub zone: String,
219    #[serde(
220        flatten,
221        default,
222        skip_serializing_if = "::std::collections::HashMap::is_empty"
223    )]
224    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
225}
226#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
227pub struct GetParams {
228    #[serde(
229        serialize_with = "crate::types::serialize_bool_optional",
230        deserialize_with = "crate::types::deserialize_bool_optional"
231    )]
232    #[serde(skip_serializing_if = "Option::is_none", default)]
233    #[doc = "Display pending config."]
234    #[doc = ""]
235    pub pending: Option<bool>,
236    #[serde(
237        serialize_with = "crate::types::serialize_bool_optional",
238        deserialize_with = "crate::types::deserialize_bool_optional"
239    )]
240    #[serde(skip_serializing_if = "Option::is_none", default)]
241    #[doc = "Display running config."]
242    #[doc = ""]
243    pub running: Option<bool>,
244    #[serde(rename = "type")]
245    #[serde(skip_serializing_if = "Option::is_none", default)]
246    #[doc = "Only list SDN zones of specific type"]
247    #[doc = ""]
248    pub ty: Option<Type>,
249    #[serde(
250        flatten,
251        default,
252        skip_serializing_if = "::std::collections::HashMap::is_empty"
253    )]
254    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
255}
256#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
257pub struct PendingGetOutputItemsPending {
258    #[serde(rename = "advertise-subnets")]
259    #[serde(
260        serialize_with = "crate::types::serialize_bool_optional",
261        deserialize_with = "crate::types::deserialize_bool_optional"
262    )]
263    #[serde(skip_serializing_if = "Option::is_none", default)]
264    #[doc = "Advertise IP prefixes (Type-5 routes) instead of MAC/IP pairs (Type-2 routes). EVPN zone only."]
265    #[doc = ""]
266    pub advertise_subnets: Option<bool>,
267    #[serde(skip_serializing_if = "Option::is_none", default)]
268    #[doc = "the bridge for which VLANs should be managed. VLAN & QinQ zone only."]
269    #[doc = ""]
270    pub bridge: Option<String>,
271    #[serde(rename = "bridge-disable-mac-learning")]
272    #[serde(
273        serialize_with = "crate::types::serialize_bool_optional",
274        deserialize_with = "crate::types::deserialize_bool_optional"
275    )]
276    #[serde(skip_serializing_if = "Option::is_none", default)]
277    #[doc = "Disable auto mac learning. VLAN zone only."]
278    #[doc = ""]
279    pub bridge_disable_mac_learning: Option<bool>,
280    #[serde(skip_serializing_if = "Option::is_none", default)]
281    #[doc = "ID of the controller for this zone. EVPN zone only."]
282    #[doc = ""]
283    pub controller: Option<String>,
284    #[serde(skip_serializing_if = "Option::is_none", default)]
285    #[doc = "Name of DHCP server backend for this zone."]
286    #[doc = ""]
287    pub dhcp: Option<Dhcp>,
288    #[serde(rename = "disable-arp-nd-suppression")]
289    #[serde(
290        serialize_with = "crate::types::serialize_bool_optional",
291        deserialize_with = "crate::types::deserialize_bool_optional"
292    )]
293    #[serde(skip_serializing_if = "Option::is_none", default)]
294    #[doc = "Suppress IPv4 ARP && IPv6 Neighbour Discovery messages. EVPN zone only."]
295    #[doc = ""]
296    pub disable_arp_nd_suppression: Option<bool>,
297    #[serde(skip_serializing_if = "Option::is_none", default)]
298    #[doc = "ID of the DNS server for this zone."]
299    #[doc = ""]
300    pub dns: Option<String>,
301    #[serde(skip_serializing_if = "Option::is_none", default)]
302    #[doc = "Domain name for this zone."]
303    #[doc = ""]
304    pub dnszone: Option<String>,
305    #[serde(skip_serializing_if = "Option::is_none", default)]
306    #[doc = "List of PVE Nodes that should act as exit node for this zone. EVPN zone only."]
307    #[doc = ""]
308    pub exitnodes: Option<String>,
309    #[serde(rename = "exitnodes-local-routing")]
310    #[serde(
311        serialize_with = "crate::types::serialize_bool_optional",
312        deserialize_with = "crate::types::deserialize_bool_optional"
313    )]
314    #[serde(skip_serializing_if = "Option::is_none", default)]
315    #[doc = "Create routes on the exit nodes, so they can connect to EVPN guests. EVPN zone only."]
316    #[doc = ""]
317    pub exitnodes_local_routing: Option<bool>,
318    #[serde(rename = "exitnodes-primary")]
319    #[serde(skip_serializing_if = "Option::is_none", default)]
320    #[doc = "Force traffic through this exitnode first. EVPN zone only."]
321    #[doc = ""]
322    pub exitnodes_primary: Option<String>,
323    #[serde(skip_serializing_if = "Option::is_none", default)]
324    #[doc = "ID of the IPAM for this zone."]
325    #[doc = ""]
326    pub ipam: Option<String>,
327    #[serde(skip_serializing_if = "Option::is_none", default)]
328    #[doc = "MAC address of the anycast router for this zone."]
329    #[doc = ""]
330    pub mac: Option<String>,
331    #[serde(
332        serialize_with = "crate::types::serialize_int_optional",
333        deserialize_with = "crate::types::deserialize_int_optional"
334    )]
335    #[serde(skip_serializing_if = "Option::is_none", default)]
336    #[doc = "MTU of the zone, will be used for the created VNet bridges."]
337    #[doc = ""]
338    pub mtu: Option<i64>,
339    #[serde(skip_serializing_if = "Option::is_none", default)]
340    #[doc = "Nodes where this zone should be created."]
341    #[doc = ""]
342    pub nodes: Option<String>,
343    #[serde(skip_serializing_if = "Option::is_none", default)]
344    #[doc = "Comma-separated list of peers, that are part of the VXLAN zone. Usually the IPs of the nodes. VXLAN zone only."]
345    #[doc = ""]
346    pub peers: Option<String>,
347    #[serde(skip_serializing_if = "Option::is_none", default)]
348    #[doc = "ID of the reverse DNS server for this zone."]
349    #[doc = ""]
350    pub reversedns: Option<String>,
351    #[serde(rename = "rt-import")]
352    #[serde(skip_serializing_if = "Option::is_none", default)]
353    #[doc = "Route-Targets that should be imported into the VRF of this zone via BGP. EVPN zone only."]
354    #[doc = ""]
355    pub rt_import: Option<String>,
356    #[serde(
357        serialize_with = "crate::types::serialize_unsigned_int_optional",
358        deserialize_with = "crate::types::deserialize_unsigned_int_optional"
359    )]
360    #[serde(skip_serializing_if = "Option::is_none", default)]
361    #[doc = "Service-VLAN Tag (outer VLAN). QinQ zone only"]
362    #[doc = ""]
363    pub tag: Option<u64>,
364    #[serde(rename = "vlan-protocol")]
365    #[serde(skip_serializing_if = "Option::is_none", default)]
366    #[doc = "VLAN protocol for the creation of the QinQ zone. QinQ zone only."]
367    #[doc = ""]
368    pub vlan_protocol: Option<VlanProtocol>,
369    #[serde(rename = "vrf-vxlan")]
370    #[serde(skip_serializing_if = "Option::is_none", default)]
371    #[doc = "VNI for the zone VRF. EVPN zone only."]
372    #[doc = ""]
373    pub vrf_vxlan: Option<VrfVxlanInt>,
374    #[serde(rename = "vxlan-port")]
375    #[serde(skip_serializing_if = "Option::is_none", default)]
376    #[doc = "UDP port that should be used for the VXLAN tunnel (default 4789). VXLAN zone only."]
377    #[doc = ""]
378    pub vxlan_port: Option<VxlanPortInt>,
379    #[serde(
380        flatten,
381        default,
382        skip_serializing_if = "::std::collections::HashMap::is_empty"
383    )]
384    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
385}
386impl PostParams {
387    pub fn new(ty: Type, zone: String) -> Self {
388        Self {
389            ty,
390            zone,
391            advertise_subnets: ::std::default::Default::default(),
392            bridge: ::std::default::Default::default(),
393            bridge_disable_mac_learning: ::std::default::Default::default(),
394            controller: ::std::default::Default::default(),
395            dhcp: ::std::default::Default::default(),
396            disable_arp_nd_suppression: ::std::default::Default::default(),
397            dns: ::std::default::Default::default(),
398            dnszone: ::std::default::Default::default(),
399            dp_id: ::std::default::Default::default(),
400            exitnodes: ::std::default::Default::default(),
401            exitnodes_local_routing: ::std::default::Default::default(),
402            exitnodes_primary: ::std::default::Default::default(),
403            fabric: ::std::default::Default::default(),
404            ipam: ::std::default::Default::default(),
405            lock_token: ::std::default::Default::default(),
406            mac: ::std::default::Default::default(),
407            mtu: ::std::default::Default::default(),
408            nodes: ::std::default::Default::default(),
409            peers: ::std::default::Default::default(),
410            reversedns: ::std::default::Default::default(),
411            rt_import: ::std::default::Default::default(),
412            tag: ::std::default::Default::default(),
413            vlan_protocol: ::std::default::Default::default(),
414            vrf_vxlan: ::std::default::Default::default(),
415            vxlan_port: ::std::default::Default::default(),
416            additional_properties: ::std::default::Default::default(),
417        }
418    }
419}
420#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
421pub struct PostParams {
422    #[serde(rename = "advertise-subnets")]
423    #[serde(
424        serialize_with = "crate::types::serialize_bool_optional",
425        deserialize_with = "crate::types::deserialize_bool_optional"
426    )]
427    #[serde(skip_serializing_if = "Option::is_none", default)]
428    #[doc = "Advertise IP prefixes (Type-5 routes) instead of MAC/IP pairs (Type-2 routes)."]
429    #[doc = ""]
430    pub advertise_subnets: Option<bool>,
431    #[serde(skip_serializing_if = "Option::is_none", default)]
432    #[doc = "The bridge for which VLANs should be managed."]
433    #[doc = ""]
434    pub bridge: Option<String>,
435    #[serde(rename = "bridge-disable-mac-learning")]
436    #[serde(
437        serialize_with = "crate::types::serialize_bool_optional",
438        deserialize_with = "crate::types::deserialize_bool_optional"
439    )]
440    #[serde(skip_serializing_if = "Option::is_none", default)]
441    #[doc = "Disable auto mac learning."]
442    #[doc = ""]
443    pub bridge_disable_mac_learning: Option<bool>,
444    #[serde(skip_serializing_if = "Option::is_none", default)]
445    #[doc = "Controller for this zone."]
446    #[doc = ""]
447    pub controller: Option<String>,
448    #[serde(skip_serializing_if = "Option::is_none", default)]
449    #[doc = "Type of the DHCP backend for this zone"]
450    #[doc = ""]
451    pub dhcp: Option<Dhcp>,
452    #[serde(rename = "disable-arp-nd-suppression")]
453    #[serde(
454        serialize_with = "crate::types::serialize_bool_optional",
455        deserialize_with = "crate::types::deserialize_bool_optional"
456    )]
457    #[serde(skip_serializing_if = "Option::is_none", default)]
458    #[doc = "Suppress IPv4 ARP && IPv6 Neighbour Discovery messages."]
459    #[doc = ""]
460    pub disable_arp_nd_suppression: Option<bool>,
461    #[serde(skip_serializing_if = "Option::is_none", default)]
462    #[doc = "dns api server"]
463    #[doc = ""]
464    pub dns: Option<String>,
465    #[serde(skip_serializing_if = "Option::is_none", default)]
466    #[doc = "dns domain zone  ex: mydomain.com"]
467    #[doc = ""]
468    pub dnszone: Option<String>,
469    #[serde(rename = "dp-id")]
470    #[serde(
471        serialize_with = "crate::types::serialize_int_optional",
472        deserialize_with = "crate::types::deserialize_int_optional"
473    )]
474    #[serde(skip_serializing_if = "Option::is_none", default)]
475    #[doc = "Faucet dataplane id"]
476    #[doc = ""]
477    pub dp_id: Option<i64>,
478    #[serde(skip_serializing_if = "Option::is_none", default)]
479    #[doc = "List of cluster node names."]
480    #[doc = ""]
481    pub exitnodes: Option<String>,
482    #[serde(rename = "exitnodes-local-routing")]
483    #[serde(
484        serialize_with = "crate::types::serialize_bool_optional",
485        deserialize_with = "crate::types::deserialize_bool_optional"
486    )]
487    #[serde(skip_serializing_if = "Option::is_none", default)]
488    #[doc = "Allow exitnodes to connect to EVPN guests."]
489    #[doc = ""]
490    pub exitnodes_local_routing: Option<bool>,
491    #[serde(rename = "exitnodes-primary")]
492    #[serde(skip_serializing_if = "Option::is_none", default)]
493    #[doc = "Force traffic through this exitnode first."]
494    #[doc = ""]
495    pub exitnodes_primary: Option<String>,
496    #[serde(skip_serializing_if = "Option::is_none", default)]
497    #[doc = "SDN fabric to use as underlay for this VXLAN zone."]
498    #[doc = ""]
499    pub fabric: Option<String>,
500    #[serde(skip_serializing_if = "Option::is_none", default)]
501    #[doc = "use a specific ipam"]
502    #[doc = ""]
503    pub ipam: Option<String>,
504    #[serde(rename = "lock-token")]
505    #[serde(skip_serializing_if = "Option::is_none", default)]
506    #[doc = "the token for unlocking the global SDN configuration"]
507    #[doc = ""]
508    pub lock_token: Option<String>,
509    #[serde(skip_serializing_if = "Option::is_none", default)]
510    #[doc = "Anycast logical router mac address."]
511    #[doc = ""]
512    pub mac: Option<crate::types::MacAddr<true>>,
513    #[serde(
514        serialize_with = "crate::types::serialize_int_optional",
515        deserialize_with = "crate::types::deserialize_int_optional"
516    )]
517    #[serde(skip_serializing_if = "Option::is_none", default)]
518    #[doc = "MTU of the zone, will be used for the created VNet bridges."]
519    #[doc = ""]
520    pub mtu: Option<i64>,
521    #[serde(skip_serializing_if = "Option::is_none", default)]
522    #[doc = "List of cluster node names."]
523    #[doc = ""]
524    pub nodes: Option<String>,
525    #[serde(skip_serializing_if = "Option::is_none", default)]
526    #[doc = "Comma-separated list of peers, that are part of the VXLAN zone. Usually the IPs of the nodes."]
527    #[doc = ""]
528    pub peers: Option<String>,
529    #[serde(skip_serializing_if = "Option::is_none", default)]
530    #[doc = "reverse dns api server"]
531    #[doc = ""]
532    pub reversedns: Option<String>,
533    #[serde(rename = "rt-import")]
534    #[serde(skip_serializing_if = "Option::is_none", default)]
535    #[doc = "List of Route Targets that should be imported into the VRF of the zone."]
536    #[doc = ""]
537    pub rt_import: Option<String>,
538    #[serde(
539        serialize_with = "crate::types::serialize_unsigned_int_optional",
540        deserialize_with = "crate::types::deserialize_unsigned_int_optional"
541    )]
542    #[serde(skip_serializing_if = "Option::is_none", default)]
543    #[doc = "Service-VLAN Tag (outer VLAN)"]
544    #[doc = ""]
545    pub tag: Option<u64>,
546    #[serde(rename = "type")]
547    #[doc = "Plugin type."]
548    #[doc = ""]
549    pub ty: Type,
550    #[serde(rename = "vlan-protocol")]
551    #[serde(skip_serializing_if = "Option::is_none", default)]
552    #[doc = "Which VLAN protocol should be used for the creation of the QinQ zone."]
553    #[doc = ""]
554    pub vlan_protocol: Option<VlanProtocol>,
555    #[serde(rename = "vrf-vxlan")]
556    #[serde(skip_serializing_if = "Option::is_none", default)]
557    #[doc = "VNI for the zone VRF."]
558    #[doc = ""]
559    pub vrf_vxlan: Option<VrfVxlanInt>,
560    #[serde(rename = "vxlan-port")]
561    #[serde(skip_serializing_if = "Option::is_none", default)]
562    #[doc = "UDP port that should be used for the VXLAN tunnel (default 4789)."]
563    #[doc = ""]
564    pub vxlan_port: Option<VxlanPortInt>,
565    #[doc = "The SDN zone object identifier."]
566    #[doc = ""]
567    pub zone: String,
568    #[serde(
569        flatten,
570        default,
571        skip_serializing_if = "::std::collections::HashMap::is_empty"
572    )]
573    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
574}
575#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
576#[doc = "Name of DHCP server backend for this zone."]
577#[doc = ""]
578pub enum Dhcp {
579    #[serde(rename = "dnsmasq")]
580    Dnsmasq,
581}
582impl TryFrom<&str> for Dhcp {
583    type Error = String;
584    fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
585        match value {
586            "dnsmasq" => Ok(Self::Dnsmasq),
587            v => Err(format!("Unknown variant {v}")),
588        }
589    }
590}
591#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
592#[doc = "State of the SDN configuration object."]
593#[doc = ""]
594pub enum State {
595    #[serde(rename = "changed")]
596    Changed,
597    #[serde(rename = "deleted")]
598    Deleted,
599    #[serde(rename = "new")]
600    New,
601}
602impl TryFrom<&str> for State {
603    type Error = String;
604    fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
605        match value {
606            "changed" => Ok(Self::Changed),
607            "deleted" => Ok(Self::Deleted),
608            "new" => Ok(Self::New),
609            v => Err(format!("Unknown variant {v}")),
610        }
611    }
612}
613#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
614#[doc = "Only list SDN zones of specific type"]
615#[doc = ""]
616pub enum Type {
617    #[serde(rename = "evpn")]
618    Evpn,
619    #[serde(rename = "faucet")]
620    Faucet,
621    #[serde(rename = "qinq")]
622    Qinq,
623    #[serde(rename = "simple")]
624    Simple,
625    #[serde(rename = "vlan")]
626    Vlan,
627    #[serde(rename = "vxlan")]
628    Vxlan,
629}
630impl TryFrom<&str> for Type {
631    type Error = String;
632    fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
633        match value {
634            "evpn" => Ok(Self::Evpn),
635            "faucet" => Ok(Self::Faucet),
636            "qinq" => Ok(Self::Qinq),
637            "simple" => Ok(Self::Simple),
638            "vlan" => Ok(Self::Vlan),
639            "vxlan" => Ok(Self::Vxlan),
640            v => Err(format!("Unknown variant {v}")),
641        }
642    }
643}
644#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Default)]
645#[doc = "VLAN protocol for the creation of the QinQ zone. QinQ zone only."]
646#[doc = ""]
647pub enum VlanProtocol {
648    #[serde(rename = "802.1ad")]
649    _8021ad,
650    #[serde(rename = "802.1q")]
651    #[default]
652    _8021q,
653}
654impl TryFrom<&str> for VlanProtocol {
655    type Error = String;
656    fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
657        match value {
658            "802.1ad" => Ok(Self::_8021ad),
659            "802.1q" => Ok(Self::_8021q),
660            v => Err(format!("Unknown variant {v}")),
661        }
662    }
663}
664#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
665pub struct VrfVxlanInt(i128);
666impl crate::types::bounded_integer::BoundedInteger for VrfVxlanInt {
667    const MIN: Option<i128> = Some(1i128);
668    const MAX: Option<i128> = Some(16777215i128);
669    const DEFAULT: Option<i128> = None::<i128>;
670    const TYPE_DESCRIPTION: &'static str = "an integer between 1 and 16777215";
671    fn get(&self) -> i128 {
672        self.0
673    }
674    fn new(value: i128) -> Result<Self, crate::types::bounded_integer::BoundedIntegerError> {
675        Self::validate(value)?;
676        Ok(Self(value))
677    }
678}
679impl std::convert::TryFrom<i128> for VrfVxlanInt {
680    type Error = crate::types::bounded_integer::BoundedIntegerError;
681    fn try_from(value: i128) -> Result<Self, Self::Error> {
682        crate::types::bounded_integer::BoundedInteger::new(value)
683    }
684}
685impl ::serde::Serialize for VrfVxlanInt {
686    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
687    where
688        S: ::serde::Serializer,
689    {
690        crate::types::bounded_integer::serialize_bounded_integer(self, serializer)
691    }
692}
693impl<'de> ::serde::Deserialize<'de> for VrfVxlanInt {
694    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
695    where
696        D: ::serde::Deserializer<'de>,
697    {
698        crate::types::bounded_integer::deserialize_bounded_integer(deserializer)
699    }
700}
701#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
702pub struct VxlanPortInt(i128);
703impl crate::types::bounded_integer::BoundedInteger for VxlanPortInt {
704    const MIN: Option<i128> = Some(1i128);
705    const MAX: Option<i128> = Some(65536i128);
706    const DEFAULT: Option<i128> = Some(4789i128);
707    const TYPE_DESCRIPTION: &'static str = "an integer between 1 and 65536";
708    fn get(&self) -> i128 {
709        self.0
710    }
711    fn new(value: i128) -> Result<Self, crate::types::bounded_integer::BoundedIntegerError> {
712        Self::validate(value)?;
713        Ok(Self(value))
714    }
715}
716impl std::convert::TryFrom<i128> for VxlanPortInt {
717    type Error = crate::types::bounded_integer::BoundedIntegerError;
718    fn try_from(value: i128) -> Result<Self, Self::Error> {
719        crate::types::bounded_integer::BoundedInteger::new(value)
720    }
721}
722impl ::serde::Serialize for VxlanPortInt {
723    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
724    where
725        S: ::serde::Serializer,
726    {
727        crate::types::bounded_integer::serialize_bounded_integer(self, serializer)
728    }
729}
730impl<'de> ::serde::Deserialize<'de> for VxlanPortInt {
731    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
732    where
733        D: ::serde::Deserializer<'de>,
734    {
735        crate::types::bounded_integer::deserialize_bounded_integer(deserializer)
736    }
737}
738impl<T> ZonesClient<T>
739where
740    T: crate::client::Client,
741{
742    pub fn zone(&self, zone: &str) -> zone::ZoneClient<T> {
743        zone::ZoneClient::<T>::new(self.client.clone(), &self.path, zone)
744    }
745}