From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 5617E90E66 for ; Tue, 13 Feb 2024 10:49:21 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 166D93377E for ; Tue, 13 Feb 2024 10:48:30 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 13 Feb 2024 10:48:29 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 1982147D25 for ; Tue, 13 Feb 2024 10:48:29 +0100 (CET) Date: Tue, 13 Feb 2024 10:48:22 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox Backup Server development discussion References: <20240212104342.73779-1-g.goller@proxmox.com> In-Reply-To: <20240212104342.73779-1-g.goller@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1707817590.05fjp52dyc.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.064 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [namespace.rs, proxmox.com] Subject: [pbs-devel] applied: [PATCH proxmox-backup] client: add "delete-groups" param to delete namespace X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2024 09:49:21 -0000 but with a follow-up renaming 'dg' to 'value'.. On February 12, 2024 11:43 am, Gabriel Goller wrote: > The api parameter "delete-groups" was missing on the > proxmox-backup-client command. This allows the client to remove > non-empty namespaces. >=20 > Signed-off-by: Gabriel Goller > --- > proxmox-backup-client/src/namespace.rs | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) >=20 > diff --git a/proxmox-backup-client/src/namespace.rs b/proxmox-backup-clie= nt/src/namespace.rs > index ce3f113b..abf31ef4 100644 > --- a/proxmox-backup-client/src/namespace.rs > +++ b/proxmox-backup-client/src/namespace.rs > @@ -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) -> = Result<(), Error> { > let repo =3D extract_repository_from_value(¶m)?; > let backup_ns =3D optional_ns_param(¶m)?; > =20 > @@ -145,7 +149,11 @@ async fn delete_namespace(param: Value) -> Result<()= , Error> { > } > =20 > let path =3D format!("api2/json/admin/datastore/{}/namespace", repo.= store()); > - let param =3D json!({ "ns": backup_ns }); > + let mut param =3D json!({ "ns": backup_ns }); > + > + if let Some(dg) =3D delete_groups { > + param["delete-groups"] =3D serde_json::to_value(dg)?; > + } > =20 > let client =3D connect(&repo)?; > =20 > --=20 > 2.43.0 >=20 >=20 >=20 > _______________________________________________ > pbs-devel mailing list > pbs-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel >=20 >=20 >=20