public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>, Markus Frank <m.frank@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup v2 1/2] cli: add option to remove systemd mount unit
Date: Tue, 10 Oct 2023 14:00:40 +0200	[thread overview]
Message-ID: <a2479423-ded5-454b-89f9-564444356b9a@proxmox.com> (raw)
In-Reply-To: <20231010113748.4325-1-m.frank@proxmox.com>

Now both patches look fine to me.

Both are now:

Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>


On 10/10/23 13:37, Markus Frank wrote:
> add commandline option for api function:
> DELETE /api2/json/nodes/{node}/disks/directory/{name}
> 
> $ proxmox-backup-manager disk fs delete <datastoreid>
> 
> Signed-off-by: Markus Frank <m.frank@proxmox.com>
> ---
>   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/<name>'.
> +async fn delete_datastore_disk(
> +    mut param: Value,
> +    rpcenv: &mut dyn RpcEnvironment,
> +) -> Result<Value, Error> {
> +    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




  parent reply	other threads:[~2023-10-10 12:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10 11:37 Markus Frank
2023-10-10 11:37 ` [pbs-devel] [PATCH proxmox-backup v2 2/2] ui: add Remove button for DirectoryList Markus Frank
2023-10-10 12:00 ` Lukas Wagner [this message]
2023-11-07  9:33 ` [pbs-devel] applied-series: [PATCH proxmox-backup v2 1/2] cli: add option to remove systemd mount unit Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a2479423-ded5-454b-89f9-564444356b9a@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=m.frank@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal