Update L3 Firewall Rules | Error takes 2 positional arguments but 3 were given

AhmedJawad
Getting noticed

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
alemabrahao
Kind of a big deal
Kind of a big deal

Can you share the full code please?

 

It's very generic error.

I am not a Cisco Meraki 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.
rhbirkelund
Kind of a big deal
Kind of a big deal

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? - 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.
PhilipDAth
Kind of a big deal
Kind of a big deal

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

rhbirkelund
Kind of a big deal
Kind of a big deal

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? - 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.
Get notified when there are additional replies to this discussion.