This repository provides practical Python examples demonstrating authentication to SD-WAN Manager and subsequent API interactions. Please note these examples are for demonstration purposes only and not production-ready.
Clone the code to local machine.
git clone https://github.com/jbarozet/python-sdwan.gitInstall uv by running the following command in Terminal:
curl -LsSf https://astral.sh/uv/install.sh | sh
Initialize and install dependancies:
cd python-sdwan
uv venv .venv
source .venv/bin/activate
uv pip install .You need to define the SD-WAN Manager parameters to authenticate.
Example for MacOSX:
export manager_host=10.0.0.100
export manager_port=443
export manager_username=sdwan
export manager_password=mysuperpasswordExample for Windows
set manager_host=10.0.0.100
set manager_port=443
set manager_username=sdwan
set manager_password=mysuperpasswordThe easiest way to run the tool is to provide all the lab variables in a init file and source that file. The example file below contains all the variables required to run all the tasks.
% cat init.sh
export manager_host=10.0.0.100
export manager_port=443
export manager_username=sdwan
export manager_password=mysuperpassword
% source init.shAll tests will save API response payloads in output/payloads folder to easily check the json content.
Refer to: