- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
03-06-2020 06:59 AM - edited 03-06-2020 07:54 AM
Hi,
I am writing a script in python using pan-python module to automate Prisma Access onboarding. I can create all kinds configurations and commit changes to Panorama, but I can't seem to find "push to devices" for Prisma access in the API, which is the main purpose of this automation!
Has anyone done it before or have an idea on how to push to Prisma with API?
try:
xapi.commit(cmd="<commit-all></commit-all>", action=all, sync=False, interval=None, timeout=None)
except pan.xapi.PanXapiError as msg:
print('commit: ', msg, file=sys.stderr)
sys.exit(1)
Cheers,
S
03-18-2020 07:19 AM
Hi Nate,
Thanks for your answer! I already found a solution.
Your code is almost correct. The cmd=<commit-all>...</commit-all> would NOT work. The action should be set to all and the cmd should be <commit>...</commit>
Thanks,
S
03-18-2020 06:51 AM
Hi there S,
Please try this:
self.xapi.commit(action='all',
cmd='<commit-all><shared-policy><device-group>'
'<entry name="Remote_Network_Device_Group"/>'
'</device-group></shared-policy></commit-all>')
Note, this was last tested with GPCS about a year ago, and there have been some changes, so I'm not 100% sure this will work as-is for you. Good luck and let us know if this works for you.
HTH,
Nate
03-18-2020 07:19 AM
Hi Nate,
Thanks for your answer! I already found a solution.
Your code is almost correct. The cmd=<commit-all>...</commit-all> would NOT work. The action should be set to all and the cmd should be <commit>...</commit>
Thanks,
S
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!