diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs index 45dd41ae..31767417 100644 --- a/pbs-api-types/src/datastore.rs +++ b/pbs-api-types/src/datastore.rs @@ -309,6 +309,10 @@ pub struct DataStoreConfig { #[serde(skip_serializing_if = "Option::is_none")] pub notify: Option, + /// Opt in to the new notification system + #[serde(skip_serializing_if = "Option::is_none")] + pub notification_mode: Option, + /// Datastore tuning options #[serde(skip_serializing_if = "Option::is_none")] pub tuning: Option, @@ -318,6 +322,23 @@ pub struct DataStoreConfig { pub maintenance_mode: Option, } +#[api] +#[derive(Serialize, Deserialize, Updater, Clone, PartialEq, Default)] +#[serde(rename_all = "kebab-case")] +/// Configure how notifications for this datastore should be sent. +/// `legacy-sendmail` sends email notifications to the user configured +/// in `notify-user` via the system's `sendmail` executable. +/// `notification-system` emits matchable notification events to the +/// notification system. +pub enum NotificationMode { + /// Send notifications via the system's sendmail command to the user + /// configured in `notify-user` + #[default] + LegacySendmail, + /// Emit notification events to the notification system + NotificationSystem, +} + impl DataStoreConfig { pub fn new(name: String, path: String) -> Self { Self { @@ -330,6 +351,7 @@ impl DataStoreConfig { verify_new: None, notify_user: None, notify: None, + notification_mode: None, tuning: None, maintenance_mode: None, }