forked from meraki/dashboard-api-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitch_acls.py
More file actions
43 lines (32 loc) · 1.48 KB
/
Copy pathswitch_acls.py
File metadata and controls
43 lines (32 loc) · 1.48 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 SwitchACLs(object):
def __init__(self, session):
super(SwitchACLs, self).__init__()
self._session = session
def getNetworkSwitchAccessControlLists(self, networkId: str):
"""
**Return the access control lists for a MS network**
https://developer.cisco.com/meraki/api/#!get-network-switch-access-control-lists
- networkId (string)
"""
metadata = {
'tags': ['Switch ACLs'],
'operation': 'getNetworkSwitchAccessControlLists',
}
resource = f'/networks/{networkId}/switch/accessControlLists'
return self._session.get(metadata, resource)
def updateNetworkSwitchAccessControlLists(self, networkId: str, rules: list):
"""
**Update the access control lists for a MS network**
https://developer.cisco.com/meraki/api/#!update-network-switch-access-control-lists
- networkId (string)
- rules (array): An ordered array of the access control list rules (not including the default rule). An empty array will clear the rules.
"""
kwargs = locals()
metadata = {
'tags': ['Switch ACLs'],
'operation': 'updateNetworkSwitchAccessControlLists',
}
resource = f'/networks/{networkId}/switch/accessControlLists'
body_params = ['rules']
payload = {k: v for (k, v) in kwargs.items() if k in body_params}
return self._session.put(metadata, resource, payload)