-
Notifications
You must be signed in to change notification settings - Fork 747
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
Add TTP for even more difficult templates #1716
Comments
Hello @evilmonkey19 , Would you please further explain where there's a variable nested inside another? Thank you. |
In this case the output would something as follows: [{
"tcont_id": 4,
"dba_profile_id": 5,
"gem": {
"gem_index": 126,
"srv_type": "eth",
"encrypt": "off",
"cascade": "off",
"gem-car": "",
"upstream-priority-queue": "",
"downstream-priority-queue": "",
"vlans": [{
"mapping_index": 0,
"vlan": 500,
"priority": "",
"port_type": "",
"port_id": "",
"bundle_car": "",
"flow": "",
"transparent": "",
}]
}
},
{
"tcont_id": 5,
"dba_profile_id": 5,
"gem": {
"gem_index": 126,
"srv_type": "eth",
"encrypt": "off",
"cascade": "off",
"gem-car": "",
"upstream-priority-queue": "",
"downstream-priority-queue": "",
"vlans": [{
"mapping_index": 0,
"vlan": 500,
"priority": "",
"port_type": "",
"port_id": "",
"bundle_car": "",
"flow": "",
"transparent": "",
}]
}
}] In this case you can see the nesting of the VLAN inside the GEM and the GEM inside the T-CONT. One T-CONT may have also multiple GEMs. Currently, it is possible to have this level of complexity using a TTP parser. As I said before, I know that this case is pretty niche, but I have several devices similar nested outputs. |
@evilmonkey19 I understand your interest in having a more flexible output format, and that TextFSM is not able to provide that, however, we are not interested in taking on that additional work of maintaining TTP templates on top of what is being maintained here. For the issue that you have described above, I would say that you can restructure the output in post-processing. |
I agree on the fact that it might be a burden for the project developing, testing and maintaining this feature. May I ask at least to put it as a possible solution the postprocessing for even more complex outputs using TTP? I was thinking somewhere like a FAQs, just to let beginners know what is possible and what not using TextFSM and NTC-Templates. |
In your example output, "gem" is a dictionary
So what's being suggested is the NTC Templates project create a FAQ section to inform the community the existence of TTP, Genie, ciscoconfparse, ciscoconfparse2, etc (any I've missed)? Though there already is a repo dedicated to documenting automation projects that @evilmonkey19 added updates to last month. 😀 (I have no final say in this as a community voluneer, but) Would it be sufficient to possibly have ntc-templates docs link to the Awesome Network Automation repo which links out to other projects? |
IMHO, what @mjbear suggested is even a better idea. NTC-templates is a great project for newcomers, therefore I think is worth it to point to the Awesome Network Automation repo 😄 . |
Cool 😎 This may be something that could be added to Example:
Once we get a consensus I can pull together a PR. Thoughts? |
I like it in the README.md file 💫 |
@evilmonkey19 |
Environment
Proposed Functionality
In some edge cases, TextFSM is not enough for capturing all the needed variables. For example, if a variable is nested inside another, then TextFSM cannot capture that. In such cases i suggest to use TTP as extra backup parser. This way it is possible to get more complex outputs.
Use Case
This is the case in the
display ont info 0 1 2 3
in Huawei smartax in this lines:The text was updated successfully, but these errors were encountered: