Skip to content

Commit

Permalink
fixes to N2G templates, added list_templates method, bump to version …
Browse files Browse the repository at this point in the history
…0.3.0
  • Loading branch information
dmulyalin committed Jul 3, 2022
1 parent d18bbce commit 0832697
Show file tree
Hide file tree
Showing 47 changed files with 406 additions and 127 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

---

**Templates count: 55**
**Templates count: 54**

---

Expand Down
10 changes: 10 additions & 0 deletions docs/ttp_templates/misc.N2G.cli_ip_data.a10.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ Template to parse A10 devices interfaces configuration and IP ARP cache.
Template to parse A10 devices interfaces configuration and IP ARP cache.
</doc>
<input load="python">
commands = [
"show running-config",
"show arp all",
]
kwargs = {"strip_prompt": False}
method = "send_command"
platform = ["a10"]
</input>
<vars>local_hostname="gethostname"</vars>
<!-- Interfaces configuration group -->
Expand Down
10 changes: 10 additions & 0 deletions docs/ttp_templates/misc.N2G.cli_ip_data.cisco_ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ Template to parse Cisco IOS interfaces configuration and ARP cache.
Template to parse Cisco IOS interfaces configuration and ARP cache.
</doc>
<input load="python">
commands = [
"show running-config",
"show ip arp",
]
kwargs = {"strip_prompt": False}
method = "send_command"
platform = ["cisco_ios"]
</input>
<vars>local_hostname="gethostname"</vars>
<!-- Interfaces configuration group -->
Expand Down
10 changes: 10 additions & 0 deletions docs/ttp_templates/misc.N2G.cli_ip_data.cisco_nxos.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ Template to parse Cisco NXOS interfaces configuration and ARP cache.
Template to parse Cisco NXOS interfaces configuration and ARP cache.
</doc>
<input load="python">
commands = [
"show running-config",
"show ip arp",
]
kwargs = {"strip_prompt": False}
method = "send_command"
platform = ["nxos_ssh", "cisco_nxos"]
</input>
<vars>local_hostname="gethostname"</vars>
<!-- Interfaces configuration group -->
Expand Down
12 changes: 12 additions & 0 deletions docs/ttp_templates/misc.N2G.cli_ip_data.cisco_xr.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ Template to parse Cisco IOSXR interfaces configuration and ARP cache.
Template to parse Cisco IOSXR interfaces configuration and ARP cache.
</doc>
<input load="python">
commands = [
"show running-config interface",
"show arp vrf all",
"show arp"
]
kwargs = {"strip_prompt": False}
method = "send_command"
platform = ["cisco_xr"]
</input>
<vars>local_hostname="gethostname"</vars>
<group record="local_hostname" void="">
Expand All @@ -35,6 +46,7 @@ interface {{ interface | resuball("IfsNormalize") }}
<group name="ip_addresses*" chain="add_network()" method="table">
ipv4 address {{ ip | IP }} {{ netmask }}
ipv4 address {{ ip | IP }} {{ netmask }} secondary
ipv4 address {{ ip | IP }}/{{ netmask }}
</group>
! {{ _end_ }}
</group>
Expand Down
10 changes: 10 additions & 0 deletions docs/ttp_templates/misc.N2G.cli_ip_data.fortinet.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ Template to parse Fortinet fortigate firewalls interfaces configuration and ARP
Template to parse Fortinet fortigate firewalls interfaces configuration and ARP cache.
</doc>
<input load="python">
commands = [
"get system config",
"get system arp",
]
kwargs = {"strip_prompt": False}
method = "send_command"
platform = ["fortinet"]
</input>
<vars>local_hostname="gethostname"</vars>
<!-- Interfaces configuration group -->
Expand Down
10 changes: 10 additions & 0 deletions docs/ttp_templates/misc.N2G.cli_ip_data.huawei.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ Template to parse Huawei interfaces configuration and ARP cache.
Template to parse Huawei interfaces configuration and ARP cache.
</doc>
<input load="python">
commands = [
"display current-configuration interface",
"display arp all",
]
kwargs = {"strip_prompt": False}
method = "send_command"
platform = ["huawei", "huawei_vrpv8"]
</input>
<vars>local_hostname="gethostname"</vars>
<!-- Interfaces configuration group -->
Expand Down
1 change: 1 addition & 0 deletions docs/ttp_templates/misc.N2G.cli_isis_data.cisco_xr.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Template to parse Cisco IOSXR "show isis database verbose" output.
commands = [
"show isis database verbose",
]
platform = ["cisco_xr"]
</input>
<extend template="ttp://platform/cisco_xr_show_isis_database_verbose.txt"/>
Expand Down
2 changes: 1 addition & 1 deletion docs/ttp_templates/misc.N2G.cli_isis_data.juniper.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ Template to parse Juniper JunOS "show isis database extensive | no-more" output.
</doc>
<input load="python">
# Starting with Netmiko 3.4.0 can use run_ttp method to populate this template with below commands output
commands = [
"show isis database extensive | no-more",
]
platform = ["juniper", "juniper_junos"]
</input>
<extend template="ttp://platform/juniper_show_isis_database_verbose_pipe_no_more.txt"/>
Expand Down
12 changes: 12 additions & 0 deletions docs/ttp_templates/misc.N2G.cli_l2_data.cisco_ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ This template designed to parse Cisco IOS configuration and CDP and LLDP neighbo
This template designed to parse Cisco IOS configuration and CDP and LLDP neighbors.
</doc>
<input load="python">
commands = [
"show cdp neighbor details",
"show lldp neighbor details",
"show running-config",
"show interface",
]
kwargs = {"strip_prompt": False}
method = "send_command"
platform = ["cisco_ios"]
</input>
<vars>local_hostname="gethostname"</vars>
<macro>
Expand Down
12 changes: 12 additions & 0 deletions docs/ttp_templates/misc.N2G.cli_l2_data.cisco_nxos.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ This template designed to parse Cisco NXOS configuration and CDP and LLDP neighb
This template designed to parse Cisco NXOS configuration and CDP and LLDP neighbors.
</doc>
<input load="python">
commands = [
"show cdp neighbor details",
"show lldp neighbor details",
"show running-config",
"show interface",
]
kwargs = {"strip_prompt": False}
method = "send_command"
platform = ["nxos_ssh", "cisco_nxos"]
</input>
<vars>local_hostname="gethostname"</vars>
<macro>
Expand Down
13 changes: 13 additions & 0 deletions docs/ttp_templates/misc.N2G.cli_l2_data.cisco_xr.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ Commands parsed:
- show interfaces - to extract interface state to add all connected nodes
</doc>
<input load="python">
commands = [
"show cdp neighbor details",
"show lldp neighbor details",
"show lldp",
"show running-config interface",
"show interfaces",
]
kwargs = {"strip_prompt": False}
method = "send_command"
platform = ["cisco_xr"]
</input>
<!-- gethostname used if no show lldp output provided -->
<vars>local_hostname="gethostname"</vars>
Expand Down
11 changes: 11 additions & 0 deletions docs/ttp_templates/misc.N2G.cli_l2_data.huawei.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ This template designed to parse Huawei configuration and LLDP neighbors.
This template designed to parse Huawei configuration and LLDP neighbors.
</doc>
<input load="python">
commands = [
"display lldp neighbor details",
"display current-configuration interface",
"display interface",
]
kwargs = {"strip_prompt": False}
method = "send_command"
platform = ["huawei", "huawei_vrpv8"]
</input>
<vars>local_hostname="gethostname"</vars>
<macro>
Expand Down
5 changes: 3 additions & 2 deletions docs/ttp_templates/misc.N2G.cli_l2_data.juniper.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ Commands parsed:
<input>
commands = [
"show lldp local-information",
"show lldp neighbors",
"show lldp local-information | no-more",
"show lldp neighbors | no-more",
"show configuration interfaces | display set | no-more",
"show interfaces detail | no-more",
]
platform = ["juniper", "juniper_junos"]
</input>
<!-- gethostname used if no show lldp output provided -->
Expand Down
2 changes: 1 addition & 1 deletion docs/ttp_templates/misc.N2G.cli_ospf_data.cisco_ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ Template to parse Cisco IOS OSPF database content.
</doc>
<input load="python">
# Starting with Netmiko 3.4.0 can use run_ttp method to populate this template with below commands output
commands = [
"show ip ospf database router",
"show ip ospf database summary",
"show ip ospf database external",
]
kwargs = {"strip_prompt": False}
method = "send_command"
platform = ["cisco_ios"]
</input>
<extend template="ttp://platform/cisco_ios_show_ip_ospf_database_router.txt"/>
Expand Down
2 changes: 1 addition & 1 deletion docs/ttp_templates/misc.N2G.cli_ospf_data.cisco_xr.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ Template to parse Cisco IOSXR OSPF database content.
</doc>
<input load="python">
# Starting with Netmiko 3.4.0 can use run_ttp method to populate this template with below commands output
commands = [
"show ospf database router",
"show ospf database summary",
"show ospf database external",
]
kwargs = {"strip_prompt": False}
method = "send_command"
platform = ["cisco_xr"]
</input>
<extend template="ttp://platform/cisco_xr_show_ospf_database_router.txt"/>
Expand Down
2 changes: 1 addition & 1 deletion docs/ttp_templates/misc.N2G.cli_ospf_data.huawei.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ Template to parse Huawei devices OSPF database content.
</doc>
<input load="python">
# Starting with Netmiko 3.4.0 can use run_ttp method to populate this template with below commands output
commands = [
"display ospf lsdb router",
]
kwargs = {"strip_prompt": False}
method = "send_command"
platform = ["huawei", "huawei_vrpv8"]
</input>
<extend template="ttp://platform/huawei_display_ospf_lsdb_router.txt"/>
Expand Down
2 changes: 1 addition & 1 deletion docs/ttp_templates/misc.Netmiko.cisco.ios.cfg.bgp.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ pprint.pprint(res)
<input>
commands = [
"show running-configuration | section bgp"
"show running-config | section bgp"
]
</input>
Expand Down
2 changes: 1 addition & 1 deletion docs/ttp_templates/misc.Netmiko.cisco.ios.cfg.ip.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pprint.pprint(res)
<input>
commands = [
"show running-configuration | section interface"
"show running-config | section interface"
]
# need to keep prompt for "gethostname" to work
kwargs = {
Expand Down
2 changes: 1 addition & 1 deletion docs/ttp_templates/yang.ietf-interfaces_cisco_ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def add_iftype(data):
<input>
commands = [
"show running-configuration | section interface",
"show running-config | section interface",
"show interface"
]
</input>
Expand Down
2 changes: 0 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ nav:
- ttp_templates_tests:
- cisco_ios_interfaces_cfg_per_ip: ttp_templates/misc.ttp_templates_tests.cisco_ios_interfaces_cfg_per_ip.md
- netmiko_cisco_ios_interfaces: ttp_templates/misc.ttp_templates_tests.netmiko_cisco_ios_interfaces.md
- vars:
- short_interface_names: ttp_templates/misc.vars.short_interface_names.md
- Platform:
- arista_eos_show_hostname: ttp_templates/platform.arista_eos_show_hostname.md
- cisco_ios_show_ip_arp: ttp_templates/platform.cisco_ios_show_ip_arp.md
Expand Down
Loading

0 comments on commit 0832697

Please sign in to comment.