api: content listing: add comment and verification fields

for now only for PBS, since we do not have such info elsewhere

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2020-11-12 16:26:01 +01:00
committed by Thomas Lamprecht
parent 4558cb6eb6
commit 9778e5c216
2 changed files with 23 additions and 0 deletions

View File

@ -87,6 +87,26 @@ __PACKAGE__->register_method ({
minimum => 0,
optional => 1,
},
comment => {
description => "An optional Comment.",
type => 'string',
optional => 1,
},
verification => {
description => "Last backup verification result, only useful for PBS storages.",
type => 'object',
properties => {
state => {
description => "Last backup verification state.",
type => 'string',
},
upid => {
description => "Last backup verification UPID.",
type => 'string',
},
},
optional => 1,
},
},
},
links => [ { rel => 'child', href => "{volid}" } ],

View File

@ -525,6 +525,9 @@ sub list_volumes {
ctime => $epoch,
};
$info->{verification} = $item->{verification} if defined($item->{verification});
$info->{comment} = $item->{comment} if defined($item->{comment});
push @$res, $info;
}