From 9778e5c2160f1109801ec17ac696af345d5a6ff2 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 12 Nov 2020 16:26:01 +0100 Subject: [PATCH] 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 --- PVE/API2/Storage/Content.pm | 20 ++++++++++++++++++++ PVE/Storage/PBSPlugin.pm | 3 +++ 2 files changed, 23 insertions(+) diff --git a/PVE/API2/Storage/Content.pm b/PVE/API2/Storage/Content.pm index f2e3e57..8d2ff32 100644 --- a/PVE/API2/Storage/Content.pm +++ b/PVE/API2/Storage/Content.pm @@ -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}" } ], diff --git a/PVE/Storage/PBSPlugin.pm b/PVE/Storage/PBSPlugin.pm index e4c431e..f3bf016 100644 --- a/PVE/Storage/PBSPlugin.pm +++ b/PVE/Storage/PBSPlugin.pm @@ -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; } -- 2.39.2