[pve-devel] [PATCH storage 1/2] api2/storage/content: add comment and verification fields to content listing
Dominik Csapak
d.csapak at proxmox.com
Thu Nov 12 16:26:01 CET 2020
for now only for pbs, since we do not have such infos elsewhere
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
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 6403e2e..28f6a3b 100644
--- a/PVE/Storage/PBSPlugin.pm
+++ b/PVE/Storage/PBSPlugin.pm
@@ -523,6 +523,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.20.1
More information about the pve-devel
mailing list