[PATCH proxmox-backup v7 31/34] api: config: allow counter reset schedule editing

Christian Ebner
2026-04-01T13:49:28Z

Must allow to create/edit/delete the schedule which will be used to
periodically reset notification threshold related counters.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Reviewed-by: Hannes Laimer <h.laimer@proxmox.com>
Tested-by: Hannes Laimer <h.laimer@proxmox.com>
---
src/api2/config/datastore.rs | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/src/api2/config/datastore.rs b/src/api2/config/datastore.rs
index d51c60f43..a34b3e22a 100644
--- a/src/api2/config/datastore.rs
+++ b/src/api2/config/datastore.rs
@@ -439,6 +439,8 @@ pub enum DeletableProperty {
MaintenanceMode,
/// Delete the notification-thresholds property
NotificationThresholds,
+ /// Delete the counter reset schedule.
+ CounterResetSchedule,
}

#[api(
@@ -541,6 +543,9 @@ pub fn update_datastore(
data.notification_thresholds = None;
update_thresholds(&data)?;
}
+ DeletableProperty::CounterResetSchedule => {
+ data.counter_reset_schedule = None;
+ }
}
}
}
@@ -631,6 +636,10 @@ pub fn update_datastore(
update_thresholds(&data)?;
}

+ if update.counter_reset_schedule.is_some() {
+ data.counter_reset_schedule = update.counter_reset_schedule;
+ }
+
config.set_data(&name, "datastore", &data)?;

pbs_config::datastore::save_config(&config)?;
--
2.47.3