[pdm-devel] [PATCH datacenter-manager 1/5] server: pbs-client: add delete admin token method

Shan Shaji s.shaji at proxmox.com
Fri Dec 5 19:04:42 CET 2025


Inorder to allow deleting the generated token of PBS from PDM, add
method inside the PbsClient to delete the admin token.

Signed-off-by: Shan Shaji <s.shaji at proxmox.com>
---
 server/src/pbs_client.rs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/server/src/pbs_client.rs b/server/src/pbs_client.rs
index f4f1f82..b1e01e1 100644
--- a/server/src/pbs_client.rs
+++ b/server/src/pbs_client.rs
@@ -260,7 +260,14 @@ impl PbsClient {
         Ok(token)
     }
 
-    /// Return the status the Proxmox Backup Server instance
+    // Delete API-Token from the PBS remote.
+    pub async fn delete_admin_token(&self, userid: &Userid, tokenid: &str) -> Result<(), Error> {
+        let path = format!("/api2/extjs/access/users/{userid}/token/{tokenid}");
+        self.0.delete(&path).await?.nodata()?;
+        Ok(())
+    }
+
+    /// Return the status the Proxmox Backup Server instance:
     pub async fn node_status(&self) -> Result<pbs_api_types::NodeStatus, Error> {
         let path = "/api2/extjs/nodes/localhost/status";
         Ok(self.0.get(path).await?.expect_json()?.data)
-- 
2.47.3





More information about the pdm-devel mailing list