clearer names for actions, and infer actions better
[monitor.git] / tools / testapi.py
1 #!/usr/bin/python
2
3 import sys
4 import traceback
5
6 from monitor.wrapper import plc
7
8 api = plc.getAuthAPI()
9
10 try:
11         # Just try the first site returned by the call
12         site = api.GetSites()[0]
13         site_nodes = api.GetNodes(site['node_ids'])
14         site_people = api.GetPersons(site['person_ids'])
15         for node in site_nodes:
16                 network = api.GetInterfaces(node['interface_ids'])
17         print "ok"
18 except:
19         sys.stderr.write(traceback.format_exc())
20         print "fail"