VOL-1623-meter support and handling techprofile and fix for flow delete , now migrated to onosproject/onos:1.13.9-rc4
Change in flowupdate API towards adapters
Remove meter_get API from adapter to core
Added dependent vendor library files downloaded by "dep-ensure -update"
Added techprofile changes in the single commit
Review comments are addressed
submiting patch for integration tests for meter changes and modifications in unit test for updated flow decomposer logic
- submitting on behalf of "Salman.Siddiqui@radisys.com"
Load test for meter updated and other flow management test cases with meter
- Performed load test for 1K meters serially and parallely and added more TC in flow management
Rebased
Load test for meter updated and other flow management test cases with meter
- Performed load test for 1K meters serially and parallely and added more TC in flow management
- submitting on behalf of "Salman.Siddiqui@radisys.com"
pulled latest protos
verified EAPOL/DHCP/HSIA data with Edgecore OLT & TW ONT kit for one subcriber
verified delete/re-add is working end to end for the same subscriber
Change-Id: Idb232b7a0f05dc0c7e68266ac885740a3adff317
diff --git a/python/cli/logical_device.py b/python/cli/logical_device.py
index 187dd88..a49f6f8 100644
--- a/python/cli/logical_device.py
+++ b/python/cli/logical_device.py
@@ -96,6 +96,16 @@
groups=logical_device['flow_groups']['items']
)
+ def do_meters(self, _):
+ """Show flow meter table for logical device"""
+ logical_device = pb2dict(self.get_logical_device(-1))
+ print_meters(
+ 'Logical Device',
+ self.logical_device_id,
+ type='n/a',
+ meters=logical_device['meters']['items']
+ )
+
def do_devices(self, line):
"""List devices that belong to this logical device"""
logical_device = self.get_logical_device()
diff --git a/python/cli/utils.py b/python/cli/utils.py
index 1f72be3..7668b7c 100644
--- a/python/cli/utils.py
+++ b/python/cli/utils.py
@@ -140,15 +140,21 @@
for instruction in flow['instructions']:
itype = instruction['type']
- if itype == 4:
+ if itype == 4 or itype == 3:
for action in instruction['actions']['actions']:
atype = action['type'][len('OFPAT_'):]
table.add_cell(i, *action_printers[atype](action))
elif itype == 1:
table.add_cell(i, 10000, 'goto-table',
instruction['goto_table']['table_id'])
+ elif itype == 2:
+ table.add_cell(i, 10001, 'write-metadata',
+ instruction['write_metadata']['metadata'])
elif itype == 5:
- table.add_cell(i, 10000, 'clear-actions', [])
+ table.add_cell(i, 10002, 'clear-actions', [])
+ elif itype == 6:
+ table.add_cell(i, 10003, 'meter',
+ instruction['meter']['meter_id'])
else:
raise NotImplementedError(
'not handling instruction type {}'.format(itype))
@@ -177,6 +183,26 @@
table.print_table(header, printfn)
+def print_meters(what, id, type, meters, printfn=_printfn):
+ header = ''.join([
+ '{} '.format(what),
+ colored(id, color='green', attrs=['bold']),
+ ' (type: ',
+ colored(type, color='blue'),
+ ')'
+ ]) + '\nMeters ({}):'.format(len(meters))
+
+ table = TablePrinter()
+ for i, meter in enumerate(meters):
+ bands = []
+ for meter_band in meter['config']['bands']:
+ bands.append(meter_band)
+ table.add_cell(i, 0, 'meter_id', value=str(meter['config']['meter_id']))
+ table.add_cell(i, 1, 'meter_bands', value=str(dict(bands=bands)))
+
+ table.print_table(header, printfn)
+
+
def dict2line(d):
assert isinstance(d, dict)
return ', '.join('{}: {}'.format(k, v) for k, v in sorted(d.items()))