forked from meraki/dashboard-api-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmx_cellular_firewall.py
More file actions
43 lines (32 loc) · 1.46 KB
/
Copy pathmx_cellular_firewall.py
File metadata and controls
43 lines (32 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
class MXCellularFirewall(object):
def __init__(self, session):
super(MXCellularFirewall, self).__init__()
self._session = session
def getNetworkCellularFirewallRules(self, networkId: str):
"""
**Return the cellular firewall rules for an MX network**
https://api.meraki.com/api_docs#return-the-cellular-firewall-rules-for-an-mx-network
- networkId (string)
"""
metadata = {
'tags': ['MX cellular firewall'],
'operation': 'getNetworkCellularFirewallRules',
}
resource = f'/networks/{networkId}/cellularFirewallRules'
return self._session.get(metadata, resource)
def updateNetworkCellularFirewallRules(self, networkId: str, **kwargs):
"""
**Update the cellular firewall rules of an MX network**
https://api.meraki.com/api_docs#update-the-cellular-firewall-rules-of-an-mx-network
- networkId (string)
- rules (array): An ordered array of the firewall rules (not including the default rule)
"""
kwargs.update(locals())
metadata = {
'tags': ['MX cellular firewall'],
'operation': 'updateNetworkCellularFirewallRules',
}
resource = f'/networks/{networkId}/cellularFirewallRules'
body_params = ['rules']
payload = {k: v for (k, v) in kwargs.items() if k in body_params}
return self._session.put(metadata, resource, payload)