From e9c259dac77cfc09ee41a67af62e2985de468ad9 Mon Sep 17 00:00:00 2001 From: Aleksandr Belytskyi Date: Wed, 22 Oct 2025 12:38:58 +0200 Subject: [PATCH] add huawei bgp route table directive --- hyperglass/defaults/directives/huawei.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/hyperglass/defaults/directives/huawei.py b/hyperglass/defaults/directives/huawei.py index f8d3ef0..04ac53c 100644 --- a/hyperglass/defaults/directives/huawei.py +++ b/hyperglass/defaults/directives/huawei.py @@ -15,6 +15,7 @@ __all__ = ( "Huawei_BGPRoute", "Huawei_Ping", "Huawei_Traceroute", + "Huawei_BGPRouteTable", ) NAME = "Huawei VRP" @@ -37,6 +38,7 @@ Huawei_BGPRoute = BuiltinDirective( ], field=Text(description="IP Address, Prefix, or Hostname"), plugins=["bgp_route_huawei"], + table_output="__hyperglass_huawei_bgp_route_table__", platforms=PLATFORMS, ) @@ -111,3 +113,24 @@ Huawei_Traceroute = BuiltinDirective( field=Text(description="IP Address, Prefix, or Hostname"), platforms=PLATFORMS, ) + +# Table Output Directives + +Huawei_BGPRouteTable = BuiltinDirective( + id="__hyperglass_huawei_bgp_route_table__", + name="BGP Route", + rules=[ + RuleWithIPv4( + condition="0.0.0.0/0", + action="permit", + command="display bgp routing-table {target} | no-more", + ), + RuleWithIPv6( + condition="::/0", + action="permit", + command="display bgp ipv6 routing-table {target} | no-more", + ), + ], + field=Text(description="IP Address, Prefix, or Hostname"), + platforms=PLATFORMS, +)