public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH] api/status: readd gc-status
Date: Fri, 29 Apr 2022 12:07:12 +0200	[thread overview]
Message-ID: <20220429100712.1104206-1-d.csapak@proxmox.com> (raw)

this was removed during the recent cleanup of this api call, and
we missed that the gc-status was used in the gui for the
datastore overview list (not the dashboard), so simply readd it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 pbs-api-types/src/datastore.rs | 3 +++
 src/api2/status.rs             | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index df891cac..e0b900d9 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -975,6 +975,9 @@ pub struct DataStoreStatusListItem {
     /// An error description, for example, when the datastore could not be looked up
     #[serde(skip_serializing_if = "Option::is_none")]
     pub error: Option<String>,
+    /// Status of last GC
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub gc_status: Option<GarbageCollectionStatus>,
 }
 
 pub const ADMIN_DATASTORE_LIST_SNAPSHOTS_RETURN_TYPE: ReturnType = ReturnType {
diff --git a/src/api2/status.rs b/src/api2/status.rs
index 51cb345b..45aa7fd7 100644
--- a/src/api2/status.rs
+++ b/src/api2/status.rs
@@ -63,6 +63,7 @@ pub fn datastore_status(
                     history_delta: None,
                     estimated_full_date: None,
                     error: Some(err.to_string()),
+                    gc_status: None,
                 });
                 continue;
             }
@@ -79,6 +80,7 @@ pub fn datastore_status(
             history_delta: None,
             estimated_full_date: None,
             error: None,
+            gc_status: Some(datastore.last_gc_status()),
         };
 
         let rrd_dir = format!("datastore/{}", store);
-- 
2.30.2





             reply	other threads:[~2022-04-29 10:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29 10:07 Dominik Csapak [this message]
2022-05-02  8:12 ` [pbs-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=20220429100712.1104206-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-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