fix(emqx_data_bridge): resource type to bridge type
This commit is contained in:
parent
e9fe345ac8
commit
dddab31326
|
@ -2,6 +2,7 @@
|
|||
|
||||
-export([ load_bridges/0
|
||||
, resource_type/1
|
||||
, bridge_type/1
|
||||
, name_to_resource_id/1
|
||||
, resource_id_to_name/1
|
||||
, list_bridges/0
|
||||
|
@ -15,6 +16,8 @@ load_bridges() ->
|
|||
|
||||
resource_type(<<"mysql">>) -> emqx_connector_mysql.
|
||||
|
||||
bridge_type(emqx_connector_mysql) -> <<"mysql">>.
|
||||
|
||||
name_to_resource_id(BridgeName) ->
|
||||
<<"bridge:", BridgeName/binary>>.
|
||||
|
||||
|
|
|
@ -94,5 +94,6 @@ delete_bridge(#{name := Name}, _Params) ->
|
|||
end.
|
||||
|
||||
format_api_reply(#{resource_type := Type, id := Id, config := Conf, status := Status}) ->
|
||||
#{type => Type, name => emqx_data_bridge:resource_id_to_name(Id),
|
||||
#{type => emqx_data_bridge:bridge_type(Type),
|
||||
name => emqx_data_bridge:resource_id_to_name(Id),
|
||||
config => Conf, status => Status}.
|
||||
|
|
Loading…
Reference in New Issue