Created
April 8, 2015 13:00
-
-
Save peralmq/a07f976969c296d2549f to your computer and use it in GitHub Desktop.
Oneliner for deleting all RabbitMQ connections.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Probably only works for ZSH. Expects jq (http://stedolan.github.io/jq/) and node (https://nodejs.org/) to be installed | |
# Replace <user>, <password>, and <host> to suit your needs. | |
URL="https://<user>:<password>@<host>.cloudamqp.com"; for name in "${(@f)$(http $URL/api/connections | jq '.[]|.name')}"; do encoded=`node -e "console.log(encodeURIComponent($name))"`; http DELETE $URL/api/connections/$encoded; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment