From 144cf37cacbbe0b8ab07b6ce51dcfcd27a54d311 Mon Sep 17 00:00:00 2001 From: dampfhamm3r Date: Wed, 24 Jul 2019 16:10:40 +0200 Subject: [PATCH] add Cisco IOS XR 'show ip interface brief' command (#438) added cisco_xr_show_ip_interface_brief.template --- .../cisco_xr_show_ip_interface_brief.template | 8 +++++ templates/index | 1 + .../cisco_xr_show_ip_interface_brief.parsed | 32 +++++++++++++++++++ .../cisco_xr_show_ip_interface_brief.raw | 7 ++++ 4 files changed, 48 insertions(+) create mode 100644 templates/cisco_xr_show_ip_interface_brief.template create mode 100644 tests/cisco_xr/show_ip_interface_brief/cisco_xr_show_ip_interface_brief.parsed create mode 100644 tests/cisco_xr/show_ip_interface_brief/cisco_xr_show_ip_interface_brief.raw diff --git a/templates/cisco_xr_show_ip_interface_brief.template b/templates/cisco_xr_show_ip_interface_brief.template new file mode 100644 index 0000000000..b199c0d451 --- /dev/null +++ b/templates/cisco_xr_show_ip_interface_brief.template @@ -0,0 +1,8 @@ +Value INTF (.+?) +Value IPADDR (\S+) +Value STATUS (Up|Down|Shutdown) +Value PROTO (Up|Down) +Value VRF (\S+) + +Start + ^${INTF}\s+${IPADDR}\s+${STATUS}\s+${PROTO}\s+${VRF} -> Record diff --git a/templates/index b/templates/index index a2b4bbc876..3cc6a95297 100644 --- a/templates/index +++ b/templates/index @@ -250,6 +250,7 @@ cisco_xr_show_mpls_ldp_neighbor_brief.template, .*, cisco_xr, sh[[ow]] mp[[ls]] cisco_xr_admin_show_environment_fan.template, .*, cisco_xr, adm[[in]] sh[[ow]] env[[ironment]] f[[an]] cisco_xr_show_cdp_neighbors_detail.template, .*, cisco_xr, sh[[ow]] c[[dp]] neig[[hbors]] det[[ail]] cisco_xr_show_cef_drops_location.template, .*, cisco_xr, sh[[ow]] cef drops loc[[ation]] +cisco_xr_show_ip_interface_brief.template, .*, cisco_xr, sh[[ow]] ip int[[erface]] br[[ief]] cisco_xr_show_redundancy_summary.template, .*, cisco_xr, sh[[ow]] redun[[dancy]] summ[[ary]] cisco_xr_show_interface_brief.template, .*, cisco_xr, sh[[ow]] int[[erface]] br[[ief]] cisco_xr_admin_show_platform.template, .*, cisco_xr, adm[[in]] sh[[ow]] pla[[tform]] diff --git a/tests/cisco_xr/show_ip_interface_brief/cisco_xr_show_ip_interface_brief.parsed b/tests/cisco_xr/show_ip_interface_brief/cisco_xr_show_ip_interface_brief.parsed new file mode 100644 index 0000000000..a7db26ca78 --- /dev/null +++ b/tests/cisco_xr/show_ip_interface_brief/cisco_xr_show_ip_interface_brief.parsed @@ -0,0 +1,32 @@ +--- +parsed_sample: + - intf: 'GigabitEthernet0/0/1/18' + ipaddr: 'unassigned' + status: 'Shutdown' + proto: 'Down' + vrf: 'default' + - intf: 'GigabitEthernet0/0/1/19' + ipaddr: 'unassigned' + status: 'Up' + proto: 'Up' + vrf: 'default' + - intf: 'GigabitEthernet0/0/1/19.2003' + ipaddr: '10.79.255.0' + status: 'Up' + proto: 'Up' + vrf: 'WAG:OOB' + - intf: 'TenGigE0/0/2/0' + ipaddr: 'unassigned' + status: 'Up' + proto: 'Up' + vrf: 'default' + - intf: 'TenGigE0/0/2/0.2396' + ipaddr: '10.79.255.96' + status: 'Up' + proto: 'Up' + vrf: 'WAG:123' + - intf: 'TenGigE0/0/2/0.2397' + ipaddr: '10.79.255.80' + status: 'Up' + proto: 'Up' + vrf: 'WAG:ABC' diff --git a/tests/cisco_xr/show_ip_interface_brief/cisco_xr_show_ip_interface_brief.raw b/tests/cisco_xr/show_ip_interface_brief/cisco_xr_show_ip_interface_brief.raw new file mode 100644 index 0000000000..e9fa29a687 --- /dev/null +++ b/tests/cisco_xr/show_ip_interface_brief/cisco_xr_show_ip_interface_brief.raw @@ -0,0 +1,7 @@ +Interface IP-Address Status Protocol Vrf-Name +GigabitEthernet0/0/1/18 unassigned Shutdown Down default +GigabitEthernet0/0/1/19 unassigned Up Up default +GigabitEthernet0/0/1/19.2003 10.79.255.0 Up Up WAG:OOB +TenGigE0/0/2/0 unassigned Up Up default +TenGigE0/0/2/0.2396 10.79.255.96 Up Up WAG:123 +TenGigE0/0/2/0.2397 10.79.255.80 Up Up WAG:ABC