[pbs-devel] [PATCH proxmox-backup 1/7] api2/types: add TaskStateType struct

Dominik Csapak d.csapak at proxmox.com
Mon Oct 5 15:43:11 CEST 2020


the same as the regular TaskState, but without its fields, so that
we can use the api macro and use it as api call parameter

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/api2/types/mod.rs | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/api2/types/mod.rs b/src/api2/types/mod.rs
index 348d3bf4..75b68879 100644
--- a/src/api2/types/mod.rs
+++ b/src/api2/types/mod.rs
@@ -662,6 +662,20 @@ impl From<crate::server::TaskListInfo> for TaskListItem {
     }
 }
 
+#[api()]
+#[derive(Eq, PartialEq, Debug, Serialize, Deserialize)]
+#[serde(rename_all = "lowercase")]
+pub enum TaskStateType {
+    /// Ok
+    OK,
+    /// Warning
+    Warning,
+    /// Error
+    Error,
+    /// Unknown
+    Unknown,
+}
+
 #[api()]
 #[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
 #[serde(rename_all = "lowercase")]
-- 
2.20.1






More information about the pbs-devel mailing list