Revisiting the NETCONF and YANG modules
Before jumping straight into the Python code, let's revisit how NETCONF works and how we use YANG modules to describe the data model used to retrieve or modify our device configuration. At its core, NETCONF works by sending operations, which are described in eXtended Markup Language (XML), to a device. The device then carries out that operation and returns information.
The core operations defined by the NETCONF protocol are as follows:
<get>
: This is used to retrieve information about the state of a device.<get-config>
: This is used to retrieve an entire configuration (for example, the entire running configuration of your device).<edit-config>
: This is used to edit a configuration (for example, to change the entire running configuration on your device). Here, edit can refer to creating, deleting, or combining configuration variables.<copy-config>
: This is used to copy from one configuration...