- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
12-18-2019 08:38 AM
Hi Guys I am trying to create a App Id though xml api. I looked at the request though Debug Console:
<request cmd="set" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/application/entry[@name='test2']" cookie="3920960267560155" newonly="yes">
<default>
<ident-by-ip-protocol>12</ident-by-ip-protocol>
</default>
<subcategory>infrastructure</subcategory>
<category>networking</category>
<technology>client-server</technology>
<description>testing puirposes</description>
<risk>5</risk>
</request>
https://firewall/api/?type=set&cmd=<default>
<ident-by-ip-protocol>12</ident-by-ip-protocol>
</default>
<subcategory>infrastructure</subcategory>
<category>networking</category>
<technology>client-server</technology>
<description>testing puirposes</description>
<risk>5</risk>&key=apikey
Where does the object comes into play ? Where should we include that ?
01-02-2020 08:59 AM
Using the /debug to see what the GUI does gets you part of the way, but it's not a direct 1-to-1 what you need to send / do.
type=config
action=set
xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/application/entry[@name='test2']
element=<entry name="test2">(WHAT YOU HAVE AS cmd HERE)</entry>
I would highly recommend using either of the libraries that Palo Alto Networks has for working with the API if you want to get serious with the PAN-OS API:
python: pandevice
golang: pango
01-02-2020 08:59 AM
Using the /debug to see what the GUI does gets you part of the way, but it's not a direct 1-to-1 what you need to send / do.
type=config
action=set
xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/application/entry[@name='test2']
element=<entry name="test2">(WHAT YOU HAVE AS cmd HERE)</entry>
I would highly recommend using either of the libraries that Palo Alto Networks has for working with the API if you want to get serious with the PAN-OS API:
python: pandevice
golang: pango
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!