fix: cli error & routes api doc (#5639)
This commit is contained in:
parent
ffbf9b0fab
commit
07821b9574
|
@ -64,7 +64,7 @@ route_api() ->
|
||||||
name => topic,
|
name => topic,
|
||||||
in => path,
|
in => path,
|
||||||
required => true,
|
required => true,
|
||||||
description => <<"topic">>,
|
description => <<"Topic string, url encoding">>,
|
||||||
schema => #{type => string}
|
schema => #{type => string}
|
||||||
}],
|
}],
|
||||||
responses => #{
|
responses => #{
|
||||||
|
|
|
@ -73,8 +73,9 @@ status(_) ->
|
||||||
%% @doc Query broker
|
%% @doc Query broker
|
||||||
|
|
||||||
broker([]) ->
|
broker([]) ->
|
||||||
Funs = [sysdescr, version, uptime, datetime],
|
Funs = [sysdescr, version, datetime],
|
||||||
[emqx_ctl:print("~-10s: ~s~n", [Fun, emqx_sys:Fun()]) || Fun <- Funs];
|
[emqx_ctl:print("~-10s: ~s~n", [Fun, emqx_sys:Fun()]) || Fun <- Funs],
|
||||||
|
emqx_ctl:print("~-10s: ~p~n", [uptime, emqx_sys:uptime()]);
|
||||||
|
|
||||||
broker(["stats"]) ->
|
broker(["stats"]) ->
|
||||||
[emqx_ctl:print("~-30s: ~w~n", [Stat, Val]) || {Stat, Val} <- lists:sort(emqx_stats:getstats())];
|
[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]];
|
[emqx_ctl:print("io/~-21s: ~w~n", [Key, proplists:get_value(Key, IoInfo)]) || Key <- [max_fds, active_fds]];
|
||||||
|
|
||||||
vm(["ports"]) ->
|
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(_) ->
|
vm(_) ->
|
||||||
emqx_ctl:usage([{"vm all", "Show info of Erlang VM"},
|
emqx_ctl:usage([{"vm all", "Show info of Erlang VM"},
|
||||||
|
|
Loading…
Reference in New Issue