Enable/Disable rule #458
-
Dear developers How I can enable/disable the rule without affecting other parameters of the rule? But in this case, "pandevice" requires an action parameter. Is there any method to solve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Few different ways to do this. If you have multiple params you want to change about an object, you can from panos.firewall import Firewall
from panos.policies import Rulebase, SecurityRule
fw = Firewall(.........)
base = Rulebase()
fw.add(base)
rule = SecurityRule("rule name here", disabled=True)
base.add(rule)
rule.update("disabled") |
Beta Was this translation helpful? Give feedback.
Few different ways to do this.
If you have multiple params you want to change about an object, you can
.apply()
it. But if you just want to update a single param, you can use update: