summaryrefslogtreecommitdiff
path: root/src/chttpd/src/chttpd_node.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/chttpd/src/chttpd_node.erl')
-rw-r--r--src/chttpd/src/chttpd_node.erl10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/chttpd/src/chttpd_node.erl b/src/chttpd/src/chttpd_node.erl
index 202070279..acd5affbd 100644
--- a/src/chttpd/src/chttpd_node.erl
+++ b/src/chttpd/src/chttpd_node.erl
@@ -46,6 +46,16 @@ handle_node_req(#httpd{method='GET', path_parts=[_, Node, <<"_config">>]}=Req) -
send_json(Req, 200, {KVs});
handle_node_req(#httpd{path_parts=[_, _Node, <<"_config">>]}=Req) ->
send_method_not_allowed(Req, "GET");
+% POST /_node/$node/_config/_reload - Flushes unpersisted config values from RAM
+handle_node_req(#httpd{method='POST', path_parts=[_, Node, <<"_config">>, <<"_reload">>]}=Req) ->
+ case call_node(Node, config, reload, []) of
+ ok ->
+ send_json(Req, 200, {[{ok, true}]});
+ {error, Reason} ->
+ chttpd:send_error(Req, {bad_request, Reason})
+ end;
+handle_node_req(#httpd{path_parts=[_, _Node, <<"_config">>, <<"_reload">>]}=Req) ->
+ send_method_not_allowed(Req, "POST");
% GET /_node/$node/_config/Section
handle_node_req(#httpd{method='GET', path_parts=[_, Node, <<"_config">>, Section]}=Req) ->
KVs = [{list_to_binary(Key), list_to_binary(Value)}