]>
git.proxmox.com Git - proxmox-backup.git/blob - src/bin/proxmox-backup-manager.rs
1 extern crate proxmox_backup
;
3 //use proxmox_backup::api2;
4 use proxmox_backup
::cli
::*;
6 fn datastore_commands() -> CommandLineInterface
{
8 use proxmox_backup
::config
;
9 use proxmox_backup
::api2
;
11 let cmd_def
= CliCommandMap
::new()
12 .insert("list", CliCommand
::new(api2
::config
::datastore
::get()).into())
14 CliCommand
::new(api2
::config
::datastore
::post())
15 .arg_param(vec
!["name", "path"])
18 CliCommand
::new(api2
::config
::datastore
::delete())
19 .arg_param(vec
!["name"])
20 .completion_cb("name", config
::datastore
::complete_datastore_name
)
28 fn garbage_collection_commands() -> CommandLineInterface
{
30 use proxmox_backup
::config
;
31 use proxmox_backup
::api2
;
33 let cmd_def
= CliCommandMap
::new()
35 CliCommand
::new(api2
::admin
::datastore
::api_method_garbage_collection_status())
36 .arg_param(vec
!["store"])
37 .completion_cb("store", config
::datastore
::complete_datastore_name
)
40 CliCommand
::new(api2
::admin
::datastore
::api_method_start_garbage_collection())
41 .arg_param(vec
!["store"])
42 .completion_cb("store", config
::datastore
::complete_datastore_name
)
50 let cmd_def
= CliCommandMap
::new()
51 .insert("datastore".to_owned(), datastore_commands())
52 .insert("garbage-collection".to_owned(), garbage_collection_commands());
54 run_cli_command(cmd_def
.into());