Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

New Lesson: NETCONF and XPath #278

Open
thejhead opened this issue Dec 2, 2019 · 4 comments
Open

New Lesson: NETCONF and XPath #278

thejhead opened this issue Dec 2, 2019 · 4 comments

Comments

@thejhead
Copy link

thejhead commented Dec 2, 2019

I think most engineers that start with automation begin by doing the typical screen scraping with tools libraries like paramiko, which is a bit more straightforward compared to NETCONF based interaction. The added complexity that isn't immediately obvious to new learners.

I'd like to develop a new lesson that covers the following:

  1. What is NETCONF - Here I would have an overview of the protocol, reference the PyEZ lesson, and include the simple "system" hierarchy configuration statements for completeness.
  2. Anatomy of an RPC Request - here I would outline how RPC differs from CLI and some of the differences (e.g. why you cannot use pipe based modifiers)
  3. Anatomy of an RPC Reply - here I would discuss the primary node types, i.e. element, attribute, etc.
  4. Building RPC Requests - I would expand on the item covered in the PyEZ lesson regarding how to make RPC calls with additional flags such as verbosity level or a specific interface like item. In addition I would outline challenge/caveats as RPC's cannot be made to use | (pipe) modifiers, and for large CLI outputs you must made
  5. How to Parse RPC Replies - here I would provide multiple examples of XPath filters, these do not need to be very complex as they would be something they can copy/paste/adapt for their own purposes.
  6. Where does this apply - With NETCONF being standard, in addition to what was already covered, I would make brief examples/mentions to JSNAPy, Ansible, and On-Box scripts (both python and SLAX)
@thejhead thejhead changed the title New Lesson: NETCONF and XPATH New Lesson: NETCONF and XPath Dec 2, 2019
@Mierdin
Copy link
Member

Mierdin commented Dec 14, 2019

This looks great, but how will this be interactive? Will the learner be leveraging ncclient directly, or something else?

@thejhead
Copy link
Author

thejhead commented Dec 16, 2019

It will be interactive by giving the learner sample show commands and instruct them to extract specific data from the XML output using PyEZ (and the associated XML libraries). The learner will be responsible for determining the appropriate RPC (with vMX/vQFX as an option to help) and finally a working XPath that extracts the necessary node(s) (with slightly increasing complexity). Ideally, the validation will be somewhat dynamic so that we don't strictly expect 1 or 2 exact XPath expressions.

@Mierdin
Copy link
Member

Mierdin commented Dec 18, 2019

Okay, this sounds like a lesson on NETCONF within the context of Junos. Which is fine, but I think its worth calling out. Or perhaps spending some time on fundamental NETCONF concepts outside of either Junos or PyEZ would be good (and way less served by the existing PyEZ lesson, FWIW)

@thejhead
Copy link
Author

I think that's a great idea, I'll incorporate vendor-agnostic NETCONF fundamentals as part of the lesson. This would be best applied to 1, 2, and 3 of my proposed lesson plan, it actually would make a couple of other sections clearer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants