proxmox_api/generated/cluster/sdn/
vnets.rs

1pub mod vnet;
2pub struct VnetsClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> VnetsClient<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, "/vnets"),
14        }
15    }
16}
17impl<T> VnetsClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "SDN vnets index."]
22    pub fn get(&self, params: GetParams) -> Result<Vec<GetOutputItems>, T::Error> {
23        let path = self.path.to_string();
24        self.client.get(&path, &params)
25    }
26}
27impl<T> VnetsClient<T>
28where
29    T: crate::client::Client,
30{
31    #[doc = "Create a new sdn vnet object."]
32    pub fn post(&self, params: PostParams) -> Result<(), T::Error> {
33        let path = self.path.to_string();
34        self.client.post(&path, &params)
35    }
36}
37#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
38pub struct GetOutputItems {
39    #[serde(
40        flatten,
41        default,
42        skip_serializing_if = "::std::collections::HashMap::is_empty"
43    )]
44    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
45}
46#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
47pub struct GetParams {
48    #[serde(
49        serialize_with = "crate::types::serialize_bool_optional",
50        deserialize_with = "crate::types::deserialize_bool_optional"
51    )]
52    #[serde(skip_serializing_if = "Option::is_none", default)]
53    #[doc = "Display pending config."]
54    pub pending: Option<bool>,
55    #[serde(
56        serialize_with = "crate::types::serialize_bool_optional",
57        deserialize_with = "crate::types::deserialize_bool_optional"
58    )]
59    #[serde(skip_serializing_if = "Option::is_none", default)]
60    #[doc = "Display running config."]
61    pub running: Option<bool>,
62    #[serde(
63        flatten,
64        default,
65        skip_serializing_if = "::std::collections::HashMap::is_empty"
66    )]
67    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
68}
69impl PostParams {
70    pub fn new(vnet: String, zone: String) -> Self {
71        Self {
72            vnet,
73            zone,
74            alias: Default::default(),
75            tag: Default::default(),
76            ty: Default::default(),
77            vlanaware: Default::default(),
78            additional_properties: Default::default(),
79        }
80    }
81}
82#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
83pub struct PostParams {
84    #[serde(skip_serializing_if = "Option::is_none", default)]
85    #[doc = "alias name of the vnet"]
86    pub alias: Option<String>,
87    #[serde(
88        serialize_with = "crate::types::serialize_int_optional",
89        deserialize_with = "crate::types::deserialize_int_optional"
90    )]
91    #[serde(skip_serializing_if = "Option::is_none", default)]
92    #[doc = "vlan or vxlan id"]
93    pub tag: Option<u64>,
94    #[serde(rename = "type")]
95    #[serde(skip_serializing_if = "Option::is_none", default)]
96    #[doc = "Type"]
97    pub ty: Option<Type>,
98    #[serde(
99        serialize_with = "crate::types::serialize_bool_optional",
100        deserialize_with = "crate::types::deserialize_bool_optional"
101    )]
102    #[serde(skip_serializing_if = "Option::is_none", default)]
103    #[doc = "Allow vm VLANs to pass through this vnet."]
104    pub vlanaware: Option<bool>,
105    #[doc = "The SDN vnet object identifier."]
106    pub vnet: String,
107    #[doc = "zone id"]
108    pub zone: String,
109    #[serde(
110        flatten,
111        default,
112        skip_serializing_if = "::std::collections::HashMap::is_empty"
113    )]
114    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
115}
116#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
117pub enum Type {
118    #[serde(rename = "vnet")]
119    Vnet,
120}
121impl<T> VnetsClient<T>
122where
123    T: crate::client::Client,
124{
125    pub fn vnet(&self, vnet: &str) -> vnet::VnetClient<T> {
126        vnet::VnetClient::<T>::new(self.client.clone(), &self.path, vnet)
127    }
128}