]> git.proxmox.com Git - proxmox-backup.git/commitdiff
api2/types: add TaskStateType struct
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 6 Oct 2020 10:25:23 +0000 (12:25 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 6 Oct 2020 10:58:52 +0000 (12:58 +0200)
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@proxmox.com>
src/api2/types/mod.rs

index 348d3bf487d929fa1698733b2da3b74e2f16997e..75b688799e5683efd1f766ea25039bd626106151 100644 (file)
@@ -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")]