how to retreive predefined Applications from Panorama using Pan-OS-python

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

how to retreive predefined Applications from Panorama using Pan-OS-python

L0 Member
I am getting "None".  Need some help to figure out what is missing here.
 
pano = Panorama('192.168.1.1''user''pwd'
def CheckPaloAddressGroup():
    originalPredefined(pano)
    pano.add(original)
    app_list = original.refreshall_applications()
    print(app_list)
 
 
1 accepted solution

Accepted Solutions

L5 Sessionator

Predefined objects are retrieved from the predefined namespace that is attached to the Panorama and Firewall namespaces.  Also when invoking the refreshall_* methods, they don't return results like object refreshall functions, you have to access the results from the appropriate param on the predefined namespace itself:

 

 

from panos.panorama import Panorama

pano = Panorama("192.168.1.1", "admin", "admin")
pano.predefined.refreshall_applications()

print("Applications: {0}".format(
    pano.predefined.application_objects.keys()),
)

print("Application Containers: {0}".format(
    pano.predefined.application_container_objects.keys()),
)

 

View solution in original post

2 REPLIES 2

L5 Sessionator

Predefined objects are retrieved from the predefined namespace that is attached to the Panorama and Firewall namespaces.  Also when invoking the refreshall_* methods, they don't return results like object refreshall functions, you have to access the results from the appropriate param on the predefined namespace itself:

 

 

from panos.panorama import Panorama

pano = Panorama("192.168.1.1", "admin", "admin")
pano.predefined.refreshall_applications()

print("Applications: {0}".format(
    pano.predefined.application_objects.keys()),
)

print("Application Containers: {0}".format(
    pano.predefined.application_container_objects.keys()),
)

 

L0 Member

Thank you Gfreeman. I was able to retrieve the predefined application.

Pretty excited that that the forum is alive - got the help pretty quick!!. 

 

  • 1 accepted solution
  • 3206 Views
  • 2 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!