You are here

Services discovery

8 posts / 0 new
Last post
4X5DL
Services discovery
Hello all,
First post on the AREDN forum.

So we are building a network and starting to add services at different locations,
And at some point the network will be pretty big (hopefully) to keep track on all the services that operators publish.

I wonder if there is an API that I can use to list the visible services or at least on a specific node
either have it in a one page or write an app the recurse all over the visible nodes and take notes on the published services.

The idea is to gather them all to a static webpage with links to all of the services
and run that script once in a while to update that page.


Thanks and 73,
Yaniv Eliash
4X5DL
K6AH
K6AH's picture
One simple approach...
Yaniv,

One approach is to have an application such as Excel under the menu Data, Get and Transform Data, From Web read the http://localnode.local.mesh:8080/cgi-bin/mesh page and then transform the data into a useful format.

Andre, K6AH

 
K5DLQ
K5DLQ's picture
or.... you can use the

or.... you can use the sysinfo.json API...

List all services on the mesh:
http://localnode.local.mesh/cgi-bin/sysinfo.json?services=1

List services on the local node:
http://localnode.local.mesh/cgi-bin/sysinfo.json?services_local=1
 

4X5DL
nice
Thank you both K6AH and K5DLQ
This (http://localnode.local.mesh/cgi-bin/sysinfo.json?services=1) is EXACTLY what I've been looking for
now with a short golang code I can extract data from that json and have a nice website "directory" style for other operator.

One more thing please,
is there a DOC that describes the API endpoints and flags?

Thanks and 73,
Yaniv Eliash
4X5DL
K5DLQ
K5DLQ's picture
no docs currently.   That is
no docs currently.   That is something that Steve and I should work on adding to our documentation site.
K6CCC
K6CCC's picture
Thanks Darryl
Thanks!  Those are VERY useful commands to know.  Lots of useful data in one place.
I have bookmarked that.
 
4X5DL
If anyone is interested,
If anyone is interested,
here is the tool that I wrote to publish a directory style html page for nodes and services

https://github.com/geostant/aredn_discovery
km6znx
km6znx's picture
Converting json to HTML

4X5DL's  excellent solution inspired me to come up with one that uses the "requests" and "json2html" packages:

from json2html import *
import requests
import json

link = "http://10.114.101.57:8080/cgi-bin/sysinfo.json?hosts=1"
input = requests.get(link)
output = json.loads(input.content)
print(json2html.convert(json = output))

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer