Skip to main content

proxmox_api/generated/nodes/node/sdn/vnets/vnet/
mac_vrf.rs

1#[derive(Debug, Clone)]
2pub struct MacVrfClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> MacVrfClient<T>
7where
8    T: crate::client::Client,
9{
10    pub fn new(client: T, parent_path: &str) -> Self {
11        Self {
12            client,
13            path: format!("{}{}", parent_path, "/mac-vrf"),
14        }
15    }
16}
17impl<T> MacVrfClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "Get the MAC VRF for a VNet in an EVPN zone."]
22    #[doc = ""]
23    #[doc = "Require 'SDN.Audit' permissions on '/sdn/zones/\\<zone\\>/\\<vnet\\>'"]
24    pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
25        let path = self.path.to_string();
26        let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
27        Ok(optional_vec.unwrap_or_default())
28    }
29}
30impl GetOutputItems {
31    pub fn new(
32        ip: ::std::net::IpAddr,
33        mac: crate::types::MacAddr<true>,
34        nexthop: ::std::net::IpAddr,
35    ) -> Self {
36        Self {
37            ip,
38            mac,
39            nexthop,
40            additional_properties: ::std::default::Default::default(),
41        }
42    }
43}
44#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
45pub struct GetOutputItems {
46    #[doc = "The IP address of the MAC VRF entry."]
47    #[doc = ""]
48    pub ip: ::std::net::IpAddr,
49    #[doc = "The MAC address of the MAC VRF entry."]
50    #[doc = ""]
51    pub mac: crate::types::MacAddr<true>,
52    #[doc = "The IP address of the nexthop."]
53    #[doc = ""]
54    pub nexthop: ::std::net::IpAddr,
55    #[serde(
56        flatten,
57        default,
58        skip_serializing_if = "::std::collections::HashMap::is_empty"
59    )]
60    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
61}