Join the Conversation

To sign in, use your existing MySonicWall account. To create a free MySonicWall account click "Register".

Python Utility to ADD, UPDATE, DELETE Address Objects and Service Objects via Gen7 API calls

MustafaAMustafaA SonicWall Employee
edited February 2023 in Developer Hub

-Feel free to use this Python utility, if it helps.

-It is compatible with SonicOS 7.x

-Modifications are required to be compatible with SonicOS 6.5.x

-It facilitates to ADD, UPDATE, DELETE Address Objects and Service Objects via SonicOS API calls.

-All you need is to populate the aoList and the soList

-This is not an official SonicWall utility, rather it is my contribution to the SonicWall Community.

https://github.com/mustafaaltinkaya/sonicAPI-address-and-service-objects-utility

Address Objects

  • The available operations are UPDATE, ADD, DELETE
  • The available Address Objects types are HOST, RANGE, NETWORK, FQDN

Service Objects

  • The available operations are UPDATE, ADD, DELETE
  • The available Service Objects types are TCP, UDP

Examples:

aoList = [

["UPDATE", AddressObjectClass(aoName="ao-test1", aoZone="LAN", aoType="host", aoIPaddress="200.200.200.111")],

["ADD", AddressObjectClass(aoName="ao-test2", aoZone="LAN", aoType="range", aoIPaddressStart="200.200.200.100", aoIPaddressEnd="200.200.200.200")],

["DELETE", AddressObjectClass(aoName="ao-test3", aoZone="LAN", aoType="fqdn", aoDomain="api.google.com")]


]

soList = [

["ADD", ServiceObjectClass(soName="so-test1", soType="tcp", soPortStart=8121, soPortEnd=8121)],

["UPDATE", ServiceObjectClass(soName="so-test2", soType="udp", soPortStart=4433, soPortEnd=4433)],

["DELETE", ServiceObjectClass(soName="so-test3", soType="tcp", soPortStart=8080, soPortEnd=8080)]

]

Category: Developer Hub
Reply
Sign In or Register to comment.