Here is Carstein's script with some extra logic to cycle through all of the hubs:
hubs = nimbus.request("hub","gethubs")
-- robot arguments
args = pds.create()
pds.putString (args,"directory",".")
pds.putInt (args,"type",1)
pds.putInt (args,"detail",1)
for hidx,h in pairs(hubs.hublist) do
robots = nimbus.request(h.addr,"getrobots")
for ridx,r in pairs(robots["robotlist"]) do
dl = nimbus.request(r.addr,"directory_list",args)
for k,e in pairs(dl["entry"]) do
if e.name == "robot" then
printf ("%-40s created %s (UTC %d)",r.addr, timestamp.format (e.created,"%Y.%m.%d %H:%M"), e.created)
end
end
end
end
pds.delete (args)
Note there is no error checking in this script. Each call to the nimbus.request() function should probably accept a second return value containing the return code from the request. If the return code is 0, all is well. If not, the return code gives you an idea what went wrong. That way when you encounter a problem, the script can potentially continue on with the next hub/robot rather than dying. Completely optional, of course.
-Keith