public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 0/1] cli: removal of directories
@ 2020-08-18  9:31 Hannes Laimer
  2020-08-18  9:31 ` [pbs-devel] [PATCH proxmox-backup 1/1] cli: functionality for the removal of dirs from manager cli Hannes Laimer
  0 siblings, 1 reply; 2+ messages in thread
From: Hannes Laimer @ 2020-08-18  9:31 UTC (permalink / raw)
  To: pbs-devel

Added functionallity to the manager-cli for the removal of
directories/mount-units.

Hannes Laimer (1):
  cli: functionality for the removal of dirs from manager cli

 src/bin/proxmox_backup_manager/disk.rs | 33 ++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

-- 
2.20.1





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pbs-devel] [PATCH proxmox-backup 1/1] cli: functionality for the removal of dirs from manager cli
  2020-08-18  9:31 [pbs-devel] [PATCH proxmox-backup 0/1] cli: removal of directories Hannes Laimer
@ 2020-08-18  9:31 ` Hannes Laimer
  0 siblings, 0 replies; 2+ messages in thread
From: Hannes Laimer @ 2020-08-18  9:31 UTC (permalink / raw)
  To: pbs-devel

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
 src/bin/proxmox_backup_manager/disk.rs | 33 ++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/src/bin/proxmox_backup_manager/disk.rs b/src/bin/proxmox_backup_manager/disk.rs
index a93a6f6b..d74b97ed 100644
--- a/src/bin/proxmox_backup_manager/disk.rs
+++ b/src/bin/proxmox_backup_manager/disk.rs
@@ -319,6 +319,34 @@ 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!(),
+    };
+
+    crate::wait_for_local_worker(result.as_str().unwrap()).await?;
+
+    Ok(Value::Null)
+}
+
 pub fn filesystem_commands() -> CommandLineInterface {
 
     let cmd_def = CliCommandMap::new()
@@ -327,8 +355,9 @@ pub fn filesystem_commands() -> CommandLineInterface {
                 CliCommand::new(&API_METHOD_CREATE_DATASTORE_DISK)
                 .arg_param(&["name"])
                 .completion_cb("disk", complete_disk_name)
-        );
-
+        ).insert("remove",
+                 CliCommand::new(&API_METHOD_DELETE_DATASTORE_DISK)
+                .arg_param(&["name"]));
     cmd_def.into()
 }
 
-- 
2.20.1





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-18  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18  9:31 [pbs-devel] [PATCH proxmox-backup 0/1] cli: removal of directories Hannes Laimer
2020-08-18  9:31 ` [pbs-devel] [PATCH proxmox-backup 1/1] cli: functionality for the removal of dirs from manager cli Hannes Laimer

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