extern crate proxmox_backup;
-use failure::*;
+use anyhow::{format_err, Error};
use proxmox::{sortable, identity};
use proxmox::api::{ApiHandler, ApiMethod, RpcEnvironment};
use proxmox::api::schema::*;
+use proxmox::api::cli::*;
use proxmox_backup::tools;
-use proxmox_backup::cli::*;
use serde_json::{Value};
let no_sockets = param["no-sockets"].as_bool().unwrap_or(false);
let empty = Vec::new();
let exclude_pattern = param["exclude"].as_array().unwrap_or(&empty);
+ let entries_max = param["entries-max"].as_u64().unwrap_or(pxar::ENCODER_MAX_ENTRIES as u64);
let devices = if all_file_systems { None } else { Some(HashSet::new()) };
false,
feature_flags,
pattern_list,
+ entries_max as usize,
)?;
writer.flush()?;
&StringSchema::new("Path or pattern matching files to restore.").schema()
).schema()
),
+ (
+ "entries-max",
+ true,
+ &IntegerSchema::new("Max number of entries loaded at once into memory")
+ .default(pxar::ENCODER_MAX_ENTRIES as isize)
+ .minimum(0)
+ .maximum(std::isize::MAX)
+ .schema()
+ ),
]),
)
);
let cmd_def = CliCommandMap::new()
.insert("create", CliCommand::new(&API_METHOD_CREATE_ARCHIVE)
- .arg_param(&["archive", "source", "exclude"])
+ .arg_param(&["archive", "source"])
.completion_cb("archive", tools::complete_file_name)
.completion_cb("source", tools::complete_file_name)
- .into()
)
.insert("extract", CliCommand::new(&API_METHOD_EXTRACT_ARCHIVE)
- .arg_param(&["archive", "pattern"])
+ .arg_param(&["archive", "target"])
.completion_cb("archive", tools::complete_file_name)
.completion_cb("target", tools::complete_file_name)
.completion_cb("files-from", tools::complete_file_name)
- .into()
- )
+ )
.insert("mount", CliCommand::new(&API_METHOD_MOUNT_ARCHIVE)
.arg_param(&["archive", "mountpoint"])
.completion_cb("archive", tools::complete_file_name)
.completion_cb("mountpoint", tools::complete_file_name)
- .into()
)
.insert("list", CliCommand::new(&API_METHOD_DUMP_ARCHIVE)
.arg_param(&["archive"])
.completion_cb("archive", tools::complete_file_name)
- .into()
);
- run_cli_command(cmd_def.into());
+ let rpcenv = CliEnvironment::new();
+ run_cli_command(cmd_def, rpcenv, None);
}