This commit is contained in:
Morten V. Christiansen 2025-09-09 01:54:22 -04:00
parent 09d2c141f3
commit e707160fd1
2 changed files with 13 additions and 13 deletions

View File

@ -15,17 +15,14 @@ function node_start(child)
local nodename = child.attr.nodename
local args = child.attr.args --may be nil
local msg = "https://"..host.."/_django_App_start?nodetype=".."\""..nodetype.."\"".."?nodename=".."\""..nodename.."\""
local msg = "https://"..host.."/persistmods/start?nodetype=".."\""..nodetype.."\"".."&nodename=".."\""..nodename.."\""
if (args ~= nil) then
msg = msg .."?args=\""..args.."\""
msg = msg .."&args=\""..args.."\""
end
local response, code, headers = easyhttp.request(msg)
#print(response)
#print(code)
#print(headers)
print( msg)
--send & handle resp
@ -37,17 +34,20 @@ function node_execute(child)
local nodename=child.attr.nodename
local host=live_nodes[nodename]
print ("https://"..host.."/_django_App_execute?nodename=".."\""..nodename.."\"")
local response, code, headers = easyhttp.request(msg)
print ("https://"..host.."/persistmods/execute?nodename=".."\""..nodename.."\"")
local response, code, headers = easyhttp.request("https://"..host.."/persistmods/execute?nodename=".."\""..nodename.."\"")
end
function node_get_logs(child)
for a, b in pairs(live_nodes) do
print ("https://"..b.."/_django_App_get_logs?nodename=".."\""..a.."\"")
msg="https://"..b.."//persistmods/get_logs?nodename=".."\""..a.."\""
local response, code, headers = easyhttp.request(msg)
print)msg)
end
local file = io.open("logfil.txt", "w") -- "w" means write (overwrite)
file:write("Test OK")
file:write(response)
file:close()
end
@ -61,8 +61,8 @@ end
function node_close(child)
local nodename=child.attr.nodename
local host=live_nodes[nodename]
print ("https://"..host.."/_django_App_close?nodename=".."\""..nodename.."\"")
local response, code, headers = easyhttp.request(msg)
print ("https://"..host.."/persistsmods/stop?nodename=".."\""..nodename.."\"")
local response, code, headers = easyhttp.request("https://"..host.."/persistsmods/stop?nodename=".."\""..nodename.."\"")
end

View File

@ -1,5 +1,5 @@
<notetool-node-start host="10.137.0.13" nodetype="default" nodename="node1" args="host2 node2" />
<notetool-node-start host="10.137.0.13" nodetype="default" nodename="node2" />
<notetool-node-start host="10.137.0.13:8000" nodetype="default" nodename="node1" args="host2 node2" />
<notetool-node-start host="10.137.0.13:8000" nodetype="default" nodename="node2" />
<notetool-node-execute nodename="node1" />
<notetool-get-logs />
<nodetool-check-test />