18. edit config using jinja2 template in restconf protocol
The course can be purchased via the online shop.
In the previous sections we have configured network devices using json payload sent through requests python library in restconf protocol.
But probably the easiest way to keep the configuration data is in yaml format. Then the Python “load_yaml” from “nornir utils” library has the option to automatically change yaml to json before sending it to the network devices.
This is what we are going to demonstrate in this section.
Starting in this section, we will receive and send configuration to and from network devices using the restconf protocol implemented with Python scripts.
In this section we will use a simple Python “request” library to communicate with network devices, but from the next section we will use the inventory management and multi-threading capability of the Python Nornir plugin.
Table of Contents Jinja2 Template in netconf help us separate network device configurations from automation script. Jinja2 Template is a common configuration template for many network devices, in which in its simplest form, data from network devices are replaced with variables. When applying the configuration template to network devices, variables in the configuration template are…
Details