cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2423
Views
4
Helpful
4
Replies

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

fw_rules = dashboard.appliance.getNetworkApplianceFirewallL3FirewallRules(net_id)
# Pushing the rule to another network
response = dashboard.appliance.updateNetworkApplianceFirewallL3FirewallRules(
network_id,fw_rules)
4 Replies 4

aleabrahao
Meraki Community All-Star
Meraki Community All-Star

Can you share the full code please?

It's very generic error.

I am not a Cisco employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.

Rasmus Hoffmann Birkelund
Meraki Community All-Star
Meraki Community All-Star

Use this instead

# Pushing the rule to another network 
 
response = dashboard.appliance.updateNetworkApplianceFirewallL3FirewallRules(
                    network_id,
                    rules = fw_rules
)
 
#########
LinkedIn ::: https://blog.rhbirkelund.dk/
Like what you see? - Mark as helpful ## Did it answer your question? - Mark it as a Solution 🙂
All code examples are provided as is. Responsibility for Code execution is solely your own.

I think (not sure) they might need to drop the last rule - the implicit allow rule.

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.

#########
LinkedIn ::: https://blog.rhbirkelund.dk/
Like what you see? - Mark as helpful ## Did it answer your question? - Mark it as a Solution 🙂
All code examples are provided as is. Responsibility for Code execution is solely your own.