PaloAltoNetworks / pan-os-python

The PAN-OS SDK for Python is a package to help interact with Palo Alto Networks devices (including physical and virtualized Next-generation Firewalls and Panorama). The pan-os-python SDK is object oriented and mimics the traditional interaction with the device via the GUI or CLI/API.
https://pan-os-python.readthedocs.io
ISC License
340 stars 168 forks source link

document how to use delete_similar #498

Open freedge opened 1 year ago

freedge commented 1 year ago

Documentation link

https://pan-os-python.readthedocs.io/en/latest/howto.html#optimize-with-bulk-operations

Describe the problem

doc mentions delete_similar as an alternative to delete to perform bulk delete, but it's not clear how this feature should be used.

if calling fw.remove(obj) on an AddressObject, next call to obj.delete_similar() fails with an exception

No PanDevice set for object tree

Suggested fix

can the documentation include an example of usage of delete_similar ?

welcome-to-palo-alto-networks[bot] commented 1 year ago

:tada: Thanks for opening your first issue here! Welcome to the community!

AnthoBalitrand commented 1 year ago

Hi, @freedge were you able to find some details about it ? I'm looking for a way to bulk-delete huge amounts of objects (which actually takes a very long time with unit API calls), but I don't really understand if delete_similar is the right way to proceed, neither how to use it.