[pdm-devel] [PATCH proxmox-api-types 10/12] sdn: generate apply configuration endpoint

Stefan Hanreich s.hanreich at proxmox.com
Fri Feb 28 16:17:47 CET 2025


Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
 pve-api-types/src/generated/code.rs  | 12 +++++++++++-
 pve-api-types/src/generated/types.rs | 28 ++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/pve-api-types/src/generated/code.rs b/pve-api-types/src/generated/code.rs
index 7927ccb..2e610b3 100644
--- a/pve-api-types/src/generated/code.rs
+++ b/pve-api-types/src/generated/code.rs
@@ -108,7 +108,6 @@
 /// - /cluster/options
 /// - /cluster/replication
 /// - /cluster/replication/{id}
-/// - /cluster/sdn
 /// - /cluster/sdn/controllers/{controller}
 /// - /cluster/sdn/dns
 /// - /cluster/sdn/dns/{dns}
@@ -626,6 +625,11 @@ pub trait PveClient {
         Err(Error::Other("remote_migrate_qemu not implemented"))
     }
 
+    /// Apply sdn controller changes && reload.
+    async fn sdn_apply(&self, params: ReloadSdn) -> Result<PveUpid, Error> {
+        Err(Error::Other("sdn_apply not implemented"))
+    }
+
     /// Shutdown the container. This will trigger a clean shutdown of the
     /// container, see lxc-stop(1) for details.
     async fn shutdown_lxc_async(
@@ -1071,6 +1075,12 @@ where
         Ok(self.0.post(url, &params).await?.expect_json()?.data)
     }
 
+    /// Apply sdn controller changes && reload.
+    async fn sdn_apply(&self, params: ReloadSdn) -> Result<PveUpid, Error> {
+        let url = "/api2/extjs/cluster/sdn";
+        Ok(self.0.put(url, &params).await?.expect_json()?.data)
+    }
+
     /// Shutdown the container. This will trigger a clean shutdown of the
     /// container, see lxc-stop(1) for details.
     async fn shutdown_lxc_async(
diff --git a/pve-api-types/src/generated/types.rs b/pve-api-types/src/generated/types.rs
index 78fdbd1..2fce1ef 100644
--- a/pve-api-types/src/generated/types.rs
+++ b/pve-api-types/src/generated/types.rs
@@ -9124,6 +9124,34 @@ pub struct ReleaseSdnLock {
     pub lock_secret: Option<String>,
 }
 
+#[api(
+    properties: {
+        "lock-secret": {
+            optional: true,
+            type: String,
+        },
+        "release-lock": {
+            default: true,
+            optional: true,
+        },
+    },
+)]
+/// Object.
+#[derive(Debug, serde::Deserialize, serde::Serialize)]
+pub struct ReloadSdn {
+    /// the secret for unlocking the global SDN configuration
+    #[serde(default, skip_serializing_if = "Option::is_none")]
+    #[serde(rename = "lock-secret")]
+    pub lock_secret: Option<String>,
+
+    /// When lock-secret has been provided and configuration successfully
+    /// commited, release the lock automatically afterwards
+    #[serde(deserialize_with = "proxmox_login::parse::deserialize_bool")]
+    #[serde(default, skip_serializing_if = "Option::is_none")]
+    #[serde(rename = "release-lock")]
+    pub release_lock: Option<bool>,
+}
+
 #[api(
     properties: {
         bwlimit: {
-- 
2.39.5




More information about the pdm-devel mailing list