@ktbyers do you have any views on the solution for this already?
I am keen to contribute back but would be keen to hear your thoughts on below
Would you be open to having another "index" file to match commands against templates (similar to that of ntc-templates) within netmiko ?
Couple of solution idea here:
ttp/ folder where filenames are $netmiko_driver_prefix_$command.ttp (the filename is then used to map to driver and command dynamically, though would only work for exact matches)With no "ntc-templates" equivalent template repo for ttp templates yet, would you just provide an empty place to load templates OR try and build a template repo within the netmiko project?
I have only looked at TTP a minimal amount.
With TTP is there any existing repository of templates (similar to ntc-templates or Genie)? From your above statements, it sounds like no.
I would be interested in there being a template repository, but I don't want to maintain it.
Maybe we can circle in the TTP maintainers and people that are active there and see if there is any interest in making a repository like this?
Yeah, my first thought (for how to build a template repository) would just be to copy the index idea from TextFSM/CLItable and reuse that (maybe even can use the same code or very similar code). Though probably consider writing the index in YAML.
If there is no template repository for TTP, then I would try to make it easy for Netmiko to bind to TTP for show command output, so something like:
output = net_connect.send_command(command, use_ttp=True, ttp_template="my_template.ttp")
Have started working on #1962 which is almost complete, to implement basic functionality for this option
output = net_connect.send_command(command, use_ttp=True, ttp_template="my_template.ttp")
Do you want to vendor ttp or just have it as an optional extra similar to genie?
(There seems to be a lot going on in TTP so I'm leaning towards an add on)
Yeah, I wouldn't want to vendor it so either a separate requirements-ttp.txt like I did for Genie. I only did that for TextFSM as TextFSM library broke (and still breaks Windows).
It looks your PR vendorred it which freaked me out at first :-)
Regards, Kirk
Np, yeah i actually did it both ways heh, will remove the vendored stuff tonight
Sounds good.
plz close meh