|
@@ -64,7 +64,7 @@ get_raw(KeyPath) ->
|
|
|
%% @doc Returns all values in the cluster.
|
|
%% @doc Returns all values in the cluster.
|
|
|
-spec get_all(emqx_utils_maps:config_key_path()) -> #{node() => term()}.
|
|
-spec get_all(emqx_utils_maps:config_key_path()) -> #{node() => term()}.
|
|
|
get_all(KeyPath) ->
|
|
get_all(KeyPath) ->
|
|
|
- {ResL, []} = emqx_conf_proto_v3:get_all(KeyPath),
|
|
|
|
|
|
|
+ {ResL, []} = emqx_conf_proto_v4:get_all(KeyPath),
|
|
|
maps:from_list(ResL).
|
|
maps:from_list(ResL).
|
|
|
|
|
|
|
|
%% @doc Returns the specified node's KeyPath, or exception if not found
|
|
%% @doc Returns the specified node's KeyPath, or exception if not found
|
|
@@ -72,14 +72,14 @@ get_all(KeyPath) ->
|
|
|
get_by_node(Node, KeyPath) when Node =:= node() ->
|
|
get_by_node(Node, KeyPath) when Node =:= node() ->
|
|
|
emqx:get_config(KeyPath);
|
|
emqx:get_config(KeyPath);
|
|
|
get_by_node(Node, KeyPath) ->
|
|
get_by_node(Node, KeyPath) ->
|
|
|
- emqx_conf_proto_v3:get_config(Node, KeyPath).
|
|
|
|
|
|
|
+ emqx_conf_proto_v4:get_config(Node, KeyPath).
|
|
|
|
|
|
|
|
%% @doc Returns the specified node's KeyPath, or the default value if not found
|
|
%% @doc Returns the specified node's KeyPath, or the default value if not found
|
|
|
-spec get_by_node(node(), emqx_utils_maps:config_key_path(), term()) -> term().
|
|
-spec get_by_node(node(), emqx_utils_maps:config_key_path(), term()) -> term().
|
|
|
get_by_node(Node, KeyPath, Default) when Node =:= node() ->
|
|
get_by_node(Node, KeyPath, Default) when Node =:= node() ->
|
|
|
emqx:get_config(KeyPath, Default);
|
|
emqx:get_config(KeyPath, Default);
|
|
|
get_by_node(Node, KeyPath, Default) ->
|
|
get_by_node(Node, KeyPath, Default) ->
|
|
|
- emqx_conf_proto_v3:get_config(Node, KeyPath, Default).
|
|
|
|
|
|
|
+ emqx_conf_proto_v4:get_config(Node, KeyPath, Default).
|
|
|
|
|
|
|
|
%% @doc Returns the specified node's KeyPath, or config_not_found if key path not found
|
|
%% @doc Returns the specified node's KeyPath, or config_not_found if key path not found
|
|
|
-spec get_node_and_config(emqx_utils_maps:config_key_path()) -> term().
|
|
-spec get_node_and_config(emqx_utils_maps:config_key_path()) -> term().
|
|
@@ -94,7 +94,7 @@ get_node_and_config(KeyPath) ->
|
|
|
) ->
|
|
) ->
|
|
|
{ok, emqx_config:update_result()} | {error, emqx_config:update_error()}.
|
|
{ok, emqx_config:update_result()} | {error, emqx_config:update_error()}.
|
|
|
update(KeyPath, UpdateReq, Opts) ->
|
|
update(KeyPath, UpdateReq, Opts) ->
|
|
|
- emqx_conf_proto_v3:update(KeyPath, UpdateReq, Opts).
|
|
|
|
|
|
|
+ emqx_conf_proto_v4:update(KeyPath, UpdateReq, Opts).
|
|
|
|
|
|
|
|
%% @doc Update the specified node's key path in local-override.conf.
|
|
%% @doc Update the specified node's key path in local-override.conf.
|
|
|
-spec update(
|
|
-spec update(
|
|
@@ -107,7 +107,7 @@ update(KeyPath, UpdateReq, Opts) ->
|
|
|
update(Node, KeyPath, UpdateReq, Opts0) when Node =:= node() ->
|
|
update(Node, KeyPath, UpdateReq, Opts0) when Node =:= node() ->
|
|
|
emqx:update_config(KeyPath, UpdateReq, Opts0#{override_to => local});
|
|
emqx:update_config(KeyPath, UpdateReq, Opts0#{override_to => local});
|
|
|
update(Node, KeyPath, UpdateReq, Opts) ->
|
|
update(Node, KeyPath, UpdateReq, Opts) ->
|
|
|
- emqx_conf_proto_v3:update(Node, KeyPath, UpdateReq, Opts).
|
|
|
|
|
|
|
+ emqx_conf_proto_v4:update(Node, KeyPath, UpdateReq, Opts).
|
|
|
|
|
|
|
|
%% @doc Mark the specified key path as tombstone
|
|
%% @doc Mark the specified key path as tombstone
|
|
|
tombstone(KeyPath, Opts) ->
|
|
tombstone(KeyPath, Opts) ->
|
|
@@ -117,7 +117,7 @@ tombstone(KeyPath, Opts) ->
|
|
|
-spec remove(emqx_utils_maps:config_key_path(), emqx_config:update_opts()) ->
|
|
-spec remove(emqx_utils_maps:config_key_path(), emqx_config:update_opts()) ->
|
|
|
{ok, emqx_config:update_result()} | {error, emqx_config:update_error()}.
|
|
{ok, emqx_config:update_result()} | {error, emqx_config:update_error()}.
|
|
|
remove(KeyPath, Opts) ->
|
|
remove(KeyPath, Opts) ->
|
|
|
- emqx_conf_proto_v3:remove_config(KeyPath, Opts).
|
|
|
|
|
|
|
+ emqx_conf_proto_v4:remove_config(KeyPath, Opts).
|
|
|
|
|
|
|
|
%% @doc remove the specified node's key path in local-override.conf.
|
|
%% @doc remove the specified node's key path in local-override.conf.
|
|
|
-spec remove(node(), emqx_utils_maps:config_key_path(), emqx_config:update_opts()) ->
|
|
-spec remove(node(), emqx_utils_maps:config_key_path(), emqx_config:update_opts()) ->
|
|
@@ -125,13 +125,13 @@ remove(KeyPath, Opts) ->
|
|
|
remove(Node, KeyPath, Opts) when Node =:= node() ->
|
|
remove(Node, KeyPath, Opts) when Node =:= node() ->
|
|
|
emqx:remove_config(KeyPath, Opts#{override_to => local});
|
|
emqx:remove_config(KeyPath, Opts#{override_to => local});
|
|
|
remove(Node, KeyPath, Opts) ->
|
|
remove(Node, KeyPath, Opts) ->
|
|
|
- emqx_conf_proto_v3:remove_config(Node, KeyPath, Opts).
|
|
|
|
|
|
|
+ emqx_conf_proto_v4:remove_config(Node, KeyPath, Opts).
|
|
|
|
|
|
|
|
%% @doc reset all value of key path in cluster-override.conf or local-override.conf.
|
|
%% @doc reset all value of key path in cluster-override.conf or local-override.conf.
|
|
|
-spec reset(emqx_utils_maps:config_key_path(), emqx_config:update_opts()) ->
|
|
-spec reset(emqx_utils_maps:config_key_path(), emqx_config:update_opts()) ->
|
|
|
{ok, emqx_config:update_result()} | {error, emqx_config:update_error()}.
|
|
{ok, emqx_config:update_result()} | {error, emqx_config:update_error()}.
|
|
|
reset(KeyPath, Opts) ->
|
|
reset(KeyPath, Opts) ->
|
|
|
- emqx_conf_proto_v3:reset(KeyPath, Opts).
|
|
|
|
|
|
|
+ emqx_conf_proto_v4:reset(KeyPath, Opts).
|
|
|
|
|
|
|
|
%% @doc reset the specified node's key path in local-override.conf.
|
|
%% @doc reset the specified node's key path in local-override.conf.
|
|
|
-spec reset(node(), emqx_utils_maps:config_key_path(), emqx_config:update_opts()) ->
|
|
-spec reset(node(), emqx_utils_maps:config_key_path(), emqx_config:update_opts()) ->
|
|
@@ -139,7 +139,7 @@ reset(KeyPath, Opts) ->
|
|
|
reset(Node, KeyPath, Opts) when Node =:= node() ->
|
|
reset(Node, KeyPath, Opts) when Node =:= node() ->
|
|
|
emqx:reset_config(KeyPath, Opts#{override_to => local});
|
|
emqx:reset_config(KeyPath, Opts#{override_to => local});
|
|
|
reset(Node, KeyPath, Opts) ->
|
|
reset(Node, KeyPath, Opts) ->
|
|
|
- emqx_conf_proto_v3:reset(Node, KeyPath, Opts).
|
|
|
|
|
|
|
+ emqx_conf_proto_v4:reset(Node, KeyPath, Opts).
|
|
|
|
|
|
|
|
%% @doc Called from build script.
|
|
%% @doc Called from build script.
|
|
|
%% TODO: move to a external escript after all refactoring is done
|
|
%% TODO: move to a external escript after all refactoring is done
|