mirror of
git://git.proxmox.com/git/pve-common.git
synced 2025-02-02 21:46:59 +03:00
PBSClient: file_restore_list: add extraParams and use timeout
under some conditions, like when calling it in the api where we have a 30s pveproxy limit, we want to make use of the '--timeout' parameter of the file-restore binary, but we may want to call it in the future where we don't want add timeout. To achieve that, add an extendable 'extra_params' hash parameter to 'file_restore_list' and use the timeout from there. Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
eb6f49f4b2
commit
76e28e0325
@ -375,14 +375,19 @@ sub status {
|
|||||||
};
|
};
|
||||||
|
|
||||||
sub file_restore_list {
|
sub file_restore_list {
|
||||||
my ($self, $snapshot, $filepath, $base64) = @_;
|
my ($self, $snapshot, $filepath, $base64, $extra_params) = @_;
|
||||||
|
|
||||||
(my $namespace, $snapshot) = split_namespaced_parameter($self, $snapshot);
|
(my $namespace, $snapshot) = split_namespaced_parameter($self, $snapshot);
|
||||||
|
my $cmd = [ $snapshot, $filepath, "--base64", $base64 ? 1 : 0];
|
||||||
|
|
||||||
|
if (my $timeout = $extra_params->{timeout}) {
|
||||||
|
push $cmd->@*, '--timeout', $timeout;
|
||||||
|
}
|
||||||
|
|
||||||
return run_client_cmd(
|
return run_client_cmd(
|
||||||
$self,
|
$self,
|
||||||
"list",
|
"list",
|
||||||
[ $snapshot, $filepath, "--base64", $base64 ? 1 : 0 ],
|
$cmd,
|
||||||
0,
|
0,
|
||||||
"proxmox-file-restore",
|
"proxmox-file-restore",
|
||||||
$namespace,
|
$namespace,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user