move datastore config to pbs_config workspace

This commit is contained in:
Dietmar Maurer
2021-09-10 08:40:58 +02:00
parent ba3d7e19fb
commit e7d4be9d85
24 changed files with 311 additions and 342 deletions

View File

@ -3,7 +3,6 @@ use serde_json::Value;
use proxmox::api::{api, cli::*, RpcEnvironment, ApiHandler};
use proxmox_backup::config;
use proxmox_backup::api2;
#[api(
@ -61,7 +60,7 @@ pub fn acl_commands() -> CommandLineInterface {
CliCommand::new(&api2::access::acl::API_METHOD_UPDATE_ACL)
.arg_param(&["path", "role"])
.completion_cb("auth-id", pbs_config::user::complete_authid)
.completion_cb("path", config::datastore::complete_acl_path)
.completion_cb("path", pbs_config::datastore::complete_acl_path)
);

View File

@ -4,10 +4,9 @@ use serde_json::Value;
use proxmox::api::{api, cli::*, RpcEnvironment, ApiHandler};
use pbs_client::{connect_to_localhost, view_task_result};
use pbs_api_types::{DataStoreConfig, DATASTORE_SCHEMA};
use proxmox_backup::config;
use proxmox_backup::api2::{self, types::* };
use proxmox_backup::config::datastore::DataStoreConfig;
use proxmox_backup::api2;
#[api(
input: {
@ -106,7 +105,7 @@ pub fn datastore_commands() -> CommandLineInterface {
.insert("show",
CliCommand::new(&API_METHOD_SHOW_DATASTORE)
.arg_param(&["name"])
.completion_cb("name", config::datastore::complete_datastore_name)
.completion_cb("name", pbs_config::datastore::complete_datastore_name)
)
.insert("create",
CliCommand::new(&API_METHOD_CREATE_DATASTORE)
@ -115,14 +114,14 @@ pub fn datastore_commands() -> CommandLineInterface {
.insert("update",
CliCommand::new(&api2::config::datastore::API_METHOD_UPDATE_DATASTORE)
.arg_param(&["name"])
.completion_cb("name", config::datastore::complete_datastore_name)
.completion_cb("gc-schedule", config::datastore::complete_calendar_event)
.completion_cb("prune-schedule", config::datastore::complete_calendar_event)
.completion_cb("name", pbs_config::datastore::complete_datastore_name)
.completion_cb("gc-schedule", pbs_config::datastore::complete_calendar_event)
.completion_cb("prune-schedule", pbs_config::datastore::complete_calendar_event)
)
.insert("remove",
CliCommand::new(&api2::config::datastore::API_METHOD_DELETE_DATASTORE)
.arg_param(&["name"])
.completion_cb("name", config::datastore::complete_datastore_name)
.completion_cb("name", pbs_config::datastore::complete_datastore_name)
);
cmd_def.into()

View File

@ -3,8 +3,9 @@ use serde_json::Value;
use proxmox::api::{api, cli::*, RpcEnvironment, ApiHandler};
use proxmox_backup::config;
use proxmox_backup::api2::{self, types::* };
use pbs_api_types::JOB_ID_SCHEMA;
use proxmox_backup::api2;
#[api(
input: {
@ -83,8 +84,8 @@ pub fn sync_job_commands() -> CommandLineInterface {
CliCommand::new(&api2::config::sync::API_METHOD_CREATE_SYNC_JOB)
.arg_param(&["id"])
.completion_cb("id", pbs_config::sync::complete_sync_job_id)
.completion_cb("schedule", config::datastore::complete_calendar_event)
.completion_cb("store", config::datastore::complete_datastore_name)
.completion_cb("schedule", pbs_config::datastore::complete_calendar_event)
.completion_cb("store", pbs_config::datastore::complete_datastore_name)
.completion_cb("remote", pbs_config::remote::complete_remote_name)
.completion_cb("remote-store", crate::complete_remote_datastore_name)
)
@ -92,8 +93,8 @@ pub fn sync_job_commands() -> CommandLineInterface {
CliCommand::new(&api2::config::sync::API_METHOD_UPDATE_SYNC_JOB)
.arg_param(&["id"])
.completion_cb("id", pbs_config::sync::complete_sync_job_id)
.completion_cb("schedule", config::datastore::complete_calendar_event)
.completion_cb("store", config::datastore::complete_datastore_name)
.completion_cb("schedule", pbs_config::datastore::complete_calendar_event)
.completion_cb("store", pbs_config::datastore::complete_datastore_name)
.completion_cb("remote-store", crate::complete_remote_datastore_name)
)
.insert("remove",

View File

@ -5,9 +5,9 @@ use std::collections::HashMap;
use proxmox::api::{api, cli::*, RpcEnvironment, ApiHandler};
use proxmox_backup::config;
use pbs_api_types::{ACL_PATH_SCHEMA, Authid, Userid};
use proxmox_backup::api2;
use proxmox_backup::api2::types::{ACL_PATH_SCHEMA, Authid, Userid};
fn render_expire(value: &Value, _record: &Value) -> Result<String, Error> {
let never = String::from("never");
@ -213,7 +213,7 @@ pub fn user_commands() -> CommandLineInterface {
CliCommand::new(&&API_METHOD_LIST_PERMISSIONS)
.arg_param(&["auth-id"])
.completion_cb("auth-id", pbs_config::user::complete_authid)
.completion_cb("path", config::datastore::complete_acl_path)
.completion_cb("path", pbs_config::datastore::complete_acl_path)
);
cmd_def.into()

View File

@ -3,8 +3,9 @@ use serde_json::Value;
use proxmox::api::{api, cli::*, RpcEnvironment, ApiHandler};
use proxmox_backup::config;
use proxmox_backup::api2::{self, types::* };
use pbs_api_types::JOB_ID_SCHEMA;
use proxmox_backup::api2;
#[api(
input: {
@ -83,15 +84,15 @@ pub fn verify_job_commands() -> CommandLineInterface {
CliCommand::new(&api2::config::verify::API_METHOD_CREATE_VERIFICATION_JOB)
.arg_param(&["id"])
.completion_cb("id", pbs_config::verify::complete_verification_job_id)
.completion_cb("schedule", config::datastore::complete_calendar_event)
.completion_cb("store", config::datastore::complete_datastore_name)
.completion_cb("schedule", pbs_config::datastore::complete_calendar_event)
.completion_cb("store", pbs_config::datastore::complete_datastore_name)
)
.insert("update",
CliCommand::new(&api2::config::verify::API_METHOD_UPDATE_VERIFICATION_JOB)
.arg_param(&["id"])
.completion_cb("id", pbs_config::verify::complete_verification_job_id)
.completion_cb("schedule", config::datastore::complete_calendar_event)
.completion_cb("store", config::datastore::complete_datastore_name)
.completion_cb("schedule", pbs_config::datastore::complete_calendar_event)
.completion_cb("store", pbs_config::datastore::complete_datastore_name)
.completion_cb("remote-store", crate::complete_remote_datastore_name)
)
.insert("remove",