Creation of App-Id though XML Api

Reply
Highlighted
L0 Member

Creation of App-Id though XML Api

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 ?

 

 


Accepted Solutions
Highlighted
L4 Transporter

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

 

View solution in original post


All Replies
Highlighted
L4 Transporter

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

 

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!