From 434dd3cc84b3d0ce3e30b517d821dc02ee1388d6 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 24 May 2022 11:18:06 +0200 Subject: [PATCH] client: switch to PruneJobsOptions Signed-off-by: Wolfgang Bumiller --- proxmox-backup-client/src/main.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/proxmox-backup-client/src/main.rs b/proxmox-backup-client/src/main.rs index 073b660e..12c598fe 100644 --- a/proxmox-backup-client/src/main.rs +++ b/proxmox-backup-client/src/main.rs @@ -24,7 +24,7 @@ use pxar::accessor::{MaybeReady, ReadAt, ReadAtOperation}; use pbs_api_types::{ Authid, BackupDir, BackupGroup, BackupNamespace, BackupPart, BackupType, CryptMode, - Fingerprint, GroupListItem, HumanByte, PruneListItem, PruneOptions, RateLimitConfig, + Fingerprint, GroupListItem, HumanByte, PruneJobOptions, PruneListItem, RateLimitConfig, SnapshotListItem, StorageStatus, BACKUP_ID_SCHEMA, BACKUP_NAMESPACE_SCHEMA, BACKUP_TIME_SCHEMA, BACKUP_TYPE_SCHEMA, TRAFFIC_CONTROL_BURST_SCHEMA, TRAFFIC_CONTROL_RATE_SCHEMA, }; @@ -1417,12 +1417,8 @@ async fn restore(param: Value) -> Result { type: String, description: "Backup group", }, - ns: { - type: BackupNamespace, - optional: true, - }, "prune-options": { - type: PruneOptions, + type: PruneJobOptions, flatten: true, }, "output-format": { @@ -1446,12 +1442,11 @@ async fn restore(param: Value) -> Result { async fn prune( dry_run: Option, group: String, - prune_options: PruneOptions, + prune_options: PruneJobOptions, quiet: bool, mut param: Value, ) -> Result { let repo = extract_repository_from_value(¶m)?; - let ns = optional_ns_param(¶m)?; let client = connect(&repo)?; @@ -1466,9 +1461,6 @@ async fn prune( api_param["dry-run"] = dry_run.into(); } merge_group_into(api_param.as_object_mut().unwrap(), group); - if !ns.is_root() { - api_param["ns"] = serde_json::to_value(ns)?; - } let mut result = client.post(&path, Some(api_param)).await?;