fix(syskeeper): refactor action to new action info scheme
This commit is contained in:
parent
d2cf29fae4
commit
5275a01727
|
@ -45,7 +45,8 @@
|
|||
hard_coded_action_info_modules_ee() ->
|
||||
[
|
||||
emqx_bridge_kafka_action_info,
|
||||
emqx_bridge_azure_event_hub_action_info
|
||||
emqx_bridge_azure_event_hub_action_info,
|
||||
emqx_bridge_syskeeper_action_info
|
||||
].
|
||||
-else.
|
||||
hard_coded_action_info_modules_ee() ->
|
||||
|
|
|
@ -75,6 +75,15 @@ namespace() -> "syskeeper".
|
|||
|
||||
roots() -> [].
|
||||
|
||||
fields(action) ->
|
||||
{syskeeper_forwarder,
|
||||
mk(
|
||||
hoconsc:map(name, ref(?MODULE, config)),
|
||||
#{
|
||||
desc => <<"Syskeeper Forwarder Action Config">>,
|
||||
required => false
|
||||
}
|
||||
)};
|
||||
fields(config) ->
|
||||
[
|
||||
{enable, mk(boolean(), #{desc => ?DESC("config_enable"), default => true})},
|
||||
|
@ -121,10 +130,16 @@ fields("creation_opts") ->
|
|||
emqx_resource_schema:create_opts([{request_ttl, #{default => infinity}}]);
|
||||
fields("post") ->
|
||||
[type_field(), name_field() | fields(config)];
|
||||
fields("post_bridge_v2") ->
|
||||
fields("post");
|
||||
fields("put") ->
|
||||
fields(config);
|
||||
fields("put_bridge_v2") ->
|
||||
fields("put");
|
||||
fields("get") ->
|
||||
emqx_bridge_schema:status_fields() ++ fields("post").
|
||||
emqx_bridge_schema:status_fields() ++ fields("post");
|
||||
fields("get_bridge_v2") ->
|
||||
fields("get").
|
||||
|
||||
desc(config) ->
|
||||
?DESC("desc_config");
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
%%--------------------------------------------------------------------
|
||||
%% Copyright (c) 2023 EMQ Technologies Co., Ltd. All Rights Reserved.
|
||||
%%--------------------------------------------------------------------
|
||||
|
||||
-module(emqx_bridge_syskeeper_action_info).
|
||||
|
||||
-behaviour(emqx_action_info).
|
||||
|
||||
-export([
|
||||
bridge_v1_type_name/0,
|
||||
action_type_name/0,
|
||||
connector_type_name/0,
|
||||
schema_module/0
|
||||
]).
|
||||
|
||||
bridge_v1_type_name() -> syskeeper_forwarder.
|
||||
|
||||
action_type_name() -> syskeeper_forwarder.
|
||||
|
||||
connector_type_name() -> syskeeper_forwarder.
|
||||
|
||||
schema_module() -> emqx_bridge_syskeeper.
|
|
@ -65,21 +65,23 @@ end_per_group(_Group, _Config) ->
|
|||
ok.
|
||||
|
||||
init_per_suite(Config) ->
|
||||
ok = emqx_common_test_helpers:start_apps([
|
||||
Apps = emqx_cth_suite:start(
|
||||
[
|
||||
emqx_conf,
|
||||
emqx_connector,
|
||||
emqx_bridge,
|
||||
emqx_bridge_syskeeper
|
||||
]),
|
||||
_ = emqx_bridge_enterprise:module_info(),
|
||||
],
|
||||
#{work_dir => emqx_cth_suite:work_dir(Config)}
|
||||
),
|
||||
emqx_mgmt_api_test_util:init_suite(),
|
||||
Config.
|
||||
[{apps, Apps} | Config].
|
||||
|
||||
end_per_suite(_Config) ->
|
||||
end_per_suite(Config) ->
|
||||
Apps = ?config(apps, Config),
|
||||
emqx_mgmt_api_test_util:end_suite(),
|
||||
ok = emqx_common_test_helpers:stop_apps([
|
||||
emqx_bridge_syskeeper, emqx_bridge, emqx_connector, emqx_conf
|
||||
]).
|
||||
ok = emqx_cth_suite:stop(Apps),
|
||||
ok.
|
||||
|
||||
init_per_testcase(_Testcase, Config) ->
|
||||
snabbkaffe:start_trace(),
|
||||
|
|
Loading…
Reference in New Issue