fix: cli error & routes api doc (#5639)

This commit is contained in:
DDDHuang 2021-09-03 16:07:34 +08:00 committed by GitHub
parent ffbf9b0fab
commit 07821b9574
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -64,7 +64,7 @@ route_api() ->
name => topic,
in => path,
required => true,
description => <<"topic">>,
description => <<"Topic string, url encoding">>,
schema => #{type => string}
}],
responses => #{

View File

@ -73,8 +73,9 @@ status(_) ->
%% @doc Query broker
broker([]) ->
Funs = [sysdescr, version, uptime, datetime],
[emqx_ctl:print("~-10s: ~s~n", [Fun, emqx_sys:Fun()]) || Fun <- Funs];
Funs = [sysdescr, version, datetime],
[emqx_ctl:print("~-10s: ~s~n", [Fun, emqx_sys:Fun()]) || Fun <- Funs],
emqx_ctl:print("~-10s: ~p~n", [uptime, emqx_sys:uptime()]);
broker(["stats"]) ->
[emqx_ctl:print("~-30s: ~w~n", [Stat, Val]) || {Stat, Val} <- lists:sort(emqx_stats:getstats())];
@ -286,7 +287,7 @@ vm(["io"]) ->
[emqx_ctl:print("io/~-21s: ~w~n", [Key, proplists:get_value(Key, IoInfo)]) || Key <- [max_fds, active_fds]];
vm(["ports"]) ->
[emqx_ctl:print("ports/~-16s: ~w~n", [Name, erlang:system_info(Key)]) || {Name, Key} <- [{count, port_count}, {limit, port_limit}]];
[emqx_ctl:print("ports/~-18s: ~w~n", [Name, erlang:system_info(Key)]) || {Name, Key} <- [{count, port_count}, {limit, port_limit}]];
vm(_) ->
emqx_ctl:usage([{"vm all", "Show info of Erlang VM"},