Merge pull request #11142 from zhongwencool/list-listener-group-with-wrong-bind

List listener group with wrong bind
This commit is contained in:
zhongwencool 2023-06-29 11:04:35 +08:00 committed by GitHub
commit 9dae408b5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 16 deletions

View File

@ -213,9 +213,9 @@ schema("/clients/kickout/bulk") ->
post => #{ post => #{
description => ?DESC(kickout_clients), description => ?DESC(kickout_clients),
tags => ?TAGS, tags => ?TAGS,
'requestBody' => hoconsc:mk( 'requestBody' => emqx_dashboard_swagger:schema_with_example(
hoconsc:array(binary()), hoconsc:array(binary()),
#{desc => <<"The list of Client IDs that need to be kicked out">>} ["emqx_clienid_985bb09d", "emqx_clientid_211cc01c"]
), ),
responses => #{ responses => #{
204 => <<"Kick out clients successfully">> 204 => <<"Kick out clients successfully">>
@ -547,10 +547,14 @@ fields(client) ->
]; ];
fields(authz_cache) -> fields(authz_cache) ->
[ [
{access, hoconsc:mk(binary(), #{desc => <<"Access type">>})}, {access, hoconsc:mk(binary(), #{desc => <<"Access type">>, example => <<"publish">>})},
{result, hoconsc:mk(binary(), #{desc => <<"Allow or deny">>})}, {result,
{topic, hoconsc:mk(binary(), #{desc => <<"Topic name">>})}, hoconsc:mk(hoconsc:enum([allow, denny]), #{
{updated_time, hoconsc:mk(integer(), #{desc => <<"Update time">>})} desc => <<"Allow or deny">>, example => <<"allow">>
})},
{topic, hoconsc:mk(binary(), #{desc => <<"Topic name">>, example => <<"testtopic/1">>})},
{updated_time,
hoconsc:mk(integer(), #{desc => <<"Update time">>, example => 1687850712989})}
]; ];
fields(keepalive) -> fields(keepalive) ->
[ [
@ -559,7 +563,10 @@ fields(keepalive) ->
]; ];
fields(subscribe) -> fields(subscribe) ->
[ [
{topic, hoconsc:mk(binary(), #{required => true, desc => <<"Topic">>})}, {topic,
hoconsc:mk(binary(), #{
required => true, desc => <<"Topic">>, example => <<"testtopic/#">>
})},
{qos, hoconsc:mk(emqx_schema:qos(), #{default => 0, desc => <<"QoS">>})}, {qos, hoconsc:mk(emqx_schema:qos(), #{default => 0, desc => <<"QoS">>})},
{nl, hoconsc:mk(integer(), #{default => 0, desc => <<"No Local">>})}, {nl, hoconsc:mk(integer(), #{default => 0, desc => <<"No Local">>})},
{rap, hoconsc:mk(integer(), #{default => 0, desc => <<"Retain as Published">>})}, {rap, hoconsc:mk(integer(), #{default => 0, desc => <<"Retain as Published">>})},
@ -567,7 +574,7 @@ fields(subscribe) ->
]; ];
fields(unsubscribe) -> fields(unsubscribe) ->
[ [
{topic, hoconsc:mk(binary(), #{desc => <<"Topic">>})} {topic, hoconsc:mk(binary(), #{desc => <<"Topic">>, example => <<"testtopic/#">>})}
]. ].
%%%============================================================================================== %%%==============================================================================================

View File

@ -521,7 +521,11 @@ err_msg_str(Reason) ->
io_lib:format("~p", [Reason]). io_lib:format("~p", [Reason]).
list_listeners() -> list_listeners() ->
[list_listeners(Node) || Node <- emqx:running_nodes()]. %% prioritize displaying the bind of the current node
%% when each node's same type's bind is different.
%% e.g: tcp bind on node1 is 1883, but node2 is 1884.
Self = node(),
lists:map(fun list_listeners/1, [Self | lists:delete(Self, emqx:running_nodes())]).
list_listeners(Node) -> list_listeners(Node) ->
wrap_rpc(emqx_management_proto_v2:list_listeners(Node)). wrap_rpc(emqx_management_proto_v2:list_listeners(Node)).

View File

@ -74,13 +74,16 @@ schema("/subscriptions") ->
fields(subscription) -> fields(subscription) ->
[ [
{node, hoconsc:mk(binary(), #{desc => <<"Access type">>})}, {node, hoconsc:mk(binary(), #{desc => <<"Access type">>, example => <<"emqx@127.0.0.1">>})},
{topic, hoconsc:mk(binary(), #{desc => <<"Topic name">>})}, {topic, hoconsc:mk(binary(), #{desc => <<"Topic name">>, example => <<"testtopic/1">>})},
{clientid, hoconsc:mk(binary(), #{desc => <<"Client identifier">>})}, {clientid,
{qos, hoconsc:mk(emqx_schema:qos(), #{desc => <<"QoS">>})}, hoconsc:mk(binary(), #{
{nl, hoconsc:mk(integer(), #{desc => <<"No Local">>})}, desc => <<"Client identifier">>, example => <<"emqx_clientid_xx128cdhfc">>
{rap, hoconsc:mk(integer(), #{desc => <<"Retain as Published">>})}, })},
{rh, hoconsc:mk(integer(), #{desc => <<"Retain Handling">>})} {qos, hoconsc:mk(emqx_schema:qos(), #{desc => <<"QoS">>, example => 0})},
{nl, hoconsc:mk(integer(), #{desc => <<"No Local">>, example => 0})},
{rap, hoconsc:mk(integer(), #{desc => <<"Retain as Published">>, example => 0})},
{rh, hoconsc:mk(integer(), #{desc => <<"Retain Handling">>, example => 0})}
]. ].
parameters() -> parameters() ->