3 Authors: Baohua Yang@IBM, Denghui Huang@IBM
11 from testmodule import TestModule
16 class StatisticsManager(TestModule):
18 Test for the statistics manager.
19 Start 2-layer tree topology network. e.g., in Mininet, run 'sudo mn --controller=remote,ip=127.0.0.1 --mac --topo tree,2'
22 def __init__(self, restSubContext='/controller/nb/v2/statistics', user=DEFAULT_USER, password=DEFAULT_PWD,
23 container=DEFAULT_CONTAINER, contentType='json', prefix=DEFAULT_PREFIX):
24 super(self.__class__, self).__init__(restSubContext, user, password, container, contentType, prefix)
26 def get_flow_stats(self):
28 The name is suggested to match the NB API.
29 Show the flow statistics
31 return super(self.__class__, self).get_entries('flow')
33 def get_port_stats(self):
35 The name is suggested to match the NB API.
36 Show the port statistics
38 return super(self.__class__, self).get_entries('port')
40 def get_table_stats(self):
42 The name is suggested to match the NB API.
43 Show the table statistics
45 return super(self.__class__, self).get_entries('table')