diff --git a/cmd/crowdsec-cli/alerts.go b/cmd/crowdsec-cli/alerts.go index 97c282a6719..0face05ecb0 100644 --- a/cmd/crowdsec-cli/alerts.go +++ b/cmd/crowdsec-cli/alerts.go @@ -397,7 +397,8 @@ cscli alerts delete -s crowdsecurity/ssh-bf"`, alertDeleteFilter.Contains = new(bool) } } else { - alertDeleteFilter = apiclient.AlertsDeleteOpts{} + limit := 0 + alertDeleteFilter = apiclient.AlertsDeleteOpts{Limit: &limit} } alerts, _, err := Client.Alerts.Delete(context.Background(), alertDeleteFilter) if err != nil { diff --git a/pkg/apiclient/alerts_service.go b/pkg/apiclient/alerts_service.go index 1ad3e9e71bd..bdbf6c34f65 100644 --- a/pkg/apiclient/alerts_service.go +++ b/pkg/apiclient/alerts_service.go @@ -41,6 +41,7 @@ type AlertsDeleteOpts struct { ActiveDecisionEquals *bool `url:"has_active_decision,omitempty"` SourceEquals *string `url:"alert_source,omitempty"` Contains *bool `url:"contains,omitempty"` + Limit *int `url:"limit,omitempty"` ListOpts }