Enable/Disable rule #458
Answered
by
shinmog
chkhalafov
asked this question in
Q&A
|
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? |
Answered by
shinmog
Jun 24, 2022
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") |
1 reply
Answer selected by
chkhalafov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: