Skip to content

Commit

Permalink
Definition export: include virtual host metadata
Browse files Browse the repository at this point in the history
when exporting over the HTTP API. CLI tools
use rabbit_definitions:all_definitions/0 which
already include the metadata.

Closes #10515
  • Loading branch information
michaelklishin committed Feb 12, 2024
1 parent c57e790 commit 2ca0648
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions deps/rabbit/src/rabbit_vhost.erl
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ i(description, VHost) -> vhost:get_description(VHost);
i(tags, VHost) -> vhost:get_tags(VHost);
i(default_queue_type, VHost) -> vhost:get_default_queue_type(VHost);
i(metadata, VHost) -> vhost:get_metadata(VHost);
i(limits, VHost) -> vhost:get_limits(VHost);
i(Item, VHost) ->
rabbit_log:error("Don't know how to compute a virtual host info item '~ts' for virtual host '~tp'", [Item, VHost]),
throw({bad_argument, Item}).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export_name(_Name) -> true.

rw_state() ->
[{users, [name, password_hash, hashing_algorithm, tags, limits]},
{vhosts, [name]},
{vhosts, [name, metadata, default_queue_type, limits]},
{permissions, [user, vhost, configure, write, read]},
{topic_permissions, [user, vhost, exchange, write, read]},
{parameters, [vhost, component, name, value]},
Expand Down
4 changes: 3 additions & 1 deletion deps/rabbitmq_management/src/rabbit_mgmt_wm_vhosts.erl
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,6 @@ augmented(ReqData, #context{user = User}) ->
end.

basic() ->
rabbit_vhost:info_all([name]).
%% when updating this list, make sure to also update
%% rabbit_mgmt_wm_definitions:rw_state/0
rabbit_vhost:info_all([name, metadata, default_queue_type, limits]).

0 comments on commit 2ca0648

Please sign in to comment.