Function bulk_update_alert_status

Source
pub async fn bulk_update_alert_status(
    pool: &Pool<MySql>,
    ids: Option<Vec<i64>>,
    service: Option<&str>,
    app_id: Option<i64>,
    new_status: &str,
    user_id: i64,
    notes: Option<&str>,
) -> Result<i64>
Expand description

Bulk updates the status of multiple alerts.

This function changes the status of multiple alerts at once based on provided criteria, which is useful for operations like resolving all alerts for a specific service or application.

§Arguments

  • pool - Database connection pool for executing the query
  • ids - Optional vector of alert IDs to update
  • service - Optional service name to filter alerts
  • app_id - Optional application ID to filter alerts
  • new_status - Status to set for matching alerts
  • user_id - ID of the user performing the bulk update
  • notes - Optional notes about the bulk update

§Returns

  • Ok(i64) - Number of alerts updated
  • Err(anyhow::Error) - Failed to update alerts