diff options
author | Emile Joubert <emile@lshift.net> | 2008-11-14 00:03:39 +0000 |
---|---|---|
committer | Emile Joubert <emile@lshift.net> | 2008-11-14 00:03:39 +0000 |
commit | 4646889600500993c5a69c6f6640b6175da97c8a (patch) | |
tree | c5f545dd30bd84693a7a0d7c36ecad065aeedd5e /src/rabbit_control.erl | |
parent | 05e8da946fae7154c97a2b19b1d1b0bdf7207c3a (diff) | |
parent | c20d4e8033060497dc4843e47f09134a79914970 (diff) | |
download | rabbitmq-server-4646889600500993c5a69c6f6640b6175da97c8a.tar.gz |
Merged bug18381 into bug19684
Diffstat (limited to 'src/rabbit_control.erl')
-rw-r--r-- | src/rabbit_control.erl | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl index bc588279..d6f5ad73 100644 --- a/src/rabbit_control.erl +++ b/src/rabbit_control.erl @@ -89,12 +89,18 @@ Available commands: list_user_vhosts <UserName> list_vhost_users <VHostPath> + list_queues <InfoItem> [<InfoItem> ...] + <node> should be the name of the master node of the RabbitMQ cluster. It defaults to the node named \"rabbit\" on the local host. On a host named \"server.example.com\", the master node will usually be rabbit@server (unless NODENAME has been set to some non-default value at broker startup time). The output of hostname -s is usually the correct suffix to use after the \"@\" sign. +<InfoItem> must be a member of the list [name, durable, auto_delete, arguments, +pid, messages_ready, messages_unacknowledged, messages_uncommitted, messages, +acks_uncommitted, consumers, transactions, memory]. + "), halt(1). @@ -179,7 +185,26 @@ action(list_user_vhosts, Node, Args = [_Username]) -> action(list_vhost_users, Node, Args = [_VHostPath]) -> io:format("Listing users for vhosts ~p...", Args), - display_list(call(Node, {rabbit_access_control, list_vhost_users, Args})). + display_list(call(Node, {rabbit_access_control, list_vhost_users, Args})); + +action(list_queues, Node, Args) -> + io:format("Listing queues ...~n"), + lists:map( + fun (ResultRow) -> + lists:map( + fun(ResultColumn) -> + case ResultColumn of + {name, #resource{virtual_host = VHostPath, kind = queue, name = Name}} -> + io:format("~s@~s ", [Name, VHostPath]); + {_, Res} -> + io:format("~w ", [Res]) + end + end, + ResultRow), + io:nl() + end, + rpc_call(Node, rabbit_amqqueue, info_all, [[list_to_atom(X) || X <- Args]])), + ok. display_list(L) when is_list(L) -> lists:foreach(fun (I) -> |