fix(emqx_bridge): small fixes from review
This commit is contained in:
parent
7a17fb7308
commit
c3133fb6a2
|
@ -2,8 +2,8 @@ emqx_bridge_api {
|
|||
|
||||
desc_param_path_operation_cluster {
|
||||
desc {
|
||||
en: """Operations can be one of: start, stop, restart"""
|
||||
zh: """集群可用操作:启用、启动、重新启动"""
|
||||
en: """Operations can be one of: stop, restart"""
|
||||
zh: """集群可用操作:停止、重新启动"""
|
||||
}
|
||||
label: {
|
||||
en: "Cluster Operation"
|
||||
|
|
|
@ -107,7 +107,7 @@ param_path_operation_on_node() ->
|
|||
#{
|
||||
in => path,
|
||||
required => true,
|
||||
example => <<"start">>,
|
||||
example => <<"stop">>,
|
||||
desc => ?DESC("desc_param_path_operation_on_node")
|
||||
}
|
||||
)}.
|
||||
|
@ -142,6 +142,7 @@ param_path_enable() ->
|
|||
boolean(),
|
||||
#{
|
||||
in => path,
|
||||
required => true,
|
||||
desc => ?DESC("desc_param_path_enable"),
|
||||
example => true
|
||||
}
|
||||
|
|
|
@ -616,7 +616,6 @@ t_metrics(Config) ->
|
|||
|
||||
%% check for empty bridge metrics
|
||||
{ok, 200, Bridge1Str} = request(get, uri(["bridges", BridgeID, "metrics"]), []),
|
||||
ct:pal("HERE ~p", [jsx:decode(Bridge1Str)]),
|
||||
?assertMatch(
|
||||
#{
|
||||
<<"metrics">> := #{<<"success">> := 0},
|
||||
|
@ -625,6 +624,12 @@ t_metrics(Config) ->
|
|||
jsx:decode(Bridge1Str)
|
||||
),
|
||||
|
||||
%% check that the bridge doesn't contain metrics anymore
|
||||
{ok, 200, Bridge2Str} = request(get, uri(["bridges", BridgeID]), []),
|
||||
Decoded = jsx:decode(Bridge2Str),
|
||||
?assertNot(maps:is_key(<<"metrics">>, Decoded)),
|
||||
?assertNot(maps:is_key(<<"node_metrics">>, Decoded)),
|
||||
|
||||
%% send an message to emqx and the message should be forwarded to the HTTP server
|
||||
Body = <<"my msg">>,
|
||||
emqx:publish(emqx_message:make(<<"emqx_webhook/1">>, Body)),
|
||||
|
@ -645,19 +650,17 @@ t_metrics(Config) ->
|
|||
),
|
||||
|
||||
%% check for non-empty bridge metrics
|
||||
{ok, 200, Bridge2Str} = request(get, uri(["bridges", BridgeID, "metrics"]), []),
|
||||
ct:pal("HERE ~p", [jsx:decode(Bridge2Str)]),
|
||||
{ok, 200, Bridge3Str} = request(get, uri(["bridges", BridgeID, "metrics"]), []),
|
||||
?assertMatch(
|
||||
#{
|
||||
<<"metrics">> := #{<<"success">> := 1},
|
||||
<<"node_metrics">> := [_ | _]
|
||||
},
|
||||
jsx:decode(Bridge2Str)
|
||||
jsx:decode(Bridge3Str)
|
||||
),
|
||||
|
||||
%% check for non-empty metrics when listing all bridges
|
||||
{ok, 200, BridgesStr} = request(get, uri(["bridges"]), []),
|
||||
ct:pal("HERE ~p", [jsx:decode(BridgesStr)]),
|
||||
?assertMatch(
|
||||
[
|
||||
#{
|
||||
|
|
Loading…
Reference in New Issue