proxmox_api/generated/cluster/
sdn.rs1pub mod controllers;
2pub mod dns;
3pub mod fabrics;
4pub mod ipams;
5pub mod lock;
6pub mod rollback;
7pub mod vnets;
8pub mod zones;
9#[derive(Debug, Clone)]
10pub struct SdnClient<T> {
11 client: T,
12 path: String,
13}
14impl<T> SdnClient<T>
15where
16 T: crate::client::Client,
17{
18 pub fn new(client: T, parent_path: &str) -> Self {
19 Self {
20 client,
21 path: format!("{}{}", parent_path, "/sdn"),
22 }
23 }
24}
25impl<T> SdnClient<T>
26where
27 T: crate::client::Client,
28{
29 #[doc = "Directory index."]
30 #[doc = ""]
31 #[doc = "Permission check: perm(\"/sdn\", [\"SDN.Audit\"])"]
32 pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
33 let path = self.path.to_string();
34 let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
35 Ok(optional_vec.unwrap_or_default())
36 }
37}
38impl<T> SdnClient<T>
39where
40 T: crate::client::Client,
41{
42 #[doc = "Apply sdn controller changes && reload."]
43 #[doc = ""]
44 #[doc = "Permission check: perm(\"/sdn\", [\"SDN.Allocate\"])"]
45 pub async fn put(&self, params: PutParams) -> Result<String, T::Error> {
46 let path = self.path.to_string();
47 self.client.put(&path, ¶ms).await
48 }
49}
50impl GetOutputItems {
51 pub fn new(id: String) -> Self {
52 Self {
53 id,
54 additional_properties: ::std::default::Default::default(),
55 }
56 }
57}
58#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
59pub struct GetOutputItems {
60 pub id: String,
61 #[serde(
62 flatten,
63 default,
64 skip_serializing_if = "::std::collections::HashMap::is_empty"
65 )]
66 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
67}
68#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
69pub struct PutParams {
70 #[serde(rename = "lock-token")]
71 #[serde(skip_serializing_if = "Option::is_none", default)]
72 #[doc = "the token for unlocking the global SDN configuration"]
73 #[doc = ""]
74 pub lock_token: Option<String>,
75 #[serde(rename = "release-lock")]
76 #[serde(
77 serialize_with = "crate::types::serialize_bool_optional",
78 deserialize_with = "crate::types::deserialize_bool_optional"
79 )]
80 #[serde(skip_serializing_if = "Option::is_none", default)]
81 #[doc = "When lock-token has been provided and configuration successfully commited, release the lock automatically afterwards"]
82 #[doc = ""]
83 pub release_lock: Option<bool>,
84 #[serde(
85 flatten,
86 default,
87 skip_serializing_if = "::std::collections::HashMap::is_empty"
88 )]
89 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
90}
91impl<T> SdnClient<T>
92where
93 T: crate::client::Client,
94{
95 pub fn vnets(&self) -> vnets::VnetsClient<T> {
96 vnets::VnetsClient::<T>::new(self.client.clone(), &self.path)
97 }
98}
99impl<T> SdnClient<T>
100where
101 T: crate::client::Client,
102{
103 pub fn zones(&self) -> zones::ZonesClient<T> {
104 zones::ZonesClient::<T>::new(self.client.clone(), &self.path)
105 }
106}
107impl<T> SdnClient<T>
108where
109 T: crate::client::Client,
110{
111 pub fn controllers(&self) -> controllers::ControllersClient<T> {
112 controllers::ControllersClient::<T>::new(self.client.clone(), &self.path)
113 }
114}
115impl<T> SdnClient<T>
116where
117 T: crate::client::Client,
118{
119 pub fn ipams(&self) -> ipams::IpamsClient<T> {
120 ipams::IpamsClient::<T>::new(self.client.clone(), &self.path)
121 }
122}
123impl<T> SdnClient<T>
124where
125 T: crate::client::Client,
126{
127 pub fn dns(&self) -> dns::DnsClient<T> {
128 dns::DnsClient::<T>::new(self.client.clone(), &self.path)
129 }
130}
131impl<T> SdnClient<T>
132where
133 T: crate::client::Client,
134{
135 pub fn fabrics(&self) -> fabrics::FabricsClient<T> {
136 fabrics::FabricsClient::<T>::new(self.client.clone(), &self.path)
137 }
138}
139impl<T> SdnClient<T>
140where
141 T: crate::client::Client,
142{
143 pub fn lock(&self) -> lock::LockClient<T> {
144 lock::LockClient::<T>::new(self.client.clone(), &self.path)
145 }
146}
147impl<T> SdnClient<T>
148where
149 T: crate::client::Client,
150{
151 pub fn rollback(&self) -> rollback::RollbackClient<T> {
152 rollback::RollbackClient::<T>::new(self.client.clone(), &self.path)
153 }
154}