Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Oneliner for deleting all RabbitMQ connections.
# 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
You can’t perform that action at this time.