Skip to content

Commit

Permalink
fix cscli alerts delete -all (#769)
Browse files Browse the repository at this point in the history
Co-authored-by: AlteredCoder <AlteredCoder>
  • Loading branch information
AlteredCoder committed Apr 27, 2021
1 parent e82ad57 commit a19f13a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/crowdsec-cli/alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions pkg/apiclient/alerts_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit a19f13a

Please sign in to comment.