storage => get_standard_option('pve-storage-id', {
completion => \&PVE::Storage::complete_storage_enabled,
}),
- 'prune-backups' => get_standard_option('prune-backups', {
- description => "Use these retention options instead of those from the storage configuration.",
- optional => 1,
- }),
+ %{$PVE::Storage::Plugin::prune_backups_format},
type => {
description => "Either 'qemu' or 'lxc'. Only consider backups for guests of this type.",
type => 'string',
my $dryrun = extract_param($param, 'dry-run') ? 1 : 0;
+ my $keep_opts;
+ foreach my $keep (keys %{$PVE::Storage::Plugin::prune_backups_format}) {
+ $keep_opts->{$keep} = extract_param($param, $keep) if defined($param->{$keep});
+ }
+ $param->{'prune-backups'} = PVE::JSONSchema::print_property_string(
+ $keep_opts, $PVE::Storage::Plugin::prune_backups_format) if $keep_opts;
+
my $list = [];
if ($dryrun) {
$list = PVE::API2::Storage::PruneBackups->dryrun($param);
format_description => 'N',
);
-my $prune_backups_format = {
+our $prune_backups_format = {
'keep-last' => {
%prune_option,
description => 'Keep the last <N> backups.',