Merge pull request #8378 from lafirest/fix/hide_limiter_api

fix(api): temporarily hide the limiter's API
This commit is contained in:
lafirest 2022-07-01 17:14:33 +08:00 committed by GitHub
commit 62d822ee96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 40 additions and 39 deletions

View File

@ -61,7 +61,8 @@
<<"event_message">>,
<<"prometheus">>,
<<"telemetry">>,
<<"sys_topics">>
<<"sys_topics">>,
<<"limiter">>
] ++ global_zone_roots()
).
@ -74,8 +75,8 @@ paths() ->
[
"/configs",
"/configs_reset/:rootname",
"/configs/global_zone",
"/configs/limiter/:limiter_type"
"/configs/global_zone"
%% "/configs/limiter/:limiter_type"
] ++
lists:map(fun({Name, _Type}) -> ?PREFIX ++ binary_to_list(Name) end, config_list()).
@ -161,42 +162,42 @@ schema("/configs/global_zone") ->
}
}
};
schema("/configs/limiter/:limiter_type") ->
Schema = hoconsc:ref(emqx_limiter_schema, limiter_opts),
Parameters = [
{limiter_type,
hoconsc:mk(
hoconsc:enum(emqx_limiter_schema:types()),
#{
in => path,
required => true,
example => <<"bytes_in">>,
desc => <<"The limiter type">>
}
)}
],
#{
'operationId' => config,
get => #{
tags => [conf],
description => <<"Get config of this limiter">>,
parameters => Parameters,
responses => #{
200 => Schema,
404 => emqx_dashboard_swagger:error_codes(['NOT_FOUND'], <<"config not found">>)
}
},
put => #{
tags => [conf],
description => <<"Update config of this limiter">>,
parameters => Parameters,
'requestBody' => Schema,
responses => #{
200 => Schema,
400 => emqx_dashboard_swagger:error_codes(['UPDATE_FAILED'])
}
}
};
%% schema("/configs/limiter/:limiter_type") ->
%% Schema = hoconsc:ref(emqx_limiter_schema, limiter_opts),
%% Parameters = [
%% {limiter_type,
%% hoconsc:mk(
%% hoconsc:enum(emqx_limiter_schema:types()),
%% #{
%% in => path,
%% required => true,
%% example => <<"bytes_in">>,
%% desc => <<"The limiter type">>
%% }
%% )}
%% ],
%% #{
%% 'operationId' => config,
%% get => #{
%% tags => [conf],
%% description => <<"Get config of this limiter">>,
%% parameters => Parameters,
%% responses => #{
%% 200 => Schema,
%% 404 => emqx_dashboard_swagger:error_codes(['NOT_FOUND'], <<"config not found">>)
%% }
%% },
%% put => #{
%% tags => [conf],
%% description => <<"Update config of this limiter">>,
%% parameters => Parameters,
%% 'requestBody' => Schema,
%% responses => #{
%% 200 => Schema,
%% 400 => emqx_dashboard_swagger:error_codes(['UPDATE_FAILED'])
%% }
%% }
%% };
schema(Path) ->
{RootKey, {_Root, Schema}} = find_schema(Path),
#{