forked from meraki/dashboard-api-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsight.py
More file actions
98 lines (68 loc) · 3.55 KB
/
Copy pathinsight.py
File metadata and controls
98 lines (68 loc) · 3.55 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
class ActionBatchInsight(object):
def __init__(self):
super(ActionBatchInsight, self).__init__()
def createOrganizationInsightMonitoredMediaServer(self, organizationId: str, name: str, address: str, **kwargs):
"""
**Add a media server to be monitored for this organization**
https://developer.cisco.com/meraki/api-v1/#!create-organization-insight-monitored-media-server
- organizationId (string): (required)
- name (string): The name of the VoIP provider
- address (string): The IP address (IPv4 only) or hostname of the media server to monitor
- bestEffortMonitoringEnabled (boolean): Indicates that if the media server doesn't respond to ICMP pings, the nearest hop will be used in its stead.
"""
kwargs.update(locals())
metadata = {
'tags': ['insight', 'configure', 'monitoredMediaServers'],
'operation': 'createOrganizationInsightMonitoredMediaServer'
}
resource = f'/organizations/{organizationId}/insight/monitoredMediaServers'
body_params = ['name', 'address', 'bestEffortMonitoringEnabled', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
action = {
"resource": resource,
"operation": "create",
"body": payload
}
return action
def updateOrganizationInsightMonitoredMediaServer(self, organizationId: str, monitoredMediaServerId: str, **kwargs):
"""
**Update a monitored media server for this organization**
https://developer.cisco.com/meraki/api-v1/#!update-organization-insight-monitored-media-server
- organizationId (string): (required)
- monitoredMediaServerId (string): (required)
- name (string): The name of the VoIP provider
- address (string): The IP address (IPv4 only) or hostname of the media server to monitor
- bestEffortMonitoringEnabled (boolean): Indicates that if the media server doesn't respond to ICMP pings, the nearest hop will be used in its stead.
"""
kwargs.update(locals())
metadata = {
'tags': ['insight', 'configure', 'monitoredMediaServers'],
'operation': 'updateOrganizationInsightMonitoredMediaServer'
}
resource = f'/organizations/{organizationId}/insight/monitoredMediaServers/{monitoredMediaServerId}'
body_params = ['name', 'address', 'bestEffortMonitoringEnabled', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
action = {
"resource": resource,
"operation": "update",
"body": payload
}
return action
def deleteOrganizationInsightMonitoredMediaServer(self, organizationId: str, monitoredMediaServerId: str):
"""
**Delete a monitored media server from this organization**
https://developer.cisco.com/meraki/api-v1/#!delete-organization-insight-monitored-media-server
- organizationId (string): (required)
- monitoredMediaServerId (string): (required)
"""
metadata = {
'tags': ['insight', 'configure', 'monitoredMediaServers'],
'operation': 'deleteOrganizationInsightMonitoredMediaServer'
}
resource = f'/organizations/{organizationId}/insight/monitoredMediaServers/{monitoredMediaServerId}'
action = {
"resource": resource,
"operation": "destroy",
"body": payload
}
return action