Implement nodes=1 in sysinfo.json to return number of mesh nodes (#951)

* Implement nodes=1 in sysinfo.json to return number of mesh nodes

Fixes #950

* Bump api_version in sysinfo.json

Introduce new parameter nodes=1
This commit is contained in:
Brett T. Warden 2023-09-29 20:08:49 -07:00 committed by GitHub
parent 48ee7595ce
commit 84ea30184c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -55,7 +55,7 @@ end
info={} info={}
-- API version -- API version
info['api_version']="1.11" info['api_version']="1.12"
-- NODE name -- NODE name
@ -194,6 +194,11 @@ if string.find(nixio.getenv("QUERY_STRING"):lower(),"lqm=1") then
info['lqm']=lqm info['lqm']=lqm
end end
-- MESH NODES COUNT
if string.find(nixio.getenv("QUERY_STRING"):lower(),"nodes=1") then
info['nodes']=aredn_info.getOLSRInfo()
end
-- Output the HTTP header for JSON -- Output the HTTP header for JSON
json_header() json_header()