Skip to content

Commit dfc29d7

Browse files
Enric Perpinyà Pitarchmjbear
andauthored
Add Huawei SmartAX: display location <mac> ont (#1993)
* Adding new template for Huawei SmartAX: `display location <mac> ont` * fixing index order * Update ntc_templates/templates/huawei_smartax_display_location_aaaa-aaaa-aaaa_ont.textfsm * Add in text and patterns for non-mmi/scroll/undo * Normalize VLAN to VLAN_ID * Normalize MAC to MAC_ADDRESS In addition to MAC to MAC_ADDRESS, also MAC_TYPE to MAC_ADDRESS_TYPE --------- Co-authored-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
1 parent b0fc2fe commit dfc29d7

4 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Value MAC_ADDRESS (\S+)
2+
Value MAC_ADDRESS_TYPE (\w+)
3+
Value FSP (\d+\s*\/\s*\d+\s*\/\d+)
4+
Value ONT_ID (\d+)
5+
Value PORT_ID (\d+)
6+
Value PORT_TYPE (\w+)
7+
Value VLAN_ID (\d+)
8+
9+
Start
10+
^\s*It\s+will\s+take\s+several\s+minutes,\s+please\s+wait\s+or\s+press\s+CTRL_C\s+to\s+break\s*$$
11+
^\s*-+\s*$$
12+
^\s*(MAC\s+){2}TYPE\s+F/S/P\s+ONT\s+ID\s+Port\s+ID\s+Port\s+Type\s+VLAN\s*$$
13+
^\s*${MAC_ADDRESS}\s+${MAC_ADDRESS_TYPE}\s+${FSP}\s+${ONT_ID}\s+${PORT_ID}\s+${PORT_TYPE}\s+${VLAN_ID}\s*$$ -> Record
14+
^\s*{\s+<cr>\|+<K>\s+}:\s*$$
15+
^\s+Command:\s*$$
16+
^\s+display\s+location\s+\S+\s+ont\s*$$
17+
^\s+Are\s+you\s+sure
18+
^. -> Error

ntc_templates/templates/index

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ huawei_ont_display_sn.textfsm, .*, huawei_ont, di[[splay]] sn
707707
huawei_smartax_display_ont_info_summary_ont.textfsm:huawei_smartax_display_ont_info_summary_sn.textfsm, .*, huawei_smartax, di[[splay]] ont i[[nfo]] su[[mmary]] \S+ *$
708708
huawei_smartax_display_ont_info_0_1_2.textfsm:huawei_smartax_display_ont_info_description.textfsm, .*, huawei_smartax, di[[splay]] ont i[[nfo]] (\d+\s*|\d+ \d+ \d+\s*)\s*[[all]] *$
709709
huawei_smartax_display_ont_port_vlan_0_1_byport_eth_0.textfsm, .*, huawei_smartax, di[[splay]] ont p[[ort]] vl[[an]] \d+ \d+ byport eth \d+\s*
710+
huawei_smartax_display_location_aaaa-aaaa-aaaa_ont.textfsm, .*, huawei_smartax, disp[[lay]] loc[[ation]] \S+ o[[nt]]
710711
huawei_smartax_display_ont_port_state_0_1_eth-port.textfsm, .*, huawei_smartax, di[[splay]] on[[t]] por[[t]] st[[ate]] \d+ \d+ e[[th-port]]
711712
huawei_smartax_display_ont_port_vlan_0_1_byvlan_0.textfsm, .*, huawei_smartax, di[[splay]] ont p[[ort]] v[[lan]] \d+ \d+ byvlan \d+
712713
huawei_smartax_display_ont-lineprofile_gpon_all.textfsm, .*, huawei_smartax, disp[[lay]] ont-li[[neprofile]] g[[pon]] a[[ll]]\s*
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{ <cr>||<K> }:
2+
3+
Command:
4+
display location aaaa-aaaa-aaaa ont
5+
It will take several minutes, please wait or press CTRL_C to break
6+
Are you sure to query MAC address location ? (y/n)[n]:y
7+
----------------------------------------------------------------------
8+
MAC MAC TYPE F/S/P ONT ID Port ID Port Type VLAN
9+
----------------------------------------------------------------------
10+
aaaa-aaaa-aaaa DYNAMIC 0/ 1/0 0 1 ETH 1
11+
----------------------------------------------------------------------
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
parsed_sample:
3+
- fsp: "0/ 1/0"
4+
mac_address: "aaaa-aaaa-aaaa"
5+
mac_address_type: "DYNAMIC"
6+
ont_id: "0"
7+
port_id: "1"
8+
port_type: "ETH"
9+
vlan_id: "1"

0 commit comments

Comments
 (0)