Creation of App-Id though XML Api

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creation of App-Id though XML Api

L0 Member

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 ?

 

 

1 accepted solution

Accepted Solutions

L5 Sessionator

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

1 REPLY 1

L5 Sessionator

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

 

  • 1 accepted solution
  • 2652 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!