- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
02-02-2022 04:25 AM
Hello Guys, I'm dealing with automation project where saome sec. policies must be applied through Panorama. I'm using Terraform provider which does not support commit.
My idea was to commit and push changes made by specific admin account used for automation. (this is what can be manually done form Panorama GUI by using: "Commit and Push" + selected "Commit Changes Made By: ()".
Unfortunatelly I can't find any way to reproduce such an action by API ?!
Any ideas how to do it? Or any other approach to commits to avoid mess?
thanks in advance for your help!
02-02-2022 08:03 AM
Does this work for you?
https://{{host}}/api/?key={{key}}&type=commit&action=all&cmd=<commit-all><shared-policy><admin><member>{{admin}}</member></admin><device-group><entry name="{{device-group-name}}"/></device-group></shared-policy></commit-all>
02-02-2022 11:27 AM
<response status="error" code="17"> <msg> <line> <![CDATA[ commit-all -> shared-policy -> admin unexpected here]]> </line> <line> <![CDATA[ commit-all -> shared-policy is unexpected ]]> </line> <line> <![CDATA[ commit-all is unexpected ]]> </line> </msg> </response>
commit all unfortunatelly does not accept all those parameters
02-02-2022 01:05 PM
Yeah, looks like this one isn't available via XML API. This is what the GUI does:
https://{{host}}/api/?key={{key}}&type=commit&action=all&cmd=<commit-and-push><partial><admin><member>{{admin}}</member></admin><device-group><member>{{device-group-name}}</member></device-group></partial></commit-and-push>
I guess the other approach is to incorporate locks to your Terraform automation; lock, perform changes, commit, unlock. If lock can't be acquired or other admins are logged in, don't allow Terraform to proceed so it does not try to commit other admins' potentially half-completed changes.
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!