pan-os-python icon indicating copy to clipboard operation
pan-os-python copied to clipboard

Allow to retrieve root applications from API

Open dersoi opened this issue 3 years ago • 3 comments

There is a feature missing from the PANOS API. While you can easily retrieve all applications and all applications group, you cannot retrieve root applications.

This means that if you want to check if "Jira" is a valid application, you 'd think you can't because you would only be able to retrieve :

  • jira-base
  • jira-downloading
  • jira-editing
  • jira-posting
  • jira-uploading

But Jira is a valid application, which contains all 5 above-mentioned applications.

dersoi avatar Feb 14 '22 07:02 dersoi

:tada: Thanks for opening your first issue here! Welcome to the community!

Should be able to get the container app from the Predefined object instantiated in a PanDevice

from panos.firewall import Firewall

fw = Firewall( .... )
fw.predefined.refreshall_applications()
fw.predefined.application_container_objects['jira'].applications

Worth noting that that is just a list of strings of the names though. To get the object properties of each you'd need to grab them with the application method of the Predefined object.

# Not sure if this is the easiest/best way to do this, but it does work
for app in fw.predefined.application_container_objects['jira'].applications:
    fw.predefined.application(app)

banachtarski-91 avatar Feb 21 '22 15:02 banachtarski-91

This only gives me the applications mentioned above, but not "jira"...

dersoi avatar Feb 24 '22 08:02 dersoi