use const api definitions

This commit is contained in:
Dietmar Maurer
2019-11-21 09:36:41 +01:00
parent e4a5ab8ddb
commit 255f378a1b
40 changed files with 2368 additions and 1974 deletions

View File

@ -9,13 +9,13 @@ fn datastore_commands() -> CommandLineInterface {
use proxmox_backup::api2;
let cmd_def = CliCommandMap::new()
.insert("list", CliCommand::new(api2::config::datastore::get()).into())
.insert("list", CliCommand::new(&api2::config::datastore::GET).into())
.insert("create",
CliCommand::new(api2::config::datastore::post())
CliCommand::new(&api2::config::datastore::POST)
.arg_param(vec!["name", "path"])
.into())
.insert("remove",
CliCommand::new(api2::config::datastore::delete())
CliCommand::new(&api2::config::datastore::DELETE)
.arg_param(vec!["name"])
.completion_cb("name", config::datastore::complete_datastore_name)
.into());
@ -32,12 +32,12 @@ fn garbage_collection_commands() -> CommandLineInterface {
let cmd_def = CliCommandMap::new()
.insert("status",
CliCommand::new(api2::admin::datastore::api_method_garbage_collection_status())
CliCommand::new(&api2::admin::datastore::API_METHOD_GARBAGE_COLLECTION_STATUS)
.arg_param(vec!["store"])
.completion_cb("store", config::datastore::complete_datastore_name)
.into())
.insert("start",
CliCommand::new(api2::admin::datastore::api_method_start_garbage_collection())
CliCommand::new(&api2::admin::datastore::API_METHOD_START_GARBAGE_COLLECTION)
.arg_param(vec!["store"])
.completion_cb("store", config::datastore::complete_datastore_name)
.into());