- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Update L3 Firewall Rules | Error takes 2 positional arguments but 3 were given
Hi All,
I'm reading the firewall rules from a network and trying to push them to another network, getting error
TypeError: Appliance.updateNetworkApplianceFirewallL3FirewallRules() takes 2 positional arguments but 3 were given
My code is simply below, the fw_rules result in the dict with 1000+ rules
# Reading the rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you share the full code please?
It's very generic error.
Please, if this post was useful, leave your kudos and mark it as solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use this instead
# Pushing the rule to another network
response = dashboard.appliance.updateNetworkApplianceFirewallL3FirewallRules(
network_id,
rules = fw_rules
)
Like what you see? - Give a Kudo ## Did it answer your question? - Mark it as a Solution 🙂
All code examples are provided as is. Responsibility for Code execution lies solely your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think (not sure) they might need to drop the last rule - the implicit allow rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's definitely not unlikely that the default rule in the end should be popped. (Although I'd expect the API to be able to handle that rule, but that's another story..)
However, then I'd expect a different error than the python error. If memory serves me right, I think it would fail within the REST call itself, and not a positional error in the function call.
Like what you see? - Give a Kudo ## Did it answer your question? - Mark it as a Solution 🙂
All code examples are provided as is. Responsibility for Code execution lies solely your own.
