MCPcopy
hub / github.com/crowdsecurity/crowdsec / DeleteAlertWithFilter

Method DeleteAlertWithFilter

pkg/database/alerts.go:975–982  ·  view source on GitHub ↗
(ctx context.Context, filter map[string][]string)

Source from the content-addressed store, hash-verified

973}
974
975func (c *Client) DeleteAlertWithFilter(ctx context.Context, filter map[string][]string) (int, error) {
976 preds, err := alertPredicatesFromFilter(filter)
977 if err != nil {
978 return 0, err
979 }
980
981 return c.Ent.Alert.Delete().Where(preds...).Exec(ctx)
982}
983
984func (c *Client) GetAlertByID(ctx context.Context, alertID int) (*ent.Alert, error) {
985 alert, err := c.Ent.Alert.Query().Where(alert.IDEQ(alertID)).WithDecisions().WithEvents().WithMetas().WithOwner().First(ctx)

Callers 2

FlushAlertsMethod · 0.95
DeleteAlertsMethod · 0.80

Calls 4

ExecMethod · 0.45
WhereMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected