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 58FF898BFD for ; Tue, 10 Oct 2023 10:43:15 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3BD1D1FEB6 for ; Tue, 10 Oct 2023 10:43:15 +0200 (CEST) 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, 10 Oct 2023 10:43:14 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id D69C24497E for ; Tue, 10 Oct 2023 10:43:13 +0200 (CEST) Message-ID: <5d524a88-60be-4a30-95f0-ed9b219caa81@proxmox.com> Date: Tue, 10 Oct 2023 10:43:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Lukas Wagner To: Proxmox Backup Server development discussion , Markus Frank References: <20231010063926.2248-1-m.frank@proxmox.com> Content-Language: de-AT, en-US In-Reply-To: <20231010063926.2248-1-m.frank@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.027 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [disk.rs] Subject: Re: [pbs-devel] [PATCH proxmox-backup 1/2] cli: add option to remove systemd mount unit 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, 10 Oct 2023 08:43:15 -0000 1/2 looks good to me, 2/2 might need a v2. Consider patch 1/2: Tested-by: Lukas Wagner Reviewed-by: Lukas Wagner On 10/10/23 08:39, Markus Frank wrote: > add commandline option for api function: > DELETE /api2/json/nodes/{node}/disks/directory/{name} > > $ proxmox-backup-manager disk fs delete > > Signed-off-by: Markus Frank > --- > src/bin/proxmox_backup_manager/disk.rs | 29 ++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/src/bin/proxmox_backup_manager/disk.rs b/src/bin/proxmox_backup_manager/disk.rs > index c3259b65..73cb95e6 100644 > --- a/src/bin/proxmox_backup_manager/disk.rs > +++ b/src/bin/proxmox_backup_manager/disk.rs > @@ -317,6 +317,31 @@ async fn create_datastore_disk( > Ok(Value::Null) > } > > +#[api( > + input: { > + properties: { > + name: { > + schema: DATASTORE_SCHEMA, > + }, > + }, > + }, > +)] > +/// Remove a Filesystem mounted under '/mnt/datastore/'. > +async fn delete_datastore_disk( > + mut param: Value, > + rpcenv: &mut dyn RpcEnvironment, > +) -> Result { > + param["node"] = "localhost".into(); > + > + let info = &api2::node::disks::directory::API_METHOD_DELETE_DATASTORE_DISK; > + let _result = match info.handler { > + ApiHandler::Sync(handler) => (handler)(param, info, rpcenv)?, > + _ => unreachable!(), > + }; > + > + Ok(Value::Null) > +} > + > pub fn filesystem_commands() -> CommandLineInterface { > let cmd_def = CliCommandMap::new() > .insert("list", CliCommand::new(&API_METHOD_LIST_DATASTORE_MOUNTS)) > @@ -325,6 +350,10 @@ pub fn filesystem_commands() -> CommandLineInterface { > CliCommand::new(&API_METHOD_CREATE_DATASTORE_DISK) > .arg_param(&["name"]) > .completion_cb("disk", complete_disk_name), > + ).insert( > + "delete", > + CliCommand::new(&API_METHOD_DELETE_DATASTORE_DISK) > + .arg_param(&["name"]), > ); > > cmd_def.into() -- - Lukas