New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Template: cisco_nxos_show_interface_description #758
Merged
FragmentedPacket
merged 2 commits into
networktocode:master
from
network-dave:cisco_nxos_show_interface_description
Jun 19, 2020
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Value PORT (\S+) | ||
Value TYPE (\S+) | ||
Value SPEED (\d+G?) | ||
Value DESCRIPTION (\S.*?) | ||
|
||
Start | ||
^Interface\s+Description\s*$$ -> Begin | ||
|
||
Begin | ||
^-+ | ||
^Port\s+Type\s+Speed\s+Description\s*$$ | ||
^Interface\s+Description\s*$$ | ||
^${PORT}\s+${TYPE}\s+${SPEED}(?:\s+${DESCRIPTION})?\s*$$ -> Record | ||
^${PORT}\s+(?:\s+${DESCRIPTION})?\s*$$ -> Record | ||
^\s*$$ | ||
^. -> Error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 131 additions & 0 deletions
131
tests/cisco_nxos/show_interface_description/cisco_nxos_show_interface_description.raw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
|
||
------------------------------------------------------------------------------- | ||
Interface Description | ||
------------------------------------------------------------------------------- | ||
mgmt0 -- | ||
|
||
------------------------------------------------------------------------------- | ||
Port Type Speed Description | ||
------------------------------------------------------------------------------- | ||
Eth4/1 eth 10G -- | ||
Eth4/2 eth 1000 -- | ||
Eth4/3 eth 10G This is a test description | ||
Eth4/4 eth 10G This is a test description | ||
Eth4/5 eth 10G This is a test description | ||
Eth4/6 eth 1000 This is a test description | ||
Eth4/7 eth 10G This is a test description | ||
Eth4/8 eth 1000 This is a test description | ||
Eth4/9 eth 10G This is a test description | ||
Eth4/10 eth 10G This is a test description | ||
Eth4/11 eth 10G This is a test description | ||
Eth4/12 eth 10G This is a test description | ||
Eth4/13 eth 1000 This is a test description | ||
Eth4/14 eth 10G -- | ||
Eth4/15 eth 10G This is a test description | ||
Eth4/16 eth 10G This is a test description | ||
Eth4/17 eth 1000 This is a test description | ||
Eth4/18 eth 10G This is a test description | ||
Eth4/19 eth 1000 This is a test description | ||
Eth4/20 eth 10G This is a test description | ||
Eth4/21 eth 10G This is a test description | ||
Eth4/22 eth 10G This is a test description | ||
Eth4/23 eth 10G This is a test description | ||
Eth4/24 eth 10G This is a test description | ||
Eth6/1 eth 10G This is a description on line card 6 | ||
Eth6/2 eth 10G This is a description on line card 6 | ||
Eth6/3 eth 1000 This is a description on line card 6 | ||
Eth6/4 eth 1000 This is a description on line card 6 | ||
Eth6/5 eth 10G This is a description on line card 6 | ||
Eth6/6 eth 1000 This is a description on line card 6 | ||
Eth6/7 eth 10G This is a description on line card 6 | ||
Eth6/8 eth 10G This is a description on line card 6 | ||
Eth6/9 eth 10G This is a description on line card 6 | ||
Eth6/10 eth 10G This is a description on line card 6 | ||
Eth6/11 eth 10G This is a description on line card 6 | ||
Eth6/12 eth 10G This is a description on line card 6 | ||
Eth6/13 eth 10G This is a description on line card 6 | ||
Eth6/14 eth 10G This is a description on line card 6 | ||
Eth6/15 eth 10G This is a description on line card 6 | ||
Eth6/16 eth 1000 This is a description on line card 6 | ||
Eth6/17 eth 10G This is a description on line card 6 | ||
Eth6/18 eth 1000 This is a description on line card 6 | ||
Eth6/19 eth 10G This is a description on line card 6 | ||
Eth6/20 eth 10G This is a description on line card 6 | ||
Eth6/21 eth 10G This is a description on line card 6 | ||
Eth6/22 eth 10G This is a description on line card 6 | ||
Eth6/23 eth 10G This is a description on line card 6 | ||
Eth6/24 eth 10G This is a description on line card 6 | ||
Eth6/25 eth 1000 This is a description on line card 6 | ||
Eth6/26 eth 1000 This is a description on line card 6 | ||
Eth6/27 eth 10G This is a description on line card 6 | ||
Eth6/28 eth 1000 This is a description on line card 6 | ||
Eth6/29 eth 10G This is a description on line card 6 | ||
Eth6/30 eth 10G This is a description on line card 6 | ||
Eth6/31 eth 10G This is a description on line card 6 | ||
Eth6/32 eth 10G This is a description on line card 6 | ||
Eth6/33 eth 10G This is a description on line card 6 | ||
Eth6/34 eth 1000 This is a description on line card 6 | ||
Eth6/35 eth 10G This is a description on line card 6 | ||
Eth6/36 eth 1000 This is a description on line card 6 | ||
Eth6/37 eth 10G This is a description on line card 6 | ||
Eth6/38 eth 10G This is a description on line card 6 | ||
Eth6/39 eth 1000 This is a description on line card 6 | ||
Eth6/40 eth 10G This is a description on line card 6 | ||
Eth6/41 eth 10G This is a description on line card 6 | ||
Eth6/42 eth 10G This is a description on line card 6 | ||
Eth6/43 eth 10G This is a description on line card 6 | ||
Eth6/44 eth 10G This is a description on line card 6 | ||
Eth6/45 eth 10G This is a description on line card 6 | ||
Eth6/46 eth 10G This is a description on line card 6 | ||
Eth6/47 eth 10G This is a description on line card 6 | ||
Eth6/48 eth 10G This is a description on line card 6 | ||
|
||
------------------------------------------------------------------------------- | ||
Interface Description | ||
------------------------------------------------------------------------------- | ||
Po10 This is a portchannel | ||
Po20 This is a portchannel | ||
Po25 This is a portchannel | ||
Po300 This is a portchannel | ||
|
||
------------------------------------------------------------------------------- | ||
Interface Description | ||
------------------------------------------------------------------------------- | ||
Lo0 This is a loopback | ||
Lo1 This is a loopback | ||
Lo2 This is a loopback | ||
Lo20 -- | ||
Lo30 -- | ||
Vlan1 -- | ||
Vlan9 Nice little VLAN interface here | ||
Vlan10 Nice little VLAN interface here | ||
Vlan20 Nice little VLAN interface here | ||
Vlan30 Nice little VLAN interface here | ||
|
||
------------------------------------------------------------------------------- | ||
Port Type Speed Description | ||
------------------------------------------------------------------------------- | ||
Eth100/1/1 eth 1000 This is another description | ||
Eth100/1/2 eth 1000 This is another description | ||
Eth100/1/3 eth 1000 This is another description | ||
Eth100/1/4 eth 1000 This is another description | ||
Eth100/1/5 eth 1000 This is another description | ||
Eth100/1/6 eth 1000 This is another description | ||
Eth100/1/7 eth 1000 This is another description | ||
Eth100/1/8 eth 1000 This is another description | ||
Eth100/1/9 eth 1000 This is another description | ||
Eth100/1/10 eth 1000 This is another description | ||
Eth100/1/11 eth 1000 This is another description | ||
Eth100/1/12 eth 1000 This is another description | ||
Eth100/1/13 eth 1000 This is another description | ||
Eth100/1/14 eth 1000 This is another description | ||
Eth100/1/15 eth 1000 This is another description | ||
Eth100/1/16 eth 1000 This is another description | ||
Eth100/1/17 eth 1000 This is another description | ||
Eth100/1/18 eth 1000 This is another description | ||
Eth100/1/19 eth 1000 This is another description | ||
Eth100/1/20 eth 1000 This is another description | ||
Eth100/1/21 eth 1000 This is another description | ||
Eth100/1/22 eth 1000 This is another description | ||
Eth100/1/23 eth 1000 This is another description | ||
Eth100/1/24 eth 1000 This is another description |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a template that should work and uses the state changes to capture the necessary output for each header in the output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work at 100% because it catches "Interface Description" while already in the Type1 state. The new version would be substantially more complicated for the same result. I will commit a very slightly updated version.
Open to discuss this though.