Add API and pvesm call for prune_backups

For the pvesm call use a wrapper and a --dry-run option to redirect
to the correct API call.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner
2020-07-09 14:45:43 +02:00
committed by Thomas Lamprecht
parent 8f26b3910d
commit 25a9583634
4 changed files with 298 additions and 1 deletions

View File

@ -11,6 +11,7 @@ use PVE::Cluster;
use PVE::RRD;
use PVE::Storage;
use PVE::API2::Storage::Content;
use PVE::API2::Storage::PruneBackups;
use PVE::RESTHandler;
use PVE::RPCEnvironment;
use PVE::JSONSchema qw(get_standard_option);
@ -18,6 +19,11 @@ use PVE::Exception qw(raise_param_exc);
use base qw(PVE::RESTHandler);
__PACKAGE__->register_method ({
subclass => "PVE::API2::Storage::PruneBackups",
path => '{storage}/prunebackups',
});
__PACKAGE__->register_method ({
subclass => "PVE::API2::Storage::Content",
# set fragment delimiter (no subdirs) - we need that, because volume
@ -214,6 +220,7 @@ __PACKAGE__->register_method ({
{ subdir => 'upload' },
{ subdir => 'rrd' },
{ subdir => 'rrddata' },
{ subdir => 'prunebackups' },
];
return $res;