fix cscli alerts delete -all (#769)

Co-authored-by: AlteredCoder <AlteredCoder>
This commit is contained in:
AlteredCoder 2021-04-27 11:59:18 +02:00 committed by GitHub
parent e82ad5704d
commit a19f13ab45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -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 {

View file

@ -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
}