[pbs-devel] [PATCH proxmox-backup v5 4/8] api: make maintenance_type updatable

Hannes Laimer h.laimer at proxmox.com
Mon Jan 24 13:31:55 CET 2022


Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
 src/api2/config/datastore.rs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/api2/config/datastore.rs b/src/api2/config/datastore.rs
index 60bc3c0e..3b74d989 100644
--- a/src/api2/config/datastore.rs
+++ b/src/api2/config/datastore.rs
@@ -184,6 +184,8 @@ pub enum DeletableProperty {
     notify_user,
     /// Delete the notify property
     notify,
+    /// Delete the maintenance-type property
+    maintenance_type,
 }
 
 #[api(
@@ -250,6 +252,7 @@ pub fn update_datastore(
                 DeletableProperty::verify_new => { data.verify_new = None; },
                 DeletableProperty::notify => { data.notify = None; },
                 DeletableProperty::notify_user => { data.notify_user = None; },
+                DeletableProperty::maintenance_type => { data.maintenance_type = None; },
             }
         }
     }
@@ -295,6 +298,8 @@ pub fn update_datastore(
 
     if update.notify_user.is_some() { data.notify_user = update.notify_user; }
 
+    if update.maintenance_type.is_some() { data.maintenance_type = update.maintenance_type; }
+
     config.set_data(&name, "datastore", &data)?;
 
     pbs_config::datastore::save_config(&config)?;
-- 
2.30.2






More information about the pbs-devel mailing list