In my last blog post, SD-WAN API Documents, we shined a spotlight on the new documentation and resources now available for Cisco SD-WAN on DevNet . In this blog, let’s take a look at the new Cisco SD-WAN SDK.
What is a Software Development Kit (SDK)?
Put simply this is a set of tools, libraries, and documentation to simplify interacting with a REST API. The Cisco SD-WAN Python SDK is a Python-based SDK for Cisco vManage. The SDK is intended for anybody interested in automating the configuration and operation of Cisco SD-WAN deployments using Python.
What can you do with the SDK?
The SDK enables configuration and operations of Cisco vManage via Python-based API bindings. In a traditional SD-WAN deployment, nearly all management of the SD-WAN control plane and overlay of VPNs and edge devices is done via the Cisco vManage GUI. The SDK allows automation of vManage via Python without any GUI interaction. The following examples illustrate some of the benefits of interacting with Cisco vManage programmatically.
- Integration with other platforms
- Basic management of policy or device/feature templates
So, let’s get started:
Installing the Cisco SD-WAN SDK
The Cisco SD-WAN SDK is available via PyPI, so all that is required is “pip install”. It is also recommended to use a virtual environment.
You are now able to use the SDK. The SDK has a great help function built-in too, just in case you find yourself stuck.
Using the Cisco SD-WAN SDK
In this example, we can use the Always-On DevNet SD-WAN Sandbox. First we set credentials as environment variables from the sandbox supplying valid values for the following variables:
Next, open your python shell, in this example, I am using python. Create an authentication object and call the login function. Once you are authenticated to Cisco vManage, make API calls by creating an instance of the API object you are interested in (e.g. Device, Settings, Local Policy, etc.) and calling the functions from that object. The example below retrieves a list of all devices on the DevNet SD-WAN sandbox.
You can also get the source code, as the SDK is developed as a community project on GitHub. To get the source code go to DevNet Code Exchange.You can then install the package to your environment for development purposes:
You can find all the new SD-WAN SDK documentation here Python SD-WAN SDK Overview a huge thanks goes to the ‘ SD-WAN Super Team’ for their continued work on this project.
If you have any feedback let me know in the comments section below — leave me a message, ask me a question, whatever you want.
- SD-WAN APIs — See how to streamline workflows, deploy and manage devices, and enhance application experience while developing with SD-WAN.
- Learn more about network programming and Cisco networking platforms
- See how to earn Cisco DevNet certifications