I had a curl command which I converted using this.
This is the Ruby script:
rabbitmqctl_url = CONFIG['rabbitmqctl']['url']
rabbitmqctl_user = CONFIG['rabbitmqctl']['username']
rabbitmqctl_password = CONFIG['rabbitmqctl']['password']
uri = URI.parse("#{rabbitmqctl_url}/api/queues")
request = Net::HTTP::Get.new(uri)
request.basic_auth(rabbitmqctl_user, rabbitmqctl_password)
req_options = { use_ssl: uri.scheme == 'https' }
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(request)
end
puts response.body
This is the curl command:
curl -u username:password http:localhost 15672/api/queue
This code is very lengthy.