Hi All, I'm trying to create a shared address object using panos.panorama. However I'm not able to proceed with pushing the configuration to the firewalls. I could create objects within device groups and push them successfully to the firewalls under the device group, but I haven't been successful with shared yet. Below is my code.
from panos.panorama import Panorama from panos.objects import AddressObject if __name__ == "__main__": panorama = "10.0.0.1" username = "USERNAME" password = "PASSWORD" pano = Panorama(panorama,username, password) obj = AddressObject("Sample_Shared_Object", "220.127.116.11") pano.add(obj) obj.create() pano.commit_all(sync=True, sync_all=True)
I'm getting the error on line pano.commit_all(sync=True, sync_all=True)
Exception has occurred: PanDeviceXapiError commit-all is missing 'commit-all' pan.xapi.PanXapiError: commit-all is missing 'commit-all' During handling of the above exception, another exception occurred: File "C:\palo_alto_python_panos_scripts\Address_Objects\createAddressObjectInShared.py", line 47, in <module> pano.commit_all(sync=True, sync_all=True) panos.errors.PanDeviceXapiError: commit-all is missing 'commit-all'
I read about the method panorama.PanoramaCommitAll() where you could define the device groups where it will be pushed. However what I'm trying to do is to push on shared only. Does anyone know a solution to push Shared via panos.panorama? Thanks.
Tried a workaround to only apply the commit and push to device groups.
I obtained the list of device groups via rest api, then crafted a function/method that would only select the device groups with firewalls under them. The reason for doing that is because the commit and push via panos did not work when I tried on parent device groups.
There might be a better approach, I just haven't spent time trying to push to a parent device group successfully.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!