commit and push changes made by automation job (Panorama, Terraform)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

commit and push changes made by automation job (Panorama, Terraform)

L0 Member

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!

 

3 REPLIES 3

L5 Sessionator

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>

 

Help the community: "Like" helpful comments, and click "Accept as Solution" if you found your answer 🙂

<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

L5 Sessionator

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.

Help the community: "Like" helpful comments, and click "Accept as Solution" if you found your answer 🙂
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!