[pbs-devel] [PATCH proxmox-backup v10 4/6] api: make maintenance_type updatable

Hannes Laimer h.laimer at proxmox.com
Tue Apr 12 07:25:59 CEST 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 992092a9..686f337e 100644
--- a/src/api2/config/datastore.rs
+++ b/src/api2/config/datastore.rs
@@ -186,6 +186,8 @@ pub enum DeletableProperty {
     notify,
     /// Delete the tuning property
     tuning,
+    /// Delete the maintenance-mode property
+    maintenance_mode,
 }
 
 #[api(
@@ -253,6 +255,7 @@ pub fn update_datastore(
                 DeletableProperty::notify => { data.notify = None; },
                 DeletableProperty::notify_user => { data.notify_user = None; },
                 DeletableProperty::tuning => { data.tuning = None; },
+                DeletableProperty::maintenance_mode => { data.maintenance_mode = None; },
             }
         }
     }
@@ -300,6 +303,8 @@ pub fn update_datastore(
 
     if update.tuning.is_some() { data.tuning = update.tuning; }
 
+    if update.maintenance_mode.is_some() { data.maintenance_mode = update.maintenance_mode; }
+
     config.set_data(&name, "datastore", &data)?;
 
     pbs_config::datastore::save_config(&config)?;
-- 
2.30.2






More information about the pbs-devel mailing list