]> git.proxmox.com Git - proxmox-backup.git/commitdiff
list_snapshots: return manifest fingerprint
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 20 Nov 2020 16:38:42 +0000 (17:38 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 24 Nov 2020 07:44:55 +0000 (08:44 +0100)
for display in clients.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/api2/admin/datastore.rs
src/api2/types/mod.rs

index 86d0847c45f9985f2ac3a1d4cbfcc31d2e8b52c6..bce58a781331b78100cdce308994222dd6a3d10c 100644 (file)
@@ -403,6 +403,14 @@ pub fn list_snapshots (
                     .and_then(|notes| notes.lines().next())
                     .map(String::from);
 
+                let fingerprint = match manifest.fingerprint() {
+                    Ok(fp) => fp,
+                    Err(err) => {
+                        eprintln!("error parsing fingerprint: '{}'", err);
+                        None
+                    },
+                };
+
                 let verification = manifest.unprotected["verify_state"].clone();
                 let verification: Option<SnapshotVerifyState> = match serde_json::from_value(verification) {
                     Ok(verify) => verify,
@@ -420,6 +428,7 @@ pub fn list_snapshots (
                     backup_time,
                     comment,
                     verification,
+                    fingerprint,
                     files,
                     size,
                     owner,
@@ -443,6 +452,7 @@ pub fn list_snapshots (
                     backup_time,
                     comment: None,
                     verification: None,
+                    fingerprint: None,
                     files,
                     size: None,
                     owner,
index d7d5a8afdf0ec9ceb96c956353334e20feb0cc05..b347fc298c540bd9cf529294dd10804cc99b175b 100644 (file)
@@ -5,7 +5,7 @@ use proxmox::api::{api, schema::*};
 use proxmox::const_regex;
 use proxmox::{IPRE, IPRE_BRACKET, IPV4RE, IPV6RE, IPV4OCTET, IPV6H16, IPV6LS32};
 
-use crate::backup::{CryptMode, BACKUP_ID_REGEX};
+use crate::backup::{CryptMode, Fingerprint, BACKUP_ID_REGEX};
 use crate::server::UPID;
 
 #[macro_use]
@@ -484,6 +484,10 @@ pub struct SnapshotVerifyState {
             type: SnapshotVerifyState,
             optional: true,
         },
+        fingerprint: {
+            type: String,
+            optional: true,
+        },
         files: {
             items: {
                 schema: BACKUP_ARCHIVE_NAME_SCHEMA
@@ -508,6 +512,9 @@ pub struct SnapshotListItem {
     /// The result of the last run verify task
     #[serde(skip_serializing_if="Option::is_none")]
     pub verification: Option<SnapshotVerifyState>,
+    /// Fingerprint of encryption key
+    #[serde(skip_serializing_if="Option::is_none")]
+    pub fingerprint: Option<Fingerprint>,
     /// List of contained archive files.
     pub files: Vec<BackupContent>,
     /// Overall snapshot size (sum of all archive sizes).