Skip to content
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

normalize - arista show inv - NAME > PID to normalize with cisco_* show inv #1787

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/dev/data_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Example: Imagine the extra programming logic needed to consume structured data w
| `NEIGHBOR_NAME` | often represents neighbor name for CDP or LLDP |
| `NETMASK` | for IPv4 dotted quad masks |
| `NETWORK` | for network numbers or subnet address (without the mask or prefix/slash notation); in place of ROUTE |
| `PID` | represents Part IDs (PIDs), Stock Keeping Units (SKUs), and in some cases Models or Model Numbers
| `PLATFORM` | often represents CDP or LLDP neighbor's platform or model name/number |
| `PREFIX_LENGTH` | instead of PREFIX or CIDR for the numbers of a slash notation or CIDR mask |
| `PROTOCOL` | instead of PROTO |
Expand Down
10 changes: 5 additions & 5 deletions ntc_templates/templates/arista_eos_show_inventory.textfsm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Value PORT ([0-9\/]+)
Value NAME (\S+)
Value PID (\S+)
Value SN (\S+)
Value DESCR (.+)
Value VID (\d+\.\d+|\d+)
Expand All @@ -12,25 +12,25 @@ Chassis
^\s+-
^\s+HW
^\s+${VID}\s+${SN}\s+\d+-\d+-\d+ -> Record
^\s+${NAME}?\s+${DESCR}$$
^\s+${PID}?\s+${DESCR}$$
^\s*System.+(power supply|power-supply) -> Power_Supply


Power_Supply
^\s+Slot
^\s+-
^\s+${PORT}\s+${NAME}\s+${SN} -> Record
^\s+${PORT}\s+${PID}\s+${SN} -> Record
^\s*System.+(fan) -> Fan

Fan
^\s+Module
^\s+-
^\s+${PORT}?\s+\d+?\s+${NAME}?\s+${SN} -> Record
^\s+${PORT}?\s+\d+?\s+${PID}?\s+${SN} -> Record
^\s*System.+ports -> Ports

Ports
^\s+${DESCR}\s+${PORT} -> Record
^\s*System.+transceiver -> Transceiver

Transceiver
^\s+${PORT}\s+${DESCR}\s+${NAME}\s+${SN}\s+${VID} -> Record
^\s+${PORT}\s+${DESCR}\s+${PID}\s+${SN}\s+${VID} -> Record
78 changes: 39 additions & 39 deletions tests/arista_eos/show_inventory/arista_eos_show_inventory.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
---
parsed_sample:
- port: ""
name: "DCS-7150S-52-CL"
- descr: "52-port SFP+ 10GigE 1RU + Clock"
pid: "DCS-7150S-52-CL"
port: ""
sn: "JPE13120702"
descr: "52-port SFP+ 10GigE 1RU + Clock"
vid: "02.00"
- port: "1"
name: "PWR-460AC-F"
- descr: ""
pid: "PWR-460AC-F"
port: "1"
sn: "K192KU00241CZ"
descr: ""
vid: ""
- port: "2"
name: "PWR-460AC-F"
- descr: ""
pid: "PWR-460AC-F"
port: "2"
sn: "K192L200751CZ"
descr: ""
vid: ""
- port: "1"
name: "FAN-7000-F"
- descr: ""
pid: "FAN-7000-F"
port: "1"
sn: "N/A"
descr: ""
vid: ""
- port: "2"
name: "FAN-7000-F"
- descr: ""
pid: "FAN-7000-F"
port: "2"
sn: "N/A"
descr: ""
vid: ""
- port: "3"
name: "FAN-7000-F"
- descr: ""
pid: "FAN-7000-F"
port: "3"
sn: "N/A"
descr: ""
vid: ""
- port: "4"
name: "FAN-7000-F"
- descr: ""
pid: "FAN-7000-F"
port: "4"
sn: "N/A"
descr: ""
vid: ""
- port: "1"
name: ""
- descr: "Management"
pid: ""
port: "1"
sn: ""
descr: "Management"
vid: ""
- port: "52"
name: ""
- descr: "Switched"
pid: ""
port: "52"
sn: ""
descr: "Switched"
vid: ""
- port: "1"
name: "SFP-10G-SR"
- descr: "Arista Networks"
pid: "SFP-10G-SR"
port: "1"
sn: "XCW1225FD753"
descr: "Arista Networks"
vid: "0002"
- port: "2"
name: "SFP-10G-SR"
- descr: "Arista Networks"
pid: "SFP-10G-SR"
port: "2"
sn: "XCW1225FD753"
descr: "Arista Networks"
vid: "0002"
- port: "51"
name: "SFP-10G-SR"
- descr: "Arista Networks"
pid: "SFP-10G-SR"
port: "51"
sn: "XCW1225FD753"
descr: "Arista Networks"
vid: "0002"
- port: "52"
name: "SFP-10G-SR"
- descr: "Arista Networks"
pid: "SFP-10G-SR"
port: "52"
sn: "XCW1225FD753"
descr: "Arista Networks"
vid: "0002"
78 changes: 39 additions & 39 deletions tests/arista_eos/show_inventory/arista_eos_show_inventory1.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
---
parsed_sample:
- port: ""
name: "DCS-7150S-52-CL"
- descr: "52-port SFP+ 10GigE 1RU + Clock "
pid: "DCS-7150S-52-CL"
port: ""
sn: "JPE13120702"
descr: "52-port SFP+ 10GigE 1RU + Clock "
vid: "02.00"
- port: "1"
name: "PWR-460AC-F"
- descr: ""
pid: "PWR-460AC-F"
port: "1"
sn: "K192KU00241CZ"
descr: ""
vid: ""
- port: "2"
name: "PWR-460AC-F"
- descr: ""
pid: "PWR-460AC-F"
port: "2"
sn: "K192L200751CZ"
descr: ""
vid: ""
- port: "1"
name: "FAN-7000-F"
- descr: ""
pid: "FAN-7000-F"
port: "1"
sn: "N/A"
descr: ""
vid: ""
- port: "2"
name: "FAN-7000-F"
- descr: ""
pid: "FAN-7000-F"
port: "2"
sn: "N/A"
descr: ""
vid: ""
- port: "3"
name: "FAN-7000-F"
- descr: ""
pid: "FAN-7000-F"
port: "3"
sn: "N/A"
descr: ""
vid: ""
- port: "4"
name: "FAN-7000-F"
- descr: ""
pid: "FAN-7000-F"
port: "4"
sn: "N/A"
descr: ""
vid: ""
- port: "1"
name: ""
- descr: "Management"
pid: ""
port: "1"
sn: ""
descr: "Management"
vid: ""
- port: "52"
name: ""
- descr: "Switched"
pid: ""
port: "52"
sn: ""
descr: "Switched"
vid: ""
- port: "1"
name: "SFP-10G-SR"
- descr: "Arista Networks"
pid: "SFP-10G-SR"
port: "1"
sn: "XCW1225FD753"
descr: "Arista Networks"
vid: "0002"
- port: "2"
name: "SFP-10G-SR"
- descr: "Arista Networks"
pid: "SFP-10G-SR"
port: "2"
sn: "XCW1225FD753"
descr: "Arista Networks"
vid: "0002"
- port: "51"
name: "SFP-10G-SR"
- descr: "Arista Networks"
pid: "SFP-10G-SR"
port: "51"
sn: "XCW1225FD753"
descr: "Arista Networks"
vid: "0002"
- port: "52"
name: "SFP-10G-SR"
- descr: "Arista Networks"
pid: "SFP-10G-SR"
port: "52"
sn: "XCW1225FD753"
descr: "Arista Networks"
vid: "0002"
Loading