[PATCH proxmox v7 11/34] pbs-api-types: add reset schedule for notification threshold counters

Christian Ebner
2026-04-01T13:48:24Z

Allows to configure scheduled resets the counters related to
notification thresholds. Use same calendar events as already used for
job schedules.

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>
---
pbs-api-types/src/datastore.rs | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index 191a266c..6beda550 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -420,6 +420,14 @@ impl FromStr for DatastoreBackendConfig {
}
}

+pub const COUNTER_RESET_SCHEDULE_SCHEMA: Schema =
+ StringSchema::new("Reset notification threshold related counters at specified schedule.")
+ .format(&ApiStringFormat::VerifyFn(
+ proxmox_time::verify_calendar_event,
+ ))
+ .type_text("<calendar-event>")
+ .schema();
+
#[api(
properties: {
name: {
@@ -480,6 +488,10 @@ impl FromStr for DatastoreBackendConfig {
format: &ApiStringFormat::PropertyString(&RequestCounterThresholds::API_SCHEMA),
type: String,
},
+ "counter-reset-schedule": {
+ optional: true,
+ schema: COUNTER_RESET_SCHEDULE_SCHEMA,
+ },
}
)]
#[derive(Serialize, Deserialize, Updater, Clone, PartialEq)]
@@ -541,6 +553,10 @@ pub struct DataStoreConfig {
/// Threshold values for notifications
#[serde(skip_serializing_if = "Option::is_none")]
pub notification_thresholds: Option<String>,
+
+ /// Notification threshold related counter reset schedule
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub counter_reset_schedule: Option<String>,
}

#[api]
@@ -581,6 +597,7 @@ impl DataStoreConfig {
backing_device: None,
backend: None,
notification_thresholds: None,
+ counter_reset_schedule: None,
}
}

--
2.47.3