move more tools for the client into subcrates

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2021-07-15 12:15:50 +02:00
parent 9eb784076c
commit 4805edc4ec
29 changed files with 115 additions and 102 deletions

View File

@ -4,8 +4,8 @@ use futures::*;
use proxmox::try_block;
use proxmox::api::RpcEnvironmentType;
//use proxmox_backup::tools;
//use proxmox_backup::api_schema::config::*;
use pbs_tools::auth::private_auth_key;
use proxmox_backup::server::{
self,
auth::default_api_auth,

View File

@ -28,12 +28,9 @@ use proxmox::{
use pxar::accessor::{MaybeReady, ReadAt, ReadAtOperation};
use pbs_datastore::catalog::BackupCatalogWriter;
use pbs_tools::sync::StdChannelWriter;
use pbs_tools::tokio::TokioWriterAdapter;
use proxmox_backup::tools::{
self,
StdChannelWriter,
TokioWriterAdapter,
};
use proxmox_backup::api2::types::*;
use proxmox_backup::api2::version;
use proxmox_backup::client::*;
@ -64,6 +61,7 @@ use proxmox_backup::backup::{
Shell,
PruneOptions,
};
use proxmox_backup::tools;
mod proxmox_backup_client;
use proxmox_backup_client::*;

View File

@ -6,6 +6,8 @@ use serde_json::{json, Value};
use proxmox::api::{api, cli::*, RpcEnvironment};
use pbs_tools::percent_encoding::percent_encode_component;
use proxmox_backup::tools;
use proxmox_backup::config;
use proxmox_backup::api2::{self, types::* };
@ -188,7 +190,7 @@ async fn task_stop(param: Value) -> Result<Value, Error> {
let mut client = connect_to_localhost()?;
let path = format!("api2/json/nodes/localhost/tasks/{}", tools::percent_encode_component(upid_str));
let path = format!("api2/json/nodes/localhost/tasks/{}", percent_encode_component(upid_str));
let _ = client.delete(&path, None).await?;
Ok(Value::Null)

View File

@ -3,6 +3,8 @@ use serde_json::{json, Value};
use proxmox::api::{api, cli::*};
use pbs_tools::percent_encoding::percent_encode_component;
use proxmox_backup::tools;
use proxmox_backup::client::*;
@ -125,7 +127,7 @@ async fn task_stop(param: Value) -> Result<Value, Error> {
let mut client = connect(&repo)?;
let path = format!("api2/json/nodes/localhost/tasks/{}", tools::percent_encode_component(upid_str));
let path = format!("api2/json/nodes/localhost/tasks/{}", percent_encode_component(upid_str));
let _ = client.delete(&path, None).await?;
Ok(Value::Null)

View File

@ -2,9 +2,10 @@ use anyhow::{bail, Error};
use proxmox::api::{api, cli::*};
use pbs_tools::cert::CertInfo;
use proxmox_backup::config;
use proxmox_backup::auth_helpers::*;
use proxmox_backup::tools::cert::CertInfo;
#[api]
/// Display node certificate information.