- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
10-24-2023 12:57 AM
Hi all,
I am trying to develop a proof-of-concept script, where our SOC will push an a shared address object to Panorama, with a tag "SOC_IDENT_HIGHRISK". These objects will then be dynamically added to a security group to which block rules are applied.
The issue I am having is with the final step "push to devices", referred to as "commit-all" on the API. The object gets created and I can watch the Panorama commit complete.
I use the following Python to try and do the commit-all:
10-25-2023 07:00 PM - edited 10-26-2023 03:24 AM
Hi @DanParker ,
You are correct that the configuration 'commit' command commits to Panorama, and the operational 'commit-all' command pushes to devices. The solution to this discussion confirms this -> https://live.paloaltonetworks.com/t5/automation-api-discussions/trying-to-do-commit-and-then-push-fr....
What is interesting is that for 'commit-all' you have to specify the device-group or template/template-stack. I cannot find an option to push all. That lines up with this doc -> https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000ClqeCAC.
What I am saying is this: The XML API lines up with the CLI. If the CLI requires a parameter, the XML API does also. Your error is equivalent to 'invalid syntax' on the CLI. The good news is that you can run the 'cli debug on' command to give you the URL syntax needed when you run a CLI command. (It does not work for GUI operations.) https://docs.paloaltonetworks.com/pan-os/9-1/pan-os-panorama-api/get-started-with-the-pan-os-xml-api... I have heard the debug goes way when the session is closed.
So, you can run the 'commit-all' commands from the CLI with 'debug cli on' and get the XML syntax you need. You will have to do it for every device-group and template-stack. The 'include-template' may save you some steps.
Thanks,
Tom
Edit: I just saw this -> https://pan.dev/ansible/docs/panos/guides/panorama-push/.
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!