Updating a VLAN using RESTCONF and requests
Now that we have programmatically created a part of our device configuration using RESTCONF (see the Creating a VLAN using RESTCONF and requests recipe), let's request it this time for the next step. Using RESTCONF and the PATCH
method, we can use a similar data structure to what we have seen when creating the configuration initially, to change the configuration that we previously created.
Let's go ahead and change our previously created VLAN on our interface using RESTCONF and requests
.
Getting ready
Open your code editor and start by creating a file called change_vlan.py
. Next, navigate in your terminal to the same directory in which you just created the change_vlan.py
file.
How to do it…
Follow these steps to define the necessary information to change a previously created VLAN:
- Import the required modules and set up a
requests
session that can interact with the device. We will also import the prettyprint...