fix: the field 'enable' is missing for GET /bridges/:id
This commit is contained in:
parent
e18c2a6de2
commit
6edb453ce9
|
@ -648,11 +648,11 @@ fill_defaults(Type, RawConf) ->
|
||||||
unpack_bridge_conf(Type, FullConf).
|
unpack_bridge_conf(Type, FullConf).
|
||||||
|
|
||||||
pack_bridge_conf(Type, RawConf) ->
|
pack_bridge_conf(Type, RawConf) ->
|
||||||
#{<<"bridges">> => #{Type => #{<<"foo">> => RawConf}}}.
|
#{<<"bridges">> => #{bin(Type) => #{<<"foo">> => RawConf}}}.
|
||||||
|
|
||||||
unpack_bridge_conf(Type, PackedConf) ->
|
unpack_bridge_conf(Type, PackedConf) ->
|
||||||
#{<<"bridges">> := Bridges} = PackedConf,
|
#{<<"bridges">> := Bridges} = PackedConf,
|
||||||
#{<<"foo">> := RawConf} = maps:get(Type, Bridges),
|
#{<<"foo">> := RawConf} = maps:get(bin(Type), Bridges),
|
||||||
RawConf.
|
RawConf.
|
||||||
|
|
||||||
is_ok(ResL) ->
|
is_ok(ResL) ->
|
||||||
|
@ -689,4 +689,8 @@ error_msg(Code, Msg) ->
|
||||||
#{code => Code, message => bin(io_lib:format("~p", [Msg]))}.
|
#{code => Code, message => bin(io_lib:format("~p", [Msg]))}.
|
||||||
|
|
||||||
bin(S) when is_list(S) ->
|
bin(S) when is_list(S) ->
|
||||||
list_to_binary(S).
|
list_to_binary(S);
|
||||||
|
bin(S) when is_atom(S) ->
|
||||||
|
atom_to_binary(S, utf8);
|
||||||
|
bin(S) when is_binary(S) ->
|
||||||
|
S.
|
||||||
|
|
|
@ -171,6 +171,7 @@ t_http_crud_apis(_) ->
|
||||||
#{
|
#{
|
||||||
<<"type">> := ?BRIDGE_TYPE,
|
<<"type">> := ?BRIDGE_TYPE,
|
||||||
<<"name">> := ?BRIDGE_NAME,
|
<<"name">> := ?BRIDGE_NAME,
|
||||||
|
<<"enable">> := true,
|
||||||
<<"status">> := _,
|
<<"status">> := _,
|
||||||
<<"node_status">> := [_ | _],
|
<<"node_status">> := [_ | _],
|
||||||
<<"metrics">> := _,
|
<<"metrics">> := _,
|
||||||
|
@ -208,6 +209,7 @@ t_http_crud_apis(_) ->
|
||||||
#{
|
#{
|
||||||
<<"type">> := ?BRIDGE_TYPE,
|
<<"type">> := ?BRIDGE_TYPE,
|
||||||
<<"name">> := ?BRIDGE_NAME,
|
<<"name">> := ?BRIDGE_NAME,
|
||||||
|
<<"enable">> := true,
|
||||||
<<"status">> := _,
|
<<"status">> := _,
|
||||||
<<"node_status">> := [_ | _],
|
<<"node_status">> := [_ | _],
|
||||||
<<"metrics">> := _,
|
<<"metrics">> := _,
|
||||||
|
@ -224,6 +226,7 @@ t_http_crud_apis(_) ->
|
||||||
#{
|
#{
|
||||||
<<"type">> := ?BRIDGE_TYPE,
|
<<"type">> := ?BRIDGE_TYPE,
|
||||||
<<"name">> := ?BRIDGE_NAME,
|
<<"name">> := ?BRIDGE_NAME,
|
||||||
|
<<"enable">> := true,
|
||||||
<<"status">> := _,
|
<<"status">> := _,
|
||||||
<<"node_status">> := [_ | _],
|
<<"node_status">> := [_ | _],
|
||||||
<<"metrics">> := _,
|
<<"metrics">> := _,
|
||||||
|
@ -240,6 +243,7 @@ t_http_crud_apis(_) ->
|
||||||
#{
|
#{
|
||||||
<<"type">> := ?BRIDGE_TYPE,
|
<<"type">> := ?BRIDGE_TYPE,
|
||||||
<<"name">> := ?BRIDGE_NAME,
|
<<"name">> := ?BRIDGE_NAME,
|
||||||
|
<<"enable">> := true,
|
||||||
<<"status">> := _,
|
<<"status">> := _,
|
||||||
<<"node_status">> := [_ | _],
|
<<"node_status">> := [_ | _],
|
||||||
<<"metrics">> := _,
|
<<"metrics">> := _,
|
||||||
|
@ -305,6 +309,7 @@ do_start_stop_bridges(Type) ->
|
||||||
#{
|
#{
|
||||||
<<"type">> := ?BRIDGE_TYPE,
|
<<"type">> := ?BRIDGE_TYPE,
|
||||||
<<"name">> := ?BRIDGE_NAME,
|
<<"name">> := ?BRIDGE_NAME,
|
||||||
|
<<"enable">> := true,
|
||||||
<<"status">> := <<"connected">>,
|
<<"status">> := <<"connected">>,
|
||||||
<<"node_status">> := [_ | _],
|
<<"node_status">> := [_ | _],
|
||||||
<<"metrics">> := _,
|
<<"metrics">> := _,
|
||||||
|
@ -349,6 +354,7 @@ t_enable_disable_bridges(_) ->
|
||||||
#{
|
#{
|
||||||
<<"type">> := ?BRIDGE_TYPE,
|
<<"type">> := ?BRIDGE_TYPE,
|
||||||
<<"name">> := ?BRIDGE_NAME,
|
<<"name">> := ?BRIDGE_NAME,
|
||||||
|
<<"enable">> := true,
|
||||||
<<"status">> := <<"connected">>,
|
<<"status">> := <<"connected">>,
|
||||||
<<"node_status">> := [_ | _],
|
<<"node_status">> := [_ | _],
|
||||||
<<"metrics">> := _,
|
<<"metrics">> := _,
|
||||||
|
@ -397,6 +403,7 @@ t_reset_bridges(_) ->
|
||||||
#{
|
#{
|
||||||
<<"type">> := ?BRIDGE_TYPE,
|
<<"type">> := ?BRIDGE_TYPE,
|
||||||
<<"name">> := ?BRIDGE_NAME,
|
<<"name">> := ?BRIDGE_NAME,
|
||||||
|
<<"enable">> := true,
|
||||||
<<"status">> := <<"connected">>,
|
<<"status">> := <<"connected">>,
|
||||||
<<"node_status">> := [_ | _],
|
<<"node_status">> := [_ | _],
|
||||||
<<"metrics">> := _,
|
<<"metrics">> := _,
|
||||||
|
|
Loading…
Reference in New Issue