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

Shannon Sterz s.sterz at proxmox.com
Tue Dec 9 10:36:01 CET 2025


On Fri Dec 5, 2025 at 7:04 PM CET, Shan Shaji wrote:
> 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.

nit: dropping a '/' here turns this from a doc comment to a regular comment.
since this is a public function, please specify this as a doc comment.

> +    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:

nit: any reason to add a colon here?

>      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)





More information about the pdm-devel mailing list