07-15-2024 05:12 PM
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
07-15-2024 05:41 PM
Can you share the full code please?
It's very generic error.
07-15-2024 10:05 PM
Use this instead
# Pushing the rule to another network
response = dashboard.appliance.updateNetworkApplianceFirewallL3FirewallRules(
network_id,
rules = fw_rules
)
07-16-2024 12:39 AM
I think (not sure) they might need to drop the last rule - the implicit allow rule.
07-16-2024 02:55 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide