chore(swagger-schema): Delete the schema that is not reused
This commit is contained in:
parent
bf67fa1be1
commit
675d23111c
|
@ -50,8 +50,7 @@
|
|||
-define(EMPTY(V), (V == undefined orelse V == <<>>)).
|
||||
|
||||
api_spec() ->
|
||||
{
|
||||
[ login_api()
|
||||
{[ login_api()
|
||||
, logout_api()
|
||||
, users_api()
|
||||
, user_api()
|
||||
|
|
|
@ -26,14 +26,13 @@
|
|||
, dropped]).
|
||||
|
||||
api_spec() ->
|
||||
{
|
||||
[ monitor_api()
|
||||
{[ monitor_api()
|
||||
, monitor_nodes_api()
|
||||
, monitor_nodes_counters_api()
|
||||
, monitor_counters_api()
|
||||
, monitor_current_api()],
|
||||
[]
|
||||
}.
|
||||
, monitor_current_api()
|
||||
],
|
||||
[]}.
|
||||
|
||||
monitor_api() ->
|
||||
Metadata = #{
|
||||
|
|
|
@ -36,10 +36,7 @@
|
|||
]).
|
||||
|
||||
api_spec() ->
|
||||
{
|
||||
[routes_api(), route_api()],
|
||||
[]
|
||||
}.
|
||||
{[routes_api(), route_api()], []}.
|
||||
|
||||
properties() ->
|
||||
properties([
|
||||
|
|
|
@ -29,9 +29,7 @@ status_api() ->
|
|||
Metadata = #{
|
||||
get => #{
|
||||
security => [],
|
||||
responses => #{
|
||||
<<"200">> => #{description => <<"running">>}
|
||||
}
|
||||
responses => #{<<"200">> => #{description => <<"running">>}}
|
||||
}
|
||||
},
|
||||
{Path, Metadata, running_status}.
|
||||
|
|
|
@ -49,11 +49,11 @@
|
|||
api_spec() ->
|
||||
{
|
||||
[status_api(), delayed_messages_api(), delayed_message_api()],
|
||||
schemas()
|
||||
[]
|
||||
}.
|
||||
|
||||
schemas() ->
|
||||
[#{delayed => emqx_mgmt_api_configs:gen_schema(emqx:get_raw_config([delayed]))}].
|
||||
conf_schema() ->
|
||||
emqx_mgmt_api_configs:gen_schema(emqx:get_raw_config([delayed])).
|
||||
properties() ->
|
||||
PayloadDesc = io_lib:format("Payload, base64 encode. Payload will be ~p if length large than ~p",
|
||||
[?PAYLOAD_TOO_LARGE, ?MAX_PAYLOAD_LENGTH]),
|
||||
|
@ -80,14 +80,14 @@ status_api() ->
|
|||
get => #{
|
||||
description => <<"Get delayed status">>,
|
||||
responses => #{
|
||||
<<"200">> => schema(delayed)}
|
||||
<<"200">> => schema(conf_schema())}
|
||||
},
|
||||
put => #{
|
||||
description => <<"Enable or disable delayed, set max delayed messages">>,
|
||||
'requestBody' => schema(delayed),
|
||||
'requestBody' => schema(conf_schema()),
|
||||
responses => #{
|
||||
<<"200">> =>
|
||||
schema(delayed, <<"Enable or disable delayed successfully">>),
|
||||
schema(conf_schema(), <<"Enable or disable delayed successfully">>),
|
||||
<<"400">> =>
|
||||
error_schema(<<"Already disabled or enabled">>, [?ALREADY_ENABLED, ?ALREADY_DISABLED])
|
||||
}
|
||||
|
|
|
@ -25,11 +25,10 @@
|
|||
]).
|
||||
|
||||
api_spec() ->
|
||||
{[event_message_api()], [event_message_schema()]}.
|
||||
{[event_message_api()], []}.
|
||||
|
||||
event_message_schema() ->
|
||||
Conf = emqx:get_raw_config([event_message]),
|
||||
#{event_message => emqx_mgmt_api_configs:gen_schema(Conf)}.
|
||||
conf_schema() ->
|
||||
emqx_mgmt_api_configs:gen_schema(emqx:get_config([event_message])).
|
||||
|
||||
event_message_api() ->
|
||||
Path = "/mqtt/event_message",
|
||||
|
@ -37,14 +36,14 @@ event_message_api() ->
|
|||
get => #{
|
||||
description => <<"Event Message">>,
|
||||
responses => #{
|
||||
<<"200">> => schema(event_message)
|
||||
<<"200">> => schema(conf_schema())
|
||||
}
|
||||
},
|
||||
post => #{
|
||||
description => <<"Update Event Message">>,
|
||||
'requestBody' => schema(event_message),
|
||||
'requestBody' => schema(conf_schema()),
|
||||
responses => #{
|
||||
<<"200">> => schema(event_message)
|
||||
<<"200">> => schema(conf_schema())
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -29,21 +29,21 @@
|
|||
]).
|
||||
|
||||
api_spec() ->
|
||||
{[prometheus_api(), prometheus_data_api()], schemas()}.
|
||||
{[prometheus_api(), prometheus_data_api()], []}.
|
||||
|
||||
schemas() ->
|
||||
[#{prometheus => emqx_mgmt_api_configs:gen_schema(emqx:get_raw_config([prometheus]))}].
|
||||
conf_schema() ->
|
||||
emqx_mgmt_api_configs:gen_schema(emqx:get_raw_config([prometheus])).
|
||||
|
||||
prometheus_api() ->
|
||||
Metadata = #{
|
||||
get => #{
|
||||
description => <<"Get Prometheus info">>,
|
||||
responses => #{<<"200">> => schema(prometheus)}
|
||||
responses => #{<<"200">> => schema(conf_schema())}
|
||||
},
|
||||
put => #{
|
||||
description => <<"Update Prometheus">>,
|
||||
'requestBody' => schema(prometheus),
|
||||
responses => #{<<"200">> => schema(prometheus)}
|
||||
'requestBody' => schema(conf_schema()),
|
||||
responses => #{<<"200">> => schema(conf_schema())}
|
||||
}
|
||||
},
|
||||
{"/prometheus", Metadata, prometheus}.
|
||||
|
|
|
@ -35,17 +35,10 @@
|
|||
, properties/1]).
|
||||
|
||||
api_spec() ->
|
||||
{
|
||||
[ lookup_retained_api()
|
||||
, with_topic_api()
|
||||
, config_api()
|
||||
],
|
||||
schemas()
|
||||
}.
|
||||
{[lookup_retained_api(), with_topic_api(), config_api()], []}.
|
||||
|
||||
schemas() ->
|
||||
MqttRetainer = gen_schema(emqx:get_raw_config([emqx_retainer])),
|
||||
[#{emqx_retainer => MqttRetainer}].
|
||||
conf_schema() ->
|
||||
gen_schema(emqx:get_raw_config([emqx_retainer])).
|
||||
|
||||
message_props() ->
|
||||
properties([
|
||||
|
@ -107,15 +100,15 @@ config_api() ->
|
|||
get => #{
|
||||
description => <<"get retainer config">>,
|
||||
responses => #{
|
||||
<<"200">> => schema(mqtt_retainer, <<"Get configs successfully">>),
|
||||
<<"200">> => schema(conf_schema(), <<"Get configs successfully">>),
|
||||
<<"404">> => error_schema(<<"Config not found">>, ['NOT_FOUND'])
|
||||
}
|
||||
},
|
||||
put => #{
|
||||
description => <<"Update retainer config">>,
|
||||
'requestBody' => schema(mqtt_retainer),
|
||||
'requestBody' => schema(conf_schema()),
|
||||
responses => #{
|
||||
<<"200">> => schema(mqtt_retainer, <<"Update configs successfully">>),
|
||||
<<"200">> => schema(conf_schema(), <<"Update configs successfully">>),
|
||||
<<"400">> => error_schema(<<"Update configs failed">>, ['UPDATE_FAILED'])
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,22 +29,22 @@
|
|||
]).
|
||||
|
||||
api_spec() ->
|
||||
{statsd_api(), schemas()}.
|
||||
{statsd_api(), []}.
|
||||
|
||||
schemas() ->
|
||||
[#{statsd => emqx_mgmt_api_configs:gen_schema(emqx:get_raw_config([statsd]))}].
|
||||
conf_schema() ->
|
||||
emqx_mgmt_api_configs:gen_schema(emqx:get_raw_config([statsd])).
|
||||
|
||||
statsd_api() ->
|
||||
Metadata = #{
|
||||
get => #{
|
||||
description => <<"Get statsd info">>,
|
||||
responses => #{<<"200">> => schema(statsd)}
|
||||
responses => #{<<"200">> => schema(conf_schema())}
|
||||
},
|
||||
put => #{
|
||||
description => <<"Update Statsd">>,
|
||||
'requestBody' => schema(statsd),
|
||||
'requestBody' => schema(conf_schema()),
|
||||
responses => #{
|
||||
<<"200">> => schema(statsd),
|
||||
<<"200">> => schema(conf_schema()),
|
||||
<<"400">> => bad_request()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue