Creating a VLAN using RESTCONF and requests
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.
Getting ready
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.
How to do it…
Follow these steps to use RESTCONF and requests
to create a new VLAN:
- Import the...