1 extern crate proxmox_backup
;
3 use proxmox
::api
::cli
::*;
5 fn datastore_commands() -> CommandLineInterface
{
7 use proxmox_backup
::config
;
8 use proxmox_backup
::api2
;
10 let cmd_def
= CliCommandMap
::new()
11 .insert("list", CliCommand
::new(&api2
::config
::datastore
::GET
))
13 CliCommand
::new(&api2
::config
::datastore
::POST
)
14 .arg_param(&["name", "path"])
17 CliCommand
::new(&api2
::config
::datastore
::DELETE
)
19 .completion_cb("name", config
::datastore
::complete_datastore_name
)
27 fn garbage_collection_commands() -> CommandLineInterface
{
29 use proxmox_backup
::config
;
30 use proxmox_backup
::api2
;
32 let cmd_def
= CliCommandMap
::new()
34 CliCommand
::new(&api2
::admin
::datastore
::API_METHOD_GARBAGE_COLLECTION_STATUS
)
35 .arg_param(&["store"])
36 .completion_cb("store", config
::datastore
::complete_datastore_name
)
39 CliCommand
::new(&api2
::admin
::datastore
::API_METHOD_START_GARBAGE_COLLECTION
)
40 .arg_param(&["store"])
41 .completion_cb("store", config
::datastore
::complete_datastore_name
)
49 let cmd_def
= CliCommandMap
::new()
50 .insert("datastore", datastore_commands())
51 .insert("garbage-collection", garbage_collection_commands());
53 run_cli_command(cmd_def
);