Skip to content

Enable/Disable rule #458

Answered by shinmog
chkhalafov asked this question in Q&A
Jun 24, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

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:

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")

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@chkhalafov
Comment options

Answer selected by chkhalafov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants