| from requests.auth import HTTPBasicAuth |
| print "usage: query-cluster onos-node name cluster-number" |
| topoRequest = requests.get('http://' + node + ':8181/onos/v1/topology/clusters/' |
| auth=HTTPBasicAuth('onos', 'rocks')) |
| if topoRequest.status_code != 200: |
| topoJson = topoRequest.json() |
| print "@stc " + name + "Id=" + str(topoJson["id"]) |
| print "@stc " + name + "DeviceCount=" + str(topoJson["deviceCount"]) |
| print "@stc " + name + "LinkCount=" + str(topoJson["linkCount"]) |
| print "@stc " + name + "Root=" + topoJson["root"] |