self.auth = auth
self.debug = debug
-
def crawl_flows(self, flows):
"""
Collects and prints summary information for all flows in a table
print " Flow %s:" % f['id']
print s
-
def crawl_table(self, table):
"""
Collects and prints summary statistics information about a single table. Depending on the print level
except KeyError:
pass
-
def crawl_node(self, node):
"""
Collects and prints summary information about a single node
if self.plevel > 1:
print ' Data for tables not available.'
-
def crawl_inventory(self):
"""
Collects and prints summary information about all openflow nodes in a data store (either operational or config)
"""
+ self.nodes = 0
self.found_flows = 0
self.reported_flows = 0
self.table_stats_unavailable = 0
s.close()
-
def set_plevel(self, plevel):
self.plevel = plevel
-
-
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Restconf test program')
- parser.add_argument('--odlhost', default='127.0.0.1', help='host where '
- 'odl controller is running (default is 127.0.0.1)')
- parser.add_argument('--odlport', default='8181', help='port on '
- 'which odl\'s RESTCONF is listening (default is 8181)')
+ parser.add_argument('--host', default='127.0.0.1', help='host where '
+ 'the controller is running; default 127.0.0.1')
+ parser.add_argument('--port', default='8181', help='port on '
+ 'which odl\'s RESTCONF is listening; default 8181')
parser.add_argument('--plevel', type=int, default=0,
help='Print Level: 0 - Summary (stats only); 1 - Node names; 2 - Node details;'
'3 - Flow details')
parser.add_argument('--datastore', choices=['operational', 'config'],
- default='operational', help='Which data store to crawl; '
- 'default operational')
+ default='operational', help='Which data store to crawl; default operational')
parser.add_argument('--no-auth', dest='auth', action='store_false', default=False,
help="Do not use authenticated access to REST (default)")
parser.add_argument('--auth', dest='auth', action='store_true',
in_args = parser.parse_args()
- ic = InventoryCrawler(in_args.odlhost, in_args.odlport, in_args.plevel, in_args.datastore, in_args.auth,
+ ic = InventoryCrawler(in_args.host, in_args.port, in_args.plevel, in_args.datastore, in_args.auth,
in_args.debug)
print "Crawling '%s'" % ic.url
if n_missing > 0:
print '\nMissing table stats (%d nodes):' % n_missing
print "%s\n" % ", ".join([x for x in ic.table_stats_fails])
-
-