Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to api-query for the default vhost

Tags:

rabbitmq

The RabbitMQ documentation states:

Default Virtual Host and User

When the server first starts running, and detects that its database is uninitialised or has been deleted, it initialises a fresh database with the following resources:

a virtual host named /

The api has things like:

/api/exchanges/#vhost#/?name?/bindings

where "?name?" is a specific exchange-name.

However, what does one put in for the #vhost# for the default-vhost?

like image 551
granadaCoder Avatar asked May 09 '16 19:05

granadaCoder


1 Answers

As write here: http://hg.rabbitmq.com/rabbitmq-management/raw-file/3646dee55e02/priv/www-api/help.html

As the default virtual host is called "/", this will need to be encoded as "%2f".

so:

/api/exchanges/%2f/{exchange_name}/bindings/source

full:

http://localhost:15672/api/exchanges/%2f/test_ex/bindings/source

as result:

[{"source":"test_ex","vhost":"/","destination":"test_queue","destination_type":"queue","routing_key":"","arguments":{},"properties_key":"~"}]
like image 139
Gabriele Santomaggio Avatar answered Sep 16 '22 19:09

Gabriele Santomaggio