-
Book Overview & Buying
-
Table Of Contents
Python Network Programming Techniques
By :
Now that we have seen how to set up our Python scripts to be able to connect to a network device using RESTCONF and how to carry out some basic information retrieval using RESTCONF, we can now go ahead and configure a service. The final three recipes in this chapter, Creating a VLAN using RESTCONF and requests, Updating a VLAN using RESTCONF and requests, and Deleting a VLAN using RESTCONF and requests, show how to use a YANG module to do typical administrative work such as creating, changing, and then deleting a device configuration.
Let's go ahead and first use RESTCONF and requests to create a new VLAN configuration.
Open your code editor and start by creating a file called create_vlan.py. Next, navigate in your terminal to the same directory in which you just created the create_vlan.py file.
Follow these steps to use RESTCONF and requests to create a new VLAN: