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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Please sign in to see details of an important advisory in our Customer Advisories area.

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

L4 Transporter

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

1 REPLY 1

L3 Networker

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.

  • 2074 Views
  • 1 replies
  • 0 Likes
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!