pub struct AlertRule {Show 13 fields
pub id: String,
pub name: String,
pub description: String,
pub condition: AlertCondition,
pub severity: AlertSeverity,
pub enabled: bool,
pub notification_channels: Vec<String>,
pub tags: HashMap<String, String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub cooldown_minutes: u32,
pub auto_resolve: bool,
pub auto_resolve_after_minutes: Option<u32>,
}Expand description
Alert rule definition
Fields§
§id: String§name: String§description: String§condition: AlertCondition§severity: AlertSeverity§enabled: bool§notification_channels: Vec<String>§created_at: DateTime<Utc>§updated_at: DateTime<Utc>§cooldown_minutes: u32§auto_resolve: bool§auto_resolve_after_minutes: Option<u32>Implementations§
Source§impl AlertRule
impl AlertRule
pub fn new( id: impl Into<String>, name: impl Into<String>, condition: AlertCondition, severity: AlertSeverity, ) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_channels(self, channels: Vec<String>) -> Self
pub fn with_tag(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_cooldown(self, minutes: u32) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AlertRule
impl<'de> Deserialize<'de> for AlertRule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AlertRule
impl RefUnwindSafe for AlertRule
impl Send for AlertRule
impl Sync for AlertRule
impl Unpin for AlertRule
impl UnwindSafe for AlertRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more