Skip to content

Instantly share code, notes, and snippets.

@photomattmills
Created March 31, 2016 16:54
Show Gist options
  • Save photomattmills/ac881df5a06255e08102f7339919e702 to your computer and use it in GitHub Desktop.
Save photomattmills/ac881df5a06255e08102f7339919e702 to your computer and use it in GitHub Desktop.
require 'typhoeus'
require 'json'
require 'uri'
domain = 'https://silver-jellyfish.rmq.cloudamqp.com/'
#get your username and password and put them here
userpass = "user:pass"
connections_req = Typhoeus::Request.get("#{domain}api/connections", userpwd: userpass )
connections = JSON.parse(connections_req.body)
names = connections.map{|c| c["name"] }
names.each do |name|
Typhoeus::Request.delete("#{domain}api/connections/#{URI::encode name}", userpwd: userpass)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment