File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -314,6 +314,23 @@ def get_parser(self, prog_name):
314314 type = str ,
315315 help = "Limit selected hosts to an additional pattern" ,
316316 )
317+ parser .add_argument (
318+ "--afi" ,
319+ type = str ,
320+ nargs = "+" ,
321+ choices = [
322+ "ipv4Unicast" ,
323+ "ipv4Multicast" ,
324+ "ipv4Vpn" ,
325+ "ipv4Flowspec" ,
326+ "ipv6Unicast" ,
327+ "ipv6Multicast" ,
328+ "ipv6Vpn" ,
329+ "ipv6Flowspec" ,
330+ "l2VpnEvpn" ,
331+ ],
332+ help = "Filter by address family (e.g. ipv4Unicast ipv6Unicast)" ,
333+ )
317334 return parser
318335
319336 def take_action (self , parsed_args ):
@@ -395,7 +412,13 @@ def take_action(self, parsed_args):
395412
396413 bgp_data = json .loads (bgp_result .stdout )
397414
415+ afi_filter = None
416+ if parsed_args .afi :
417+ afi_filter = {a .lower () for a in parsed_args .afi }
418+
398419 for afi , afi_data in bgp_data .items ():
420+ if afi_filter is not None and afi .lower () not in afi_filter :
421+ continue
399422 peers = afi_data .get ("peers" , {})
400423 for peer_name , peer_data in peers .items ():
401424 table .append (
You can’t perform that action at this time.
0 commit comments