proxmox_api/generated/cluster/sdn/vnets/
vnet.rs1pub mod ips;
2pub mod subnets;
3pub struct VnetClient<T> {
4 client: T,
5 path: String,
6}
7impl<T> VnetClient<T>
8where
9 T: crate::client::Client,
10{
11 pub fn new(client: T, parent_path: &str, vnet: &str) -> Self {
12 Self {
13 client,
14 path: format!("{}/{}", parent_path, vnet),
15 }
16 }
17}
18impl<T> VnetClient<T>
19where
20 T: crate::client::Client,
21{
22 #[doc = "Delete sdn vnet object configuration."]
23 pub fn delete(&self) -> Result<(), T::Error> {
24 let path = self.path.to_string();
25 self.client.delete(&path, &())
26 }
27}
28impl<T> VnetClient<T>
29where
30 T: crate::client::Client,
31{
32 #[doc = "Read sdn vnet configuration."]
33 pub fn get(&self, params: GetParams) -> Result<GetOutput, T::Error> {
34 let path = self.path.to_string();
35 self.client.get(&path, ¶ms)
36 }
37}
38impl<T> VnetClient<T>
39where
40 T: crate::client::Client,
41{
42 #[doc = "Update sdn vnet object configuration."]
43 pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
44 let path = self.path.to_string();
45 self.client.put(&path, ¶ms)
46 }
47}
48#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
49pub struct GetOutput {
50 #[serde(
51 flatten,
52 default,
53 skip_serializing_if = "::std::collections::HashMap::is_empty"
54 )]
55 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
56}
57#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
58pub struct GetParams {
59 #[serde(
60 serialize_with = "crate::types::serialize_bool_optional",
61 deserialize_with = "crate::types::deserialize_bool_optional"
62 )]
63 #[serde(skip_serializing_if = "Option::is_none", default)]
64 #[doc = "Display pending config."]
65 pub pending: Option<bool>,
66 #[serde(
67 serialize_with = "crate::types::serialize_bool_optional",
68 deserialize_with = "crate::types::deserialize_bool_optional"
69 )]
70 #[serde(skip_serializing_if = "Option::is_none", default)]
71 #[doc = "Display running config."]
72 pub running: Option<bool>,
73 #[serde(
74 flatten,
75 default,
76 skip_serializing_if = "::std::collections::HashMap::is_empty"
77 )]
78 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
79}
80#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
81pub struct PutParams {
82 #[serde(skip_serializing_if = "Option::is_none", default)]
83 #[doc = "alias name of the vnet"]
84 pub alias: Option<String>,
85 #[serde(skip_serializing_if = "Option::is_none", default)]
86 #[doc = "A list of settings you want to delete."]
87 pub delete: Option<String>,
88 #[serde(skip_serializing_if = "Option::is_none", default)]
89 #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
90 pub digest: Option<String>,
91 #[serde(
92 serialize_with = "crate::types::serialize_int_optional",
93 deserialize_with = "crate::types::deserialize_int_optional"
94 )]
95 #[serde(skip_serializing_if = "Option::is_none", default)]
96 #[doc = "vlan or vxlan id"]
97 pub tag: Option<u64>,
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 #[serde(skip_serializing_if = "Option::is_none", default)]
106 #[doc = "zone id"]
107 pub zone: Option<String>,
108 #[serde(
109 flatten,
110 default,
111 skip_serializing_if = "::std::collections::HashMap::is_empty"
112 )]
113 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
114}
115impl<T> VnetClient<T>
116where
117 T: crate::client::Client,
118{
119 pub fn subnets(&self) -> subnets::SubnetsClient<T> {
120 subnets::SubnetsClient::<T>::new(self.client.clone(), &self.path)
121 }
122}
123impl<T> VnetClient<T>
124where
125 T: crate::client::Client,
126{
127 pub fn ips(&self) -> ips::IpsClient<T> {
128 ips::IpsClient::<T>::new(self.client.clone(), &self.path)
129 }
130}