Loading scripts/inventory/INV_SRV_01/INV_SRV_01_script.txt 0 → 100644 +13 −0 Original line number Diff line number Diff line set feedback_to_output true ne load ne.yaml # set logging_config logging_config.yaml # Retreive data from NEs connect netconf --filter-file bridge_filter.xml netconf close-session # Formating data table from_xml --xsl-transform vlans_transform.xsl table concat table to_excel vlans.xlsx scripts/inventory/INV_SRV_01/README.md 0 → 100644 +7 −0 Original line number Diff line number Diff line # INV_PORT_01 The _INV_SRV_01_script.txt_ script should product the list of VLANs using ieee802-dot1q-bridge module ([see on YANG Catalog](https://yangcatalog.org/yang-search/module_details/ieee802-dot1q-bridge@2022-05-19)). ```console $ python3 lncc.py "run_script INV_SRV_01_script.txt" ``` scripts/inventory/INV_SRV_01/bridge_filter.xml 0 → 100644 +4 −0 Original line number Diff line number Diff line <?xml version="1.0"?> <bridges xmlns="urn:ieee:std:802.1Q:yang:ieee802-dot1q-bridge"> <bridge> </bridges> scripts/inventory/INV_SRV_01/vlans_transform.xsl 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <vlans> <xsl:for-each select="nc:data/dot1q:bridges/dot1q:bridge/dot1q:component/dot1q:filtering-database/dot1q:vlan-registration-entry" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:dot1q="urn:ieee:std:802.1Q:yang:ieee802-dot1q-bridge"> <vlan> <!--TODO: Includes additional fields as needed --> <xsl:copy-of select="dot1q:name" /> <xsl:copy-of select="dot1q:vids" /> <xsl:copy-of select="dot1q:entry-type" /> <port-left><xsl:copy-of select="dot1q:port-map[1]/dot1q:port-ref" /></port-left> <port-left-vlan-transmitted><xsl:copy-of select="dot1q:port-map[1]/dot1q:static-vlan-registration-entries/dot1q:vlan-transmitted" /></port-left-vlan-transmitted> <port-left-registrar-admin-control><xsl:copy-of select="dot1q:port-map[1]/dot1q:static-vlan-registration-entries/dot1q:registrar-admin-control" /></port-left-registrar-admin-control> <port-right><xsl:copy-of select="dot1q:port-map[2]/dot1q:port-ref" /></port-right> <port-right-vlan-transmitted><xsl:copy-of select="dot1q:port-map[2]/dot1q:static-vlan-registration-entries/dot1q:vlan-transmitted" /></port-right-vlan-transmitted> <port-right-registrar-admin-control><xsl:copy-of select="dot1q:port-map[2]/dot1q:static-vlan-registration-entries/dot1q:registrar-admin-control" /></port-right-registrar-admin-control> </vlan> </xsl:for-each> </vlans> </xsl:template> </xsl:stylesheet> Loading
scripts/inventory/INV_SRV_01/INV_SRV_01_script.txt 0 → 100644 +13 −0 Original line number Diff line number Diff line set feedback_to_output true ne load ne.yaml # set logging_config logging_config.yaml # Retreive data from NEs connect netconf --filter-file bridge_filter.xml netconf close-session # Formating data table from_xml --xsl-transform vlans_transform.xsl table concat table to_excel vlans.xlsx
scripts/inventory/INV_SRV_01/README.md 0 → 100644 +7 −0 Original line number Diff line number Diff line # INV_PORT_01 The _INV_SRV_01_script.txt_ script should product the list of VLANs using ieee802-dot1q-bridge module ([see on YANG Catalog](https://yangcatalog.org/yang-search/module_details/ieee802-dot1q-bridge@2022-05-19)). ```console $ python3 lncc.py "run_script INV_SRV_01_script.txt" ```
scripts/inventory/INV_SRV_01/bridge_filter.xml 0 → 100644 +4 −0 Original line number Diff line number Diff line <?xml version="1.0"?> <bridges xmlns="urn:ieee:std:802.1Q:yang:ieee802-dot1q-bridge"> <bridge> </bridges>
scripts/inventory/INV_SRV_01/vlans_transform.xsl 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <vlans> <xsl:for-each select="nc:data/dot1q:bridges/dot1q:bridge/dot1q:component/dot1q:filtering-database/dot1q:vlan-registration-entry" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:dot1q="urn:ieee:std:802.1Q:yang:ieee802-dot1q-bridge"> <vlan> <!--TODO: Includes additional fields as needed --> <xsl:copy-of select="dot1q:name" /> <xsl:copy-of select="dot1q:vids" /> <xsl:copy-of select="dot1q:entry-type" /> <port-left><xsl:copy-of select="dot1q:port-map[1]/dot1q:port-ref" /></port-left> <port-left-vlan-transmitted><xsl:copy-of select="dot1q:port-map[1]/dot1q:static-vlan-registration-entries/dot1q:vlan-transmitted" /></port-left-vlan-transmitted> <port-left-registrar-admin-control><xsl:copy-of select="dot1q:port-map[1]/dot1q:static-vlan-registration-entries/dot1q:registrar-admin-control" /></port-left-registrar-admin-control> <port-right><xsl:copy-of select="dot1q:port-map[2]/dot1q:port-ref" /></port-right> <port-right-vlan-transmitted><xsl:copy-of select="dot1q:port-map[2]/dot1q:static-vlan-registration-entries/dot1q:vlan-transmitted" /></port-right-vlan-transmitted> <port-right-registrar-admin-control><xsl:copy-of select="dot1q:port-map[2]/dot1q:static-vlan-registration-entries/dot1q:registrar-admin-control" /></port-right-registrar-admin-control> </vlan> </xsl:for-each> </vlans> </xsl:template> </xsl:stylesheet>