mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-10-19 05:52:38 +00:00
client: add "delete-groups" param to delete namespace
The api parameter "delete-groups" was missing on the proxmox-backup-client command. This allows the client to remove non-empty namespaces. Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
This commit is contained in:
parent
4afe221df1
commit
a78d4b5a3a
@ -132,11 +132,15 @@ async fn create_namespace(param: Value) -> Result<(), Error> {
|
||||
type: BackupNamespace,
|
||||
optional: true,
|
||||
},
|
||||
"delete-groups": {
|
||||
description: "Destroys all groups in the hierarchy.",
|
||||
optional: true,
|
||||
},
|
||||
}
|
||||
},
|
||||
)]
|
||||
/// Delete an existing namespace.
|
||||
async fn delete_namespace(param: Value) -> Result<(), Error> {
|
||||
async fn delete_namespace(param: Value, delete_groups: Option<bool>) -> Result<(), Error> {
|
||||
let repo = extract_repository_from_value(¶m)?;
|
||||
let backup_ns = optional_ns_param(¶m)?;
|
||||
|
||||
@ -145,7 +149,11 @@ async fn delete_namespace(param: Value) -> Result<(), Error> {
|
||||
}
|
||||
|
||||
let path = format!("api2/json/admin/datastore/{}/namespace", repo.store());
|
||||
let param = json!({ "ns": backup_ns });
|
||||
let mut param = json!({ "ns": backup_ns });
|
||||
|
||||
if let Some(dg) = delete_groups {
|
||||
param["delete-groups"] = serde_json::to_value(dg)?;
|
||||
}
|
||||
|
||||
let client = connect(&repo)?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user