proxmox_api/generated/cluster/sdn/
rollback.rs1#[derive(Debug, Clone)]
2pub struct RollbackClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> RollbackClient<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, "/rollback"),
14 }
15 }
16}
17impl<T> RollbackClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Rollback pending changes to SDN configuration"]
22 #[doc = ""]
23 #[doc = "Permission check: perm(\"/sdn\", [\"SDN.Allocate\"])"]
24 pub async fn post(&self, params: PostParams) -> Result<(), T::Error> {
25 let path = self.path.to_string();
26 self.client.post(&path, ¶ms).await
27 }
28}
29#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
30pub struct PostParams {
31 #[serde(rename = "lock-token")]
32 #[serde(skip_serializing_if = "Option::is_none", default)]
33 #[doc = "the token for unlocking the global SDN configuration"]
34 #[doc = ""]
35 pub lock_token: Option<String>,
36 #[serde(rename = "release-lock")]
37 #[serde(
38 serialize_with = "crate::types::serialize_bool_optional",
39 deserialize_with = "crate::types::deserialize_bool_optional"
40 )]
41 #[serde(skip_serializing_if = "Option::is_none", default)]
42 #[doc = "When lock-token has been provided and configuration successfully rollbacked, release the lock automatically afterwards"]
43 #[doc = ""]
44 pub release_lock: Option<bool>,
45 #[serde(
46 flatten,
47 default,
48 skip_serializing_if = "::std::collections::HashMap::is_empty"
49 )]
50 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
51}