forked from meraki/dashboard-api-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalert_settings.py
More file actions
44 lines (33 loc) · 1.51 KB
/
Copy pathalert_settings.py
File metadata and controls
44 lines (33 loc) · 1.51 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
43
class AlertSettings(object):
def __init__(self, session):
super(AlertSettings, self).__init__()
self._session = session
def getNetworkAlertSettings(self, networkId: str):
"""
**Return the alert configuration for this network**
https://developer.cisco.com/meraki/api/#!get-network-alert-settings
- networkId (string)
"""
metadata = {
'tags': ['Alert settings'],
'operation': 'getNetworkAlertSettings',
}
resource = f'/networks/{networkId}/alertSettings'
return self._session.get(metadata, resource)
def updateNetworkAlertSettings(self, networkId: str, **kwargs):
"""
**Update the alert configuration for this network**
https://developer.cisco.com/meraki/api/#!update-network-alert-settings
- networkId (string)
- defaultDestinations (object): The network-wide destinations for all alerts on the network.
- alerts (array): Alert-specific configuration for each type. Only alerts that pertain to the network can be updated.
"""
kwargs.update(locals())
metadata = {
'tags': ['Alert settings'],
'operation': 'updateNetworkAlertSettings',
}
resource = f'/networks/{networkId}/alertSettings'
body_params = ['defaultDestinations', 'alerts']
payload = {k: v for (k, v) in kwargs.items() if k in body_params}
return self._session.put(metadata, resource, payload)