pan-os-python
pan-os-python copied to clipboard
Using the predefined object like an object does not work
Describe the bug
This doesn't work and should:
from panos.firewall import Firewall
from panos.predefined import Predefined
from panos.objects import ServiceObject
fw = Firewall(.....)
predef = Predefined()
fw.add(predef)
ServiceObject.refreshall(predef)
Are you able to use the Predefined object that gets instantiated as a member of the Firewall object? From the documentation: "This class is typically not instantiated by anything but the base.PanDevice class itself. There is an instance of this Predefined class inside every instantiated base.PanDevice class."
You should be able to refresh services by doing:
from panos.firewall import Firewall
fw = Firewall( ... )
fw.predefined.refreshall_services()