push scope > Prisma access > remote networks using api (Panorama-managed)

Reply
Highlighted
L0 Member

push scope > Prisma access > remote networks using api (Panorama-managed)

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


Accepted Solutions
Highlighted
L0 Member

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

View solution in original post


All Replies
Highlighted
L2 Linker

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

 

Highlighted
L0 Member

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

View solution in original post

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 Live Community as a whole!

The Live Community thanks you for your participation!