]>
git.proxmox.com Git - proxmox-backup.git/blob - src/bin/backup-client.rs
5 use std
::collections
::HashMap
;
7 use apitest
::cli
::command
::*;
8 use apitest
::api
::schema
::*;
9 use apitest
::api
::router
::*;
10 use apitest
::backup
::chunk_store
::*;
11 use serde_json
::{json, Value}
;
12 use std
::path
::{Path, PathBuf}
;
14 use apitest
::config
::datastore
;
16 fn backup_file(param
: Value
, _info
: &ApiMethod
) -> Result
<Value
, Error
> {
18 println
!("Backup file '{}'", param
["filename"].as_str().unwrap());
26 let cmd_def
= CliCommand
::new(
29 ObjectSchema
::new("Create backup from file.")
30 .required("filename", StringSchema
::new("Source file name."))
31 .required("store", StringSchema
::new("Datastore name."))
33 .arg_param(vec
!["filename"]);
35 if let Err(err
) = run_cli_command(&cmd_def
.into()) {
36 eprintln
!("Error: {}", err
);
38 std
::process
::exit(-1);