FreeKB - RabbitMQ List Virtual Hosts (vhost) using the curl command
RabbitMQ - List Virtual Hosts (vhost) using the curl command

This assumes you have created a RabbitMQ user with the administrator tag.

Refer to the RabbitMQ REST API documentation.

The curl command with the --user option can be used to make an API connection to RabbitMQ. In this example, John Doe will make a connection to the RabbitMQ server listening on port 15671. Or, the rabbitmqctl list_queues or rabbitmqadmin list queues commands can be used.

curl --user john.doe:itsasecret http://hostname:15671/api/vhosts

 

Or, you can specify a single virtual host.

curl --user john.doe:itsasecret http://hostname:15671/api/foo

 

For the / vhost, use %2F.

curl --user john.doe:itsasecret http://hostname:15671/api/%2F

 

Something like this should be returned for each virtual host.

{
 "name":"foo",
 "tracing":false,
 "cluster_state":{"rabbit@server01":"running"},
 "messages_ready":18,
 "messages_ready_details":{"rate":0.0},
 "messages_unacknowledged":0,
 "messages_unacknowledged_details":{"rate":0.0},
 "messages":18,
 "messages_details":{"rate":0.0}
}

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 07849 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |