SonicOS API with python3
Tytec Newbie ✭
Is anyone using python to talk with the SonicOS API? If so, what modules and tips would you be able to share? Thanks in advance!
Category: Developer Hub
Jaime SonicWall Employee
Here's an example script to help get you started.
This example script can mass-edit site to site and tunnel interface VPN policies to automate a change to multiple policies. You'll see how to authenticate, pull down current configuration, edit, and push changes back & commit via SonicOS API.
Hope this helps.0
Hey! You will be signed out in 60 seconds due to inactivity. Click here to continue using the site.
The python request module should be fine. You can use postman to learn the API and then convert the code into python until you get familiar with it.
Thanks MASTERROSHI, I will definitely try that. I have been using #curl from the terminal trying to get familiar with the syntax.
May I know what is the firewall url used for OS7?
I can get resp 200 with OK OS6.5 but only resp 400&404 for OS7.
The URI path is the same for SonicOS 7.0 (/api/sonicos/auth). Try enabling HTTP Basic Access Authentication in the SonicOS API settings on DEVICE | Settings > Administration.