Skip to content

Commit

Permalink
CiscoS300 'show interfaces switchport' template (networktocode#1524)
Browse files Browse the repository at this point in the history
* Fix value names due to new Data model
  • Loading branch information
PavloSkliarenko authored and mjbear committed Jan 7, 2024
1 parent af7800d commit bd98337
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Value INTERFACE (\S+)
Value INTERFACE_MODE (\S+)
Value GVRP_STATUS (\S+)
Value INGRESS_FILTERING_STATUS (\S+)
Value ACCEPTABLE_FRAME_TYPE (\S+)
Value NATIVE_VLAN (\S+)
Value List VLAN (\d+)
Value List NAME (.*?)
Value List EGRESS_RULE (Untagged|Tagged)
Value List INTERFACE_MEMBERSHIP_TYPE (\S+)
Value List FORBIDDEN_VLAN (\d+)
Value List FORBIDDEN_VLAN_NAME (.*)
Value List MAC_BASED_VLAN_GROUP_ID (\d+)
Value List MAC_BASED_VLAN_ID (\d+)

Start
^\s*Port\s*:\s*${INTERFACE}\s*$$
^\s*Port\s+Mode\s*:\s*${INTERFACE_MODE}\s*$$
^\s*Gvrp\s+Status\s*:\s*${GVRP_STATUS}\s*$$
^\s*Ingress\s+Filtering\s*:\s*${INGRESS_FILTERING_STATUS}\s*$$
^\s*Acceptable\s+Frame\s+Type\s*:\s*${ACCEPTABLE_FRAME_TYPE}\s*$$
^\s*Ingress\s+UnTagged\s+VLAN\s*\(\s*NATIVE\s*\)\s*:\s*${NATIVE_VLAN}\s*$$
^\s*Port\s+is\s+member\s+in:\s*$$ -> PartOfVlan
^\s*$$
^. -> Error

PartOfVlan
^\s*Vlan\s+Name\s+Egress\s+rule\s+Port\s+Membership\s+Type\s*$$
^(\s*-*)*\s*$$
^\s*${VLAN}\s+${NAME}\s+${EGRESS_RULE}\s+${INTERFACE_MEMBERSHIP_TYPE}\s*$$
^\s*Forbidden\s+VLANS:\s*$$ -> ForbiddenVlans
^\s*$$
^. -> Error

ForbiddenVlans
^\s*Vlan\s+Name\s*$$
^(\s*-*)*\s*$$
^\s*${FORBIDDEN_VLAN}\s+${FORBIDDEN_VLAN_NAME}\s*$$
^\s*Classification\s+rules:\s*$$ -> ClassificationRules
^\s*$$
^. -> Error

ClassificationRules
^\s*Mac\s+based\s+VLANs:\s*$$ -> MacBasedVlans
^\s*$$
^. -> Error

MacBasedVlans
^\s*Group\s+ID\s+Vlan\s+ID\s*$$
^(\s*-*)*\s*$$
^\s*${FORBIDDEN_VLAN}\s+${FORBIDDEN_VLAN_NAME}\s*$$
^\s*$$
^. -> Error
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ cisco_nxos_show_vdc.textfsm, .*, cisco_nxos, sh[[ow]] vdc
cisco_nxos_show_vpc.textfsm, .*, cisco_nxos, sh[[ow]] vpc
cisco_nxos_show_vrf.textfsm, .*, cisco_nxos, sh[[ow]] vrf

cisco_s300_show_interfaces_switchport.textfsm, .*, cisco_s300, sh[[ow]] int[[erfaces]] switchport
cisco_s300_show_interfaces_status.textfsm, .*, cisco_s300, sh[[ow]] int[[erfaces]] st[[atus]]
cisco_s300_show_mac_address-table.textfsm, .*, cisco_s300, sh[[ow]] mac address-[[table]]
cisco_s300_show_lldp_neighbors.textfsm, .*, cisco_s300, sh[[ow]] lld[[p]] neig[[hbors]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Port : fa1
Port Mode: Trunk
Gvrp Status: disabled
Ingress Filtering: true
Acceptable Frame Type: admitAll
Ingress UnTagged VLAN ( NATIVE ): 203

Port is member in:

Vlan Name Egress rule Port Membership Type
---- -------------------------------- ----------- --------------------
203 203 Untagged Static
222 VOIP-1 Tagged Static


Forbidden VLANS:
Vlan Name
---- --------------------------------


Classification rules:

Mac based VLANs:
Group ID Vlan ID
------------ -------
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
parsed_sample:
- acceptable_frame_type: "admitAll"
egress_rule:
- "Untagged"
- "Tagged"
forbidden_vlan: []
forbidden_vlan_name: []
gvrp_status: "disabled"
ingress_filtering_status: "true"
mac_based_vlan_group_id: []
mac_based_vlan_id: []
name:
- "203"
- "VOIP-1"
native_vlan: "203"
interface: "fa1"
interface_membership_type:
- "Static"
- "Static"
interface_mode: "Trunk"
vlan:
- "203"
- "222"

0 comments on commit bd98337

Please sign in to comment.