diff --git a/templates/cisco_nxos_show_interfaces_switchport.template b/templates/cisco_nxos_show_interfaces_switchport.template new file mode 100644 index 0000000000..b50cb16ad3 --- /dev/null +++ b/templates/cisco_nxos_show_interfaces_switchport.template @@ -0,0 +1,18 @@ +Value Required INTERFACE (\S+) +Value SWITCHPORT (.+) +Value SWITCHPORT_MONITOR (.+) +Value MODE (.+) +Value ACCESS_VLAN (\d+) +Value NATIVE_VLAN (\d+) +Value TRUNKING_VLANS (\S+) + +Start + ^Name: ${INTERFACE} + ^\s*Switchport: ${SWITCHPORT} + ^\s*Switchport Monitor: ${SWITCHPORT_MONITOR} + ^\s*Operational Mode: ${MODE} + ^\s*Access Mode VLAN: ${ACCESS_VLAN} + ^\s*Trunking Native Mode VLAN: ${NATIVE_VLAN} + ^\s*Trunking VLANs Allowed: ${TRUNKING_VLANS} -> Record + ^.+$$ + ^. -> Error diff --git a/templates/index b/templates/index index 3cc6a95297..fd0ac37e15 100644 --- a/templates/index +++ b/templates/index @@ -191,6 +191,7 @@ cisco_nxos_show_l2rib_internal_permanently-frozen-list.template, .*, cisco_nxos, cisco_nxos_show_configuration_session_summary.template, .*, cisco_nxos, sh[[ow]] configu[[ration]] s[[ession]] su[[mmary]] cisco_nxos_show_interface_transceiver_details.template, .*, cisco_nxos, sh[[ow]] int[[erface]] tra[[nsceiver]] de[[tails]] cisco_nxos_show_environment_temperature.template, .*, cisco_nxos, sh[[ow]] env[[ironment]] t[[emperature]] +cisco_nxos_show_interfaces_switchport.template, .*, cisco_nxos, sh[[ow]] int[[erfaces]] sw[[itchport]] cisco_nxos_show_ip_dhcp_relay_address.template, .*, cisco_nxos, sh[[ow]] ip dh[[cp]] r[[elay]] a[[ddress]] cisco_nxos_show_lldp_neighbors_detail.template, .*, cisco_nxos, sh[[ow]] ll[[dp]] nei[[ghbors]] d[[etail]] cisco_nxos_show_cdp_neighbors_detail.template, .*, cisco_nxos, sh[[ow]] c[[dp]] neig[[hbors]] det[[ail]] diff --git a/tests/cisco_nxos/show_interfaces_switchport/cisco_nxos_show_interfaces_switchport.parsed b/tests/cisco_nxos/show_interfaces_switchport/cisco_nxos_show_interfaces_switchport.parsed new file mode 100644 index 0000000000..f48016af54 --- /dev/null +++ b/tests/cisco_nxos/show_interfaces_switchport/cisco_nxos_show_interfaces_switchport.parsed @@ -0,0 +1,24 @@ +--- +parsed_sample: + + - interface: Ethernet1/1 + switchport: Enabled + switchport_monitor: Not enabled + mode: access + access_vlan: '3' + native_vlan: '1' + trunking_vlans: '1-4094' + - interface: Ethernet1/2 + switchport: Enabled + switchport_monitor: Not enabled + mode: trunk + access_vlan: '1' + native_vlan: '5' + trunking_vlans: '1-4094' + - interface: Ethernet1/3 + switchport: Enabled + switchport_monitor: Not enabled + mode: trunk + access_vlan: '1' + native_vlan: '1' + trunking_vlans: '1-4094' diff --git a/tests/cisco_nxos/show_interfaces_switchport/cisco_nxos_show_interfaces_switchport.raw b/tests/cisco_nxos/show_interfaces_switchport/cisco_nxos_show_interfaces_switchport.raw new file mode 100644 index 0000000000..a9fe82f43c --- /dev/null +++ b/tests/cisco_nxos/show_interfaces_switchport/cisco_nxos_show_interfaces_switchport.raw @@ -0,0 +1,63 @@ +Name: Ethernet1/1 + Switchport: Enabled + Switchport Monitor: Not enabled + Switchport Isolated : Not enabled + Switchport Block Multicast: Not enabled + Switchport Block Unicast: Not enabled + Operational Mode: access + Access Mode VLAN: 3 (Vlan not created) + Trunking Native Mode VLAN: 1 (default) + Trunking VLANs Allowed: 1-4094 + Voice VLAN: none + Extended Trust State : not trusted [COS = 0] + Administrative private-vlan primary host-association: none + Administrative private-vlan secondary host-association: none + Administrative private-vlan primary mapping: none + Administrative private-vlan secondary mapping: none + Administrative private-vlan trunk native VLAN: none + Administrative private-vlan trunk encapsulation: dot1q + Administrative private-vlan trunk normal VLANs: none + Administrative private-vlan trunk private VLANs: none + Operational private-vlan: none +Name: Ethernet1/2 + Switchport: Enabled + Switchport Monitor: Not enabled + Switchport Isolated : Not enabled + Switchport Block Multicast: Not enabled + Switchport Block Unicast: Not enabled + Operational Mode: trunk + Access Mode VLAN: 1 (default) + Trunking Native Mode VLAN: 5 (Vlan not created) + Trunking VLANs Allowed: 1-4094 + Voice VLAN: none + Extended Trust State : not trusted [COS = 0] + Administrative private-vlan primary host-association: none + Administrative private-vlan secondary host-association: none + Administrative private-vlan primary mapping: none + Administrative private-vlan secondary mapping: none + Administrative private-vlan trunk native VLAN: none + Administrative private-vlan trunk encapsulation: dot1q + Administrative private-vlan trunk normal VLANs: none + Administrative private-vlan trunk private VLANs: none + Operational private-vlan: none +Name: Ethernet1/3 + Switchport: Enabled + Switchport Monitor: Not enabled + Switchport Isolated : Not enabled + Switchport Block Multicast: Not enabled + Switchport Block Unicast: Not enabled + Operational Mode: trunk + Access Mode VLAN: 1 (default) + Trunking Native Mode VLAN: 1 (default) + Trunking VLANs Allowed: 1-4094 + Voice VLAN: none + Extended Trust State : not trusted [COS = 0] + Administrative private-vlan primary host-association: none + Administrative private-vlan secondary host-association: none + Administrative private-vlan primary mapping: none + Administrative private-vlan secondary mapping: none + Administrative private-vlan trunk native VLAN: none + Administrative private-vlan trunk encapsulation: dot1q + Administrative private-vlan trunk normal VLANs: none + Administrative private-vlan trunk private VLANs: none + Operational private-vlan: none