From 000899868043dd7e779ed76e9e5c23a098f5e060 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 23 Jan 2023 13:37:29 -0500 Subject: [PATCH] Add api method to request all mac data This will provide easy way for client to get FDB data, potentially for use in conjunction with discovery data. For now, leave LLDP out, as that isn't currently cached at the confluent layer. --- confluent_server/confluent/networking/macmap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/networking/macmap.py b/confluent_server/confluent/networking/macmap.py index f44e8c93..6069fa6f 100644 --- a/confluent_server/confluent/networking/macmap.py +++ b/confluent_server/confluent/networking/macmap.py @@ -601,7 +601,7 @@ def handle_read_api_request(pathcomponents, configmanager): elif len(pathcomponents) == 2: if pathcomponents[-1] == 'macs': return [msg.ChildCollection(x) for x in (# 'by-node/', - 'by-mac/', 'by-switch/', + 'alldata', 'by-mac/', 'by-switch/', 'rescan')] elif pathcomponents[-1] == 'neighbors': return [msg.ChildCollection('by-switch/')] @@ -616,6 +616,8 @@ def handle_read_api_request(pathcomponents, configmanager): elif len(pathcomponents) == 4: macaddr = pathcomponents[-1].replace('-', ':') return dump_macinfo(macaddr) + elif pathcomponents[2] == 'alldata': + return [msg.KeyValueData(_apimacmap)] elif pathcomponents[2] == 'by-mac': if len(pathcomponents) == 3: return [msg.ChildCollection(x.replace(':', '-'))