public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH storage 1/2] api2/storage/content: add comment and verification fields to content listing
Date: Thu, 12 Nov 2020 16:26:01 +0100	[thread overview]
Message-ID: <20201112152603.8106-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20201112152603.8106-1-d.csapak@proxmox.com>

for now only for pbs, since we do not have such infos elsewhere

Signed-off-by: Dominik Csapak <d.csapak@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





  reply	other threads:[~2020-11-12 15:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12 15:26 [pve-devel] [PATCH storage/manager] show comment/verification info for backups Dominik Csapak
2020-11-12 15:26 ` Dominik Csapak [this message]
2020-11-12 16:42   ` [pve-devel] applied: [PATCH storage 1/2] api2/storage/content: add comment and verification fields to content listing Thomas Lamprecht
2020-11-12 15:26 ` [pve-devel] [PATCH storage 2/2] Storage/Plugin: read .comment files for comments Dominik Csapak
2020-11-12 16:50   ` Thomas Lamprecht
2020-11-12 15:26 ` [pve-devel] [PATCH manager 1/1] ui: add comment/verification columns to backup/content grid Dominik Csapak
2020-11-12 17:38   ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201112152603.8106-2-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal