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

Shan Shaji s.shaji at proxmox.com
Wed Dec 10 17:37:30 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>
---
 changes since v1:
 - Revert the dropping of '/' from the comment.
 - Remove unnecessary colon.

 server/src/pbs_client.rs | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/server/src/pbs_client.rs b/server/src/pbs_client.rs
index f4f1f82..31befdd 100644
--- a/server/src/pbs_client.rs
+++ b/server/src/pbs_client.rs
@@ -260,6 +260,13 @@ impl PbsClient {
         Ok(token)
     }
 
+    /// 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";
-- 
2.47.3





More information about the pdm-devel mailing list