split out proxmox-backup-client binary
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
7b570c177d
commit
e351ac786d
@ -29,6 +29,7 @@ members = [
|
|||||||
"pbs-tools",
|
"pbs-tools",
|
||||||
|
|
||||||
"proxmox-backup-banner",
|
"proxmox-backup-banner",
|
||||||
|
"proxmox-backup-client",
|
||||||
"pxar-bin",
|
"pxar-bin",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -98,7 +99,6 @@ pbs-api-types = { path = "pbs-api-types" }
|
|||||||
pbs-buildcfg = { path = "pbs-buildcfg" }
|
pbs-buildcfg = { path = "pbs-buildcfg" }
|
||||||
pbs-client = { path = "pbs-client" }
|
pbs-client = { path = "pbs-client" }
|
||||||
pbs-datastore = { path = "pbs-datastore" }
|
pbs-datastore = { path = "pbs-datastore" }
|
||||||
pbs-fuse-loop = { path = "pbs-fuse-loop" }
|
|
||||||
pbs-runtime = { path = "pbs-runtime" }
|
pbs-runtime = { path = "pbs-runtime" }
|
||||||
pbs-systemd = { path = "pbs-systemd" }
|
pbs-systemd = { path = "pbs-systemd" }
|
||||||
pbs-tools = { path = "pbs-tools" }
|
pbs-tools = { path = "pbs-tools" }
|
||||||
|
4
Makefile
4
Makefile
@ -40,6 +40,7 @@ SUBCRATES := \
|
|||||||
pbs-systemd \
|
pbs-systemd \
|
||||||
pbs-tools \
|
pbs-tools \
|
||||||
proxmox-backup-banner \
|
proxmox-backup-banner \
|
||||||
|
proxmox-backup-client \
|
||||||
pxar-bin
|
pxar-bin
|
||||||
|
|
||||||
ifeq ($(BUILD_MODE), release)
|
ifeq ($(BUILD_MODE), release)
|
||||||
@ -167,12 +168,13 @@ $(COMPILED_BINS) $(COMPILEDIR)/dump-catalog-shell-cli $(COMPILEDIR)/docgen: .do-
|
|||||||
$(CARGO) build $(CARGO_BUILD_ARGS) \
|
$(CARGO) build $(CARGO_BUILD_ARGS) \
|
||||||
--package proxmox-backup-banner \
|
--package proxmox-backup-banner \
|
||||||
--bin proxmox-backup-banner \
|
--bin proxmox-backup-banner \
|
||||||
|
--package proxmox-backup-client \
|
||||||
|
--bin proxmox-backup-client \
|
||||||
--package pxar-bin \
|
--package pxar-bin \
|
||||||
--bin pxar \
|
--bin pxar \
|
||||||
--package proxmox-backup \
|
--package proxmox-backup \
|
||||||
--bin dump-catalog-shell-cli \
|
--bin dump-catalog-shell-cli \
|
||||||
--bin pmt --bin pmtx \
|
--bin pmt --bin pmtx \
|
||||||
--bin proxmox-backup-client \
|
|
||||||
--bin proxmox-daily-update \
|
--bin proxmox-daily-update \
|
||||||
--bin proxmox-file-restore \
|
--bin proxmox-file-restore \
|
||||||
--bin proxmox-restore-daemon \
|
--bin proxmox-restore-daemon \
|
||||||
|
34
proxmox-backup-client/Cargo.toml
Normal file
34
proxmox-backup-client/Cargo.toml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[package]
|
||||||
|
name = "proxmox-backup-client"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Proxmox Support Team <support@proxmox.com>"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
anyhow = "1.0"
|
||||||
|
futures = "0.3"
|
||||||
|
hyper = { version = "0.14", features = [ "full" ] }
|
||||||
|
libc = "0.2"
|
||||||
|
nix = "0.19.1"
|
||||||
|
openssl = "0.10"
|
||||||
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
serde_json = "1.0"
|
||||||
|
tokio = { version = "1.6", features = [ "rt", "rt-multi-thread" ] }
|
||||||
|
tokio-stream = "0.1.0"
|
||||||
|
tokio-util = { version = "0.6", features = [ "codec", "io" ] }
|
||||||
|
xdg = "2.2"
|
||||||
|
zstd = { version = "0.6", features = [ "bindgen" ] }
|
||||||
|
|
||||||
|
pathpatterns = "0.1.2"
|
||||||
|
pxar = { version = "0.10.1", features = [ "tokio-io" ] }
|
||||||
|
|
||||||
|
proxmox = { version = "0.13.0", features = [ "sortable-macro", "api-macro", "cli", "router" ] }
|
||||||
|
|
||||||
|
pbs-api-types = { path = "../pbs-api-types" }
|
||||||
|
pbs-buildcfg = { path = "../pbs-buildcfg" }
|
||||||
|
pbs-client = { path = "../pbs-client" }
|
||||||
|
pbs-datastore = { path = "../pbs-datastore" }
|
||||||
|
pbs-fuse-loop = { path = "../pbs-fuse-loop" }
|
||||||
|
pbs-runtime = { path = "../pbs-runtime" }
|
||||||
|
pbs-systemd = { path = "../pbs-systemd" }
|
||||||
|
pbs-tools = { path = "../pbs-tools" }
|
@ -76,8 +76,17 @@ use pbs_tools::sync::StdChannelWriter;
|
|||||||
use pbs_tools::tokio::TokioWriterAdapter;
|
use pbs_tools::tokio::TokioWriterAdapter;
|
||||||
use pbs_tools::json;
|
use pbs_tools::json;
|
||||||
|
|
||||||
mod proxmox_backup_client;
|
mod benchmark;
|
||||||
use proxmox_backup_client::*;
|
pub use benchmark::*;
|
||||||
|
mod mount;
|
||||||
|
pub use mount::*;
|
||||||
|
mod task;
|
||||||
|
pub use task::*;
|
||||||
|
mod catalog;
|
||||||
|
pub use catalog::*;
|
||||||
|
mod snapshot;
|
||||||
|
pub use snapshot::*;
|
||||||
|
pub mod key;
|
||||||
|
|
||||||
fn record_repository(repo: &BackupRepository) {
|
fn record_repository(repo: &BackupRepository) {
|
||||||
|
|
||||||
@ -295,7 +304,7 @@ async fn list_backup_groups(param: Value) -> Result<Value, Error> {
|
|||||||
|
|
||||||
let mut data: Value = result["data"].take();
|
let mut data: Value = result["data"].take();
|
||||||
|
|
||||||
let return_type = &proxmox_backup::api2::admin::datastore::API_METHOD_LIST_GROUPS.returns;
|
let return_type = &pbs_api_types::ADMIN_DATASTORE_LIST_GROUPS_RETURN_TYPE;
|
||||||
|
|
||||||
format_and_print_result_full(&mut data, return_type, &output_format, &options);
|
format_and_print_result_full(&mut data, return_type, &output_format, &options);
|
||||||
|
|
||||||
@ -1310,7 +1319,7 @@ async fn prune(
|
|||||||
.column(ColumnConfig::new("keep").renderer(render_prune_action).header("action"))
|
.column(ColumnConfig::new("keep").renderer(render_prune_action).header("action"))
|
||||||
;
|
;
|
||||||
|
|
||||||
let return_type = &proxmox_backup::api2::admin::datastore::API_METHOD_PRUNE.returns;
|
let return_type = &pbs_api_types::ADMIN_DATASTORE_PRUNE_RETURN_TYPE;
|
||||||
|
|
||||||
let mut data = result["data"].take();
|
let mut data = result["data"].take();
|
||||||
|
|
@ -91,7 +91,7 @@ async fn list_snapshots(param: Value) -> Result<Value, Error> {
|
|||||||
.column(ColumnConfig::new("files").renderer(render_files))
|
.column(ColumnConfig::new("files").renderer(render_files))
|
||||||
;
|
;
|
||||||
|
|
||||||
let return_type = &proxmox_backup::api2::admin::datastore::API_METHOD_LIST_SNAPSHOTS.returns;
|
let return_type = &pbs_api_types::ADMIN_DATASTORE_LIST_SNAPSHOTS_RETURN_TYPE;
|
||||||
|
|
||||||
format_and_print_result_full(&mut data, return_type, &output_format, &options);
|
format_and_print_result_full(&mut data, return_type, &output_format, &options);
|
||||||
|
|
||||||
@ -138,8 +138,7 @@ async fn list_snapshot_files(param: Value) -> Result<Value, Error> {
|
|||||||
|
|
||||||
record_repository(&repo);
|
record_repository(&repo);
|
||||||
|
|
||||||
let return_type =
|
let return_type = &pbs_api_types::ADMIN_DATASTORE_LIST_SNAPSHOT_FILES_RETURN_TYPE;
|
||||||
&proxmox_backup::api2::admin::datastore::API_METHOD_LIST_SNAPSHOT_FILES.returns;
|
|
||||||
|
|
||||||
let mut data: Value = result["data"].take();
|
let mut data: Value = result["data"].take();
|
||||||
|
|
@ -65,7 +65,7 @@ async fn task_list(param: Value) -> Result<Value, Error> {
|
|||||||
let mut result = client.get("api2/json/nodes/localhost/tasks", Some(args)).await?;
|
let mut result = client.get("api2/json/nodes/localhost/tasks", Some(args)).await?;
|
||||||
let mut data = result["data"].take();
|
let mut data = result["data"].take();
|
||||||
|
|
||||||
let return_type = &proxmox_backup::api2::node::tasks::API_METHOD_LIST_TASKS.returns;
|
let return_type = &pbs_api_types::NODE_TASKS_LIST_TASKS_RETURN_TYPE;
|
||||||
|
|
||||||
use pbs_tools::format::{render_epoch, render_task_status};
|
use pbs_tools::format::{render_epoch, render_task_status};
|
||||||
let options = default_table_format_options()
|
let options = default_table_format_options()
|
@ -1,13 +0,0 @@
|
|||||||
mod benchmark;
|
|
||||||
pub use benchmark::*;
|
|
||||||
mod mount;
|
|
||||||
pub use mount::*;
|
|
||||||
mod task;
|
|
||||||
pub use task::*;
|
|
||||||
mod catalog;
|
|
||||||
pub use catalog::*;
|
|
||||||
mod snapshot;
|
|
||||||
pub use snapshot::*;
|
|
||||||
|
|
||||||
pub mod key;
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user