Commit Graph

24 Commits

Author SHA1 Message Date
Dominik Csapak
b4b17fd95b pbs client: add 'tar' parameter to file_restore_extract
so that we can get a 'tar.zst' from proxmox-file-restore by passing
'--format tar --zstd' to the file-restore binary

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-06 18:33:38 +01:00
Dominik Csapak
76e28e0325 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>
2022-11-15 13:22:30 +01:00
Fabian Ebner
89ed119db3 pbs client: backup fs tree: drop namespace parameter
Instead, use the one from the initial configuration. The only current
caller is in PMG and the namespace parameter set there agrees with
the one from the initial configuration, so this is not actually a
breaking change.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-11-04 14:01:47 +01:00
Fabian Ebner
a95beed20d pbs client: deprecate namespaced parameters
All existing callers for functions with namespaced parameters just
re-use the one that's passed in via the initial configuration already,
so there is no need for namespaced parameters currently.

If the need for one PBS client to handle multiple namespaces arises, a
set_namespace() function could be added, or the relevant functions
could take an additional parameter, either for just the namespace or
like $cmd_opts in restore_pxar().

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-11-04 14:01:38 +01:00
Fabian Ebner
139dc881ed pbs client: default to configured namespace for non-namespaced parameters
For get_snapshots(), also set the default when no namespaced parameter
is present at all.

This would break any callers that have a namespace in the initial
config and explicitly don't set it for a later call, but the only
such caller is restore_pxar() in PMG, which /should/ be using the
namespace!

In other words, this implicitly fixes the restore_pxar() call in PMG
and avoids the need to extract the namespace from the configuration
(which already is present in the client) on the call site for all
functions that currently take a namespaced parameter.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-11-04 14:01:34 +01:00
Fabian Ebner
e1fa96e197 pbs client: forget snapshot: suppress output
Otherwise, there will be
Result: {
      "data": null
}
when calling via a CLI tool for example. This also makes it consistent
with PVE in preparation to switch to using PBSClient there.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-11-04 14:01:25 +01:00
Fabian Ebner
01d2fb7844 pbs client: delete password: return success for non-existent file
It's currently possible to add a remote in PMG without password (via
API), but deletion of such a remote would fail here.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-11-04 14:01:22 +01:00
Wolfgang Bumiller
4a09bdc3ef pbs-client: namespace support
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-05-12 12:04:05 +02:00
Thomas Lamprecht
6b00e70cd1 pbs: keep a separate $USE_CRYPT_PARAMS list per command exe
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-23 14:15:13 +02:00
Thomas Lamprecht
76ddb876d9 pbs: rework client exe handling and error message
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-23 14:14:36 +02:00
Stefan Reiter
f7c0254131 PBSClient: use crypt params for file 'list' and 'extract'
Necessary for accessing encrypted backups.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-22 18:17:35 +02:00
Stefan Reiter
77e402f085 PBSClient: add file_restore_extract function
*_prepare creates a fifo for streaming data back to clients directly,
filefile_restore_extract blocks and should be called from a background
worker - while it is running outcoming data can be read from the FIFO.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-22 18:17:35 +02:00
Stefan Reiter
67252649d9 PBSClient: add file_restore_list command
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-22 18:17:35 +02:00
Stefan Reiter
9f727e5536 PBSClient: adapt error message to include full package names
More helpful for a user to know what they're missing.

Suggested-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-22 18:17:35 +02:00
Stefan Reiter
b15abdfe2e PBSClient: allow running other binaries
...such as proxmox-file-restore.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-04-21 17:37:02 +02:00
Dominik Csapak
5640c3db26 PBSClient: add get_repository to generate repository urls from configs
we can use this everywhere we need to have a repository url

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-12-03 16:39:21 +01:00
Thomas Lamprecht
6674eb1e3d PBS client: backup tree: avoid over generic param has
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 13:04:53 +01:00
Thomas Lamprecht
2113c7e8e9 PBS client: get snapshots: avoid over generic param has
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 13:04:43 +01:00
Thomas Lamprecht
69a3a5858f PBS client: cannot use normal method call style for private subs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 13:03:50 +01:00
Thomas Lamprecht
8b88b2f6e5 pbs: restore pxar: add required parameters explicitly in method signature
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 09:39:03 +01:00
Thomas Lamprecht
ad6b323758 pbs: code cleanup param array assembly
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 09:38:28 +01:00
Thomas Lamprecht
0cc6c7e01b pbs: autogen key: adapt recent changes in storage module
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 09:12:31 +01:00
Thomas Lamprecht
243568ca26 PBS client: use our normal blessed method call style
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 09:12:02 +01:00
Stoiko Ivanov
0904f388a7 add PBSClient module
PBSClient.pm contains methods for:
* handling (sensitive) config-information (passwords, encryption keys)
* creating/restoring/forgetting/listing backups

code is mostly based on the current PBSPlugin in pve-storage

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-11-17 08:57:22 +01:00