| from requests.auth import HTTPBasicAuth |
| print "usage: verify-topo-links onos-node cluster-id first-index last-index" |
| topoRequest = requests.get('http://' + node + ':8181/onos/v1/topology/clusters/' |
| auth=HTTPBasicAuth('onos', 'rocks')) |
| if topoRequest.status_code != 200: |
| topoJson = topoRequest.json() |
| for deviceIndex in range(first, last+1): |
| lookingFor = "of:" + format(deviceIndex, '016x') |
| for arrayIndex in range(0, len(topoJson["devices"])): |
| device = topoJson["devices"][arrayIndex] |
| print "Match found for " + device |
| if found == last - first: |
| print "Found " + str(found) + " matches, need " + str(last - first) |