docs(emqx_rule_api apply rule): fix doc strings
This commit is contained in:
parent
600526a0e4
commit
9628a00a82
|
@ -117,7 +117,7 @@ fields("rule_apply_test") ->
|
||||||
default => #{}
|
default => #{}
|
||||||
}
|
}
|
||||||
)},
|
)},
|
||||||
{"stop_action_after_template_render",
|
{"stop_action_after_template_rendering",
|
||||||
sc(
|
sc(
|
||||||
typerefl:boolean(),
|
typerefl:boolean(),
|
||||||
#{
|
#{
|
||||||
|
|
|
@ -268,8 +268,8 @@ schema("/rules/:id/test") ->
|
||||||
'operationId' => '/rules/:id/test',
|
'operationId' => '/rules/:id/test',
|
||||||
post => #{
|
post => #{
|
||||||
tags => [<<"rules">>],
|
tags => [<<"rules">>],
|
||||||
description => ?DESC("api8"),
|
description => ?DESC("api11"),
|
||||||
summary => <<"Apply a rule with the given message and environment">>,
|
summary => <<"Apply a rule for testing">>,
|
||||||
'requestBody' => rule_apply_test_schema(),
|
'requestBody' => rule_apply_test_schema(),
|
||||||
responses => #{
|
responses => #{
|
||||||
400 => error_schema('BAD_REQUEST', "Invalid Parameters"),
|
400 => error_schema('BAD_REQUEST', "Invalid Parameters"),
|
||||||
|
|
|
@ -29,7 +29,7 @@ apply_rule(
|
||||||
#{
|
#{
|
||||||
context := Context,
|
context := Context,
|
||||||
environment := Env,
|
environment := Env,
|
||||||
stop_action_after_template_render := StopAfterRender
|
stop_action_after_template_rendering := StopAfterRender
|
||||||
}
|
}
|
||||||
) ->
|
) ->
|
||||||
{ok, Rule} = emqx_rule_engine:get_rule(RuleId),
|
{ok, Rule} = emqx_rule_engine:get_rule(RuleId),
|
||||||
|
|
|
@ -30,9 +30,6 @@ all() ->
|
||||||
|
|
||||||
init_per_suite(Config) ->
|
init_per_suite(Config) ->
|
||||||
application:load(emqx_conf),
|
application:load(emqx_conf),
|
||||||
% ok = emqx_common_test_helpers:load_config(emqx_rule_engine_schema, ?CONF_DEFAULT),
|
|
||||||
% ok = emqx_common_test_helpers:start_apps([emqx_conf, emqx, emqx_rule_engine, emqx_bridge, emqx_bridge_http]),
|
|
||||||
|
|
||||||
Apps = emqx_cth_suite:start(
|
Apps = emqx_cth_suite:start(
|
||||||
[
|
[
|
||||||
emqx,
|
emqx,
|
||||||
|
@ -125,7 +122,7 @@ basic_apply_rule_test_helper(Config, TraceType, StopAfterRender) ->
|
||||||
Params = #{
|
Params = #{
|
||||||
% body => #{
|
% body => #{
|
||||||
<<"context">> => Context,
|
<<"context">> => Context,
|
||||||
<<"stop_action_after_template_render">> => StopAfterRender
|
<<"stop_action_after_template_rendering">> => StopAfterRender
|
||||||
% }
|
% }
|
||||||
},
|
},
|
||||||
emqx_trace:check(),
|
emqx_trace:check(),
|
||||||
|
|
|
@ -66,6 +66,18 @@ test_context.desc:
|
||||||
test_context.label:
|
test_context.label:
|
||||||
"""Event Conetxt"""
|
"""Event Conetxt"""
|
||||||
|
|
||||||
|
test_rule_environment.desc:
|
||||||
|
"""The environment that will be passed to the rule when it is applied. A default environment will be used if no environment is given."""
|
||||||
|
|
||||||
|
test_rule_environment.label:
|
||||||
|
"""Event Environment"""
|
||||||
|
|
||||||
|
stop_action_after_template_render.desc:
|
||||||
|
"""Set this to true if the action should be stopped after its template has been rendered."""
|
||||||
|
|
||||||
|
stop_action_after_template_render.label:
|
||||||
|
"""Stop Action After Template Rendering"""
|
||||||
|
|
||||||
node_node.desc:
|
node_node.desc:
|
||||||
"""The node name"""
|
"""The node name"""
|
||||||
|
|
||||||
|
|
|
@ -90,4 +90,10 @@ api9.desc:
|
||||||
api9.label:
|
api9.label:
|
||||||
"""Get configuration"""
|
"""Get configuration"""
|
||||||
|
|
||||||
|
api11.desc:
|
||||||
|
"""Apply a rule with the given message and environment"""
|
||||||
|
|
||||||
|
api11.label:
|
||||||
|
"""Apply Rule"""
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue