|
|
@@ -54,6 +54,7 @@
|
|
|
-export([do_subscribe/3]).
|
|
|
|
|
|
-define(CLIENT_QTAB, emqx_channel_info).
|
|
|
+-define(TAGS, [<<"Clients">>]).
|
|
|
|
|
|
-define(CLIENT_QSCHEMA, [
|
|
|
{<<"node">>, atom},
|
|
|
@@ -100,6 +101,7 @@ schema("/clients") ->
|
|
|
'operationId' => clients,
|
|
|
get => #{
|
|
|
description => <<"List clients">>,
|
|
|
+ tags => ?TAGS,
|
|
|
parameters => [
|
|
|
hoconsc:ref(emqx_dashboard_swagger, page),
|
|
|
hoconsc:ref(emqx_dashboard_swagger, limit),
|
|
|
@@ -220,6 +222,7 @@ schema("/clients/:clientid") ->
|
|
|
'operationId' => client,
|
|
|
get => #{
|
|
|
description => <<"Get clients info by client ID">>,
|
|
|
+ tags => ?TAGS,
|
|
|
parameters => [{clientid, hoconsc:mk(binary(), #{in => path})}],
|
|
|
responses => #{
|
|
|
200 => hoconsc:mk(hoconsc:ref(?MODULE, client), #{}),
|
|
|
@@ -230,6 +233,7 @@ schema("/clients/:clientid") ->
|
|
|
},
|
|
|
delete => #{
|
|
|
description => <<"Kick out client by client ID">>,
|
|
|
+ tags => ?TAGS,
|
|
|
parameters => [
|
|
|
{clientid, hoconsc:mk(binary(), #{in => path})}
|
|
|
],
|
|
|
@@ -246,6 +250,7 @@ schema("/clients/:clientid/authorization/cache") ->
|
|
|
'operationId' => authz_cache,
|
|
|
get => #{
|
|
|
description => <<"Get client authz cache in the cluster.">>,
|
|
|
+ tags => ?TAGS,
|
|
|
parameters => [{clientid, hoconsc:mk(binary(), #{in => path})}],
|
|
|
responses => #{
|
|
|
200 => hoconsc:mk(hoconsc:ref(?MODULE, authz_cache), #{}),
|
|
|
@@ -256,6 +261,7 @@ schema("/clients/:clientid/authorization/cache") ->
|
|
|
},
|
|
|
delete => #{
|
|
|
description => <<"Clean client authz cache in the cluster.">>,
|
|
|
+ tags => ?TAGS,
|
|
|
parameters => [{clientid, hoconsc:mk(binary(), #{in => path})}],
|
|
|
responses => #{
|
|
|
204 => <<"Kick out client successfully">>,
|
|
|
@@ -270,6 +276,7 @@ schema("/clients/:clientid/subscriptions") ->
|
|
|
'operationId' => subscriptions,
|
|
|
get => #{
|
|
|
description => <<"Get client subscriptions">>,
|
|
|
+ tags => ?TAGS,
|
|
|
parameters => [{clientid, hoconsc:mk(binary(), #{in => path})}],
|
|
|
responses => #{
|
|
|
200 => hoconsc:mk(
|
|
|
@@ -286,6 +293,7 @@ schema("/clients/:clientid/subscribe") ->
|
|
|
'operationId' => subscribe,
|
|
|
post => #{
|
|
|
description => <<"Subscribe">>,
|
|
|
+ tags => ?TAGS,
|
|
|
parameters => [{clientid, hoconsc:mk(binary(), #{in => path})}],
|
|
|
'requestBody' => hoconsc:mk(hoconsc:ref(?MODULE, subscribe)),
|
|
|
responses => #{
|
|
|
@@ -301,6 +309,7 @@ schema("/clients/:clientid/subscribe/bulk") ->
|
|
|
'operationId' => subscribe_batch,
|
|
|
post => #{
|
|
|
description => <<"Subscribe">>,
|
|
|
+ tags => ?TAGS,
|
|
|
parameters => [{clientid, hoconsc:mk(binary(), #{in => path})}],
|
|
|
'requestBody' => hoconsc:mk(hoconsc:array(hoconsc:ref(?MODULE, subscribe))),
|
|
|
responses => #{
|
|
|
@@ -316,6 +325,7 @@ schema("/clients/:clientid/unsubscribe") ->
|
|
|
'operationId' => unsubscribe,
|
|
|
post => #{
|
|
|
description => <<"Unsubscribe">>,
|
|
|
+ tags => ?TAGS,
|
|
|
parameters => [{clientid, hoconsc:mk(binary(), #{in => path})}],
|
|
|
'requestBody' => hoconsc:mk(hoconsc:ref(?MODULE, unsubscribe)),
|
|
|
responses => #{
|
|
|
@@ -331,6 +341,7 @@ schema("/clients/:clientid/unsubscribe/bulk") ->
|
|
|
'operationId' => unsubscribe_batch,
|
|
|
post => #{
|
|
|
description => <<"Unsubscribe">>,
|
|
|
+ tags => ?TAGS,
|
|
|
parameters => [{clientid, hoconsc:mk(binary(), #{in => path})}],
|
|
|
'requestBody' => hoconsc:mk(hoconsc:array(hoconsc:ref(?MODULE, unsubscribe))),
|
|
|
responses => #{
|
|
|
@@ -346,6 +357,7 @@ schema("/clients/:clientid/keepalive") ->
|
|
|
'operationId' => set_keepalive,
|
|
|
put => #{
|
|
|
description => <<"Set the online client keepalive by seconds">>,
|
|
|
+ tags => ?TAGS,
|
|
|
parameters => [{clientid, hoconsc:mk(binary(), #{in => path})}],
|
|
|
'requestBody' => hoconsc:mk(hoconsc:ref(?MODULE, keepalive)),
|
|
|
responses => #{
|