Skip to content

Instantly share code, notes, and snippets.

@peralmq
Created April 8, 2015 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peralmq/a07f976969c296d2549f to your computer and use it in GitHub Desktop.
Save peralmq/a07f976969c296d2549f to your computer and use it in GitHub Desktop.
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