application filter (and groups) with PanRest API

Reply
andrei_feldman
Not applicable

application filter (and groups) with PanRest API

Hi all,

I'm trying to retrieve applcation filters and groups with the pan rest api, same way it can be retrieved with the cli:

show vsys <vsys-name> application-filter

Thanks,

Andrei


Accepted Solutions
gswcowboy
L6 Presenter

This was successful on my end.

https://ip/esp/restapi.esp?type=config&action=get&key=<key>&xpath=/config/devices/entry/vsys/entry/application-filter

<response status="success" code="19"><result total-count="1" count="1"><application-filter><entry name="hitatchi"><category><member>general-internet</member></category><subcategory><member>file-sharing</member></subcategory><technology><member>peer-to-peer</member></technology><evasive>yes</evasive><excessive-bandwidth-use>yes</excessive-bandwidth-use><prone-to-misuse>yes</prone-to-misuse><transfers-files>yes</transfers-files><used-by-malware>yes</used-by-malware><has-known-vulnerabilities>yes</has-known-vulnerabilities><pervasive>yes</pervasive></entry><entry name="test-fileshare"><category><member>general-internet</member></category><subcategory><member>file-sharing</member></subcategory><technology><member>browser-based</member><member>peer-to-peer</member></technology></entry></application-filter></result></response>

View solution in original post


All Replies
gswcowboy
L6 Presenter

Hi,

Here are several resources for your reading pleasure. Hope this helps.

https://live.paloaltonetworks.com/docs/DOC-1031

https://live.paloaltonetworks.com/docs/DOC-1583

-Renato

andrei_feldman
Not applicable

Problem is that the application-filter and application-groups objects do not appear in the query which retrieves all configuration.

I tried a specific xpath query such as the one that rerieves predefined apps: https://<ip>/esp/restapi.esp?key=<key>&type=config&action=get&xpath=/config/predefined/application similar to cli: show predefined application

I tried queries such as: xpath=/config/vsys/<vsys-name>/application-filter

or even just : xpath=/config/vsys/

But nothing works :smileysad:. I'm still looking for a way to retrieve that objects.

gswcowboy
L6 Presenter

This was successful on my end.

https://ip/esp/restapi.esp?type=config&action=get&key=<key>&xpath=/config/devices/entry/vsys/entry/application-filter

<response status="success" code="19"><result total-count="1" count="1"><application-filter><entry name="hitatchi"><category><member>general-internet</member></category><subcategory><member>file-sharing</member></subcategory><technology><member>peer-to-peer</member></technology><evasive>yes</evasive><excessive-bandwidth-use>yes</excessive-bandwidth-use><prone-to-misuse>yes</prone-to-misuse><transfers-files>yes</transfers-files><used-by-malware>yes</used-by-malware><has-known-vulnerabilities>yes</has-known-vulnerabilities><pervasive>yes</pervasive></entry><entry name="test-fileshare"><category><member>general-internet</member></category><subcategory><member>file-sharing</member></subcategory><technology><member>browser-based</member><member>peer-to-peer</member></technology></entry></application-filter></result></response>

View solution in original post

andrei_feldman
Not applicable

Thanks it works!

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!