pan-python - How to add an address group to a policy

Reply
L4 Transporter

pan-python - How to add an address group to a policy

I would like to add/change the destination address group in a policy. 

xpath=/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='testDG']/pre-rulebase/security/rules/entry[@name='Allow_FTP']/destination

element=<destination><member>test_addr</member></destination>

Can you please show me how to achieve this via panxapi.py ?   I couldn't find examples/documentation to achieve this.

Thanks,

Krishna

L3 Networker

Re: pan-python - How to add an address group to a policy

If you want to "replace" the 'destination' node, which I think is what

you are trying to do, use edit (-e) with that xpath and element and

it should work.

There is an example in panxapi.html 'Edit the application of a

security rule.' which covers a very similar case.

An area not explained in the XML API documentation is: what is the

difference between set and edit?  I cover this a little in

pan.xapi.html and in more detail in some of my API training.

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!