[pbs-devel] [PATCH v3 proxmox 1/20] pbs api types: add type for snapshot list filtering based on trash state

Christian Ebner c.ebner at proxmox.com
Tue May 13 15:52:28 CEST 2025


Adds a dedicated enum to allow filtering snapshots based on their
trash state. Allows to include, exclude or only show trashed
snapshots when listing.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 pbs-api-types/src/datastore.rs | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index 5bd953ac..d50d6f2b 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -1772,6 +1772,20 @@ impl BackupGroupDeleteStats {
     }
 }
 
+#[api()]
+#[derive(Serialize, Deserialize, Copy, Clone, Default, Debug, PartialOrd, PartialEq)]
+#[serde(rename_all = "kebab-case")]
+/// Filter snapshots based on their trash state.
+pub enum TrashStateFilter {
+    #[default]
+    /// Exclude snapshots which are marked as trash.
+    ExcludeTrash,
+    /// Include snapshots which are marked as trash.
+    IncludeTrash,
+    /// Only include snapshots which are marked as trash.
+    OnlyTrash,
+}
+
 #[derive(Clone, PartialEq, Eq)]
 /// Allowed variants of backup archives to be contained in a snapshot's manifest
 pub enum ArchiveType {
-- 
2.39.5





More information about the pbs-devel mailing list