crowdsec
crowdsec copied to clipboard
Improvement/Deletion of multiple bouncers at the same time
Is your feature request related to a problem? Please describe. I recently came across a situation where I had delete multiple bouncers installed on my instances.
Describe the solution you'd like I accidentaly installed multiple unwanted bouncers, on realizing it I tried to uninstall them, but realized there were 25 of them. I had to individually remove all of them to keep the one which I wanted.
Describe alternatives you've considered (Optional) It would really if we could give an argument to remove a particular number or all of the bouncers in a single line, instead of multiple monotonous lines.
Example of what you imagine This is command being mentioned in the above situation sudo cscli bouncers delete BOUNCER-NAME It could be written as: sudo cscli bouncers delete -n 4 or sudo cscli bouncers delete --all.
Additional context
Hello,
Thanks for the issue, this is definitely something we want to add.
In the meantime, you can delete all bouncer with this command:
for x in $(cscli bouncers list -o json | jq -r '.[] | .name'); do cscli bouncers delete "$x"; done
That was of great help! Thank you
From the help text it's not clear that we can already delete multiple bouncers at once, by providing several positional arguments:
$ ./tests/local/bin/cscli bouncers delete --help
delete bouncer
Usage:
cscli bouncers delete MyBouncerName [flags]
The help text (for all the commands) could be improved to conform with unix practices, like
$ rm --help
Usage: rm [OPTION]... [FILE]...
Remove (unlink) the FILE(s).
I'm keeping this open until I have done a review.
We added #2379 and updated help output of delete command that you can pass multiple names.
Closing as it has been merged and will be released 1.5.3