pub struct IncidentManager { /* private fields */ }Expand description
Manager for drift incidents
Implementations§
Source§impl IncidentManager
impl IncidentManager
Sourcepub fn new(store: Arc<IncidentStore>) -> Self
pub fn new(store: Arc<IncidentStore>) -> Self
Create a new incident manager
Sourcepub fn new_with_webhooks(
store: Arc<IncidentStore>,
webhook_configs: Vec<WebhookConfig>,
) -> Self
pub fn new_with_webhooks( store: Arc<IncidentStore>, webhook_configs: Vec<WebhookConfig>, ) -> Self
Create a new incident manager with webhook configurations
Sourcepub fn add_webhook(&mut self, config: WebhookConfig)
pub fn add_webhook(&mut self, config: WebhookConfig)
Add webhook configuration
Sourcepub async fn create_incident(
&self,
endpoint: String,
method: String,
incident_type: IncidentType,
severity: IncidentSeverity,
details: Value,
budget_id: Option<String>,
workspace_id: Option<String>,
) -> DriftIncident
pub async fn create_incident( &self, endpoint: String, method: String, incident_type: IncidentType, severity: IncidentSeverity, details: Value, budget_id: Option<String>, workspace_id: Option<String>, ) -> DriftIncident
Create a new incident from drift result
Sourcepub async fn create_incident_with_samples(
&self,
endpoint: String,
method: String,
incident_type: IncidentType,
severity: IncidentSeverity,
details: Value,
budget_id: Option<String>,
workspace_id: Option<String>,
sync_cycle_id: Option<String>,
contract_diff_id: Option<String>,
before_sample: Option<Value>,
after_sample: Option<Value>,
) -> DriftIncident
pub async fn create_incident_with_samples( &self, endpoint: String, method: String, incident_type: IncidentType, severity: IncidentSeverity, details: Value, budget_id: Option<String>, workspace_id: Option<String>, sync_cycle_id: Option<String>, contract_diff_id: Option<String>, before_sample: Option<Value>, after_sample: Option<Value>, ) -> DriftIncident
Create a new incident with before/after samples and traceability
Sourcepub async fn get_incident(&self, id: &str) -> Option<DriftIncident>
pub async fn get_incident(&self, id: &str) -> Option<DriftIncident>
Get an incident by ID
Sourcepub async fn update_incident(&self, incident: DriftIncident)
pub async fn update_incident(&self, incident: DriftIncident)
Update an incident
Sourcepub async fn acknowledge_incident(&self, id: &str) -> Option<DriftIncident>
pub async fn acknowledge_incident(&self, id: &str) -> Option<DriftIncident>
Acknowledge an incident
Sourcepub async fn resolve_incident(&self, id: &str) -> Option<DriftIncident>
pub async fn resolve_incident(&self, id: &str) -> Option<DriftIncident>
Resolve an incident
Sourcepub async fn close_incident(&self, id: &str) -> Option<DriftIncident>
pub async fn close_incident(&self, id: &str) -> Option<DriftIncident>
Close an incident
Sourcepub async fn link_external_ticket(
&self,
id: &str,
ticket_id: String,
ticket_url: Option<String>,
) -> Option<DriftIncident>
pub async fn link_external_ticket( &self, id: &str, ticket_id: String, ticket_url: Option<String>, ) -> Option<DriftIncident>
Link an external ticket to an incident
Sourcepub async fn query_incidents(&self, query: IncidentQuery) -> Vec<DriftIncident>
pub async fn query_incidents(&self, query: IncidentQuery) -> Vec<DriftIncident>
Query incidents
Sourcepub async fn get_open_incidents(&self) -> Vec<DriftIncident>
pub async fn get_open_incidents(&self) -> Vec<DriftIncident>
Get all open incidents
Sourcepub async fn get_statistics(&self) -> HashMap<IncidentStatus, usize>
pub async fn get_statistics(&self) -> HashMap<IncidentStatus, usize>
Get incident statistics
Sourcepub async fn cleanup_old_incidents(&self, retention_days: u32)
pub async fn cleanup_old_incidents(&self, retention_days: u32)
Clean up old resolved incidents
Trait Implementations§
Source§impl Clone for IncidentManager
impl Clone for IncidentManager
Source§fn clone(&self) -> IncidentManager
fn clone(&self) -> IncidentManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IncidentManager
impl !RefUnwindSafe for IncidentManager
impl Send for IncidentManager
impl Sync for IncidentManager
impl Unpin for IncidentManager
impl !UnwindSafe for IncidentManager
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more