Skip to content

Commit 248e200

Browse files
SDK updated for Meraki API v1.10 release
1 parent 3956b7c commit 248e200

12 files changed

Lines changed: 763 additions & 17 deletions

File tree

meraki/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
SUPPRESS_LOGGING, SIMULATE_API_CALLS, BE_GEO_ID, MERAKI_PYTHON_SDK_CALLER
2626
)
2727

28-
__version__ = '1.7.2'
28+
__version__ = '1.10.0'
2929

3030

3131
class DashboardAPI(object):

meraki/aio/api/camera.py

Lines changed: 211 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ def updateDeviceCameraSense(self, serial: str, **kwargs):
242242
- serial (string): (required)
243243
- senseEnabled (boolean): Boolean indicating if sense(license) is enabled(true) or disabled(false) on the camera
244244
- mqttBrokerId (string): The ID of the MQTT broker to be enabled on the camera. A value of null will disable MQTT on the camera
245+
- audioDetection (object): The details of the audio detection config.
245246
- detectionModelId (string): The ID of the object detection model
246247
"""
247248

@@ -253,7 +254,7 @@ def updateDeviceCameraSense(self, serial: str, **kwargs):
253254
}
254255
resource = f'/devices/{serial}/camera/sense'
255256

256-
body_params = ['senseEnabled', 'mqttBrokerId', 'detectionModelId', ]
257+
body_params = ['senseEnabled', 'mqttBrokerId', 'audioDetection', 'detectionModelId', ]
257258
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
258259

259260
return self._session.put(metadata, resource, payload)
@@ -344,6 +345,48 @@ def getDeviceCameraVideoLink(self, serial: str, **kwargs):
344345

345346

346347

348+
def getDeviceCameraWirelessProfiles(self, serial: str):
349+
"""
350+
**Returns wireless profile assigned to the given camera**
351+
https://developer.cisco.com/meraki/api-v1/#!get-device-camera-wireless-profiles
352+
353+
- serial (string): (required)
354+
"""
355+
356+
metadata = {
357+
'tags': ['camera', 'configure', 'wirelessProfiles'],
358+
'operation': 'getDeviceCameraWirelessProfiles'
359+
}
360+
resource = f'/devices/{serial}/camera/wirelessProfiles'
361+
362+
return self._session.get(metadata, resource)
363+
364+
365+
366+
def updateDeviceCameraWirelessProfiles(self, serial: str, ids: dict):
367+
"""
368+
**Assign wireless profiles to the given camera**
369+
https://developer.cisco.com/meraki/api-v1/#!update-device-camera-wireless-profiles
370+
371+
- serial (string): (required)
372+
- ids (object): The ids of the wireless profile to assign to the given camera
373+
"""
374+
375+
kwargs = locals()
376+
377+
metadata = {
378+
'tags': ['camera', 'configure', 'wirelessProfiles'],
379+
'operation': 'updateDeviceCameraWirelessProfiles'
380+
}
381+
resource = f'/devices/{serial}/camera/wirelessProfiles'
382+
383+
body_params = ['ids', ]
384+
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
385+
386+
return self._session.put(metadata, resource, payload)
387+
388+
389+
347390
def getNetworkCameraQualityRetentionProfiles(self, networkId: str):
348391
"""
349392
**List the quality retention profiles for this network**
@@ -375,7 +418,7 @@ def createNetworkCameraQualityRetentionProfile(self, networkId: str, name: str,
375418
- cloudArchiveEnabled (boolean): Create redundant video backup using Cloud Archive. Can be either true or false. Defaults to false.
376419
- motionDetectorVersion (integer): The version of the motion detector that will be used by the camera. Only applies to Gen 2 cameras. Defaults to v2.
377420
- scheduleId (string): Schedule for which this camera will record video, or 'null' to always record.
378-
- maxRetentionDays (integer): The maximum number of days for which the data will be stored, or 'null' to keep data until storage space runs out. If the former, it can be one of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 30, 60, 90] days
421+
- maxRetentionDays (integer): The maximum number of days for which the data will be stored, or 'null' to keep data until storage space runs out. If the former, it can be one of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 30, 60, 90] days.
379422
- videoSettings (object): Video quality and resolution settings for all the camera models.
380423
"""
381424

@@ -427,7 +470,7 @@ def updateNetworkCameraQualityRetentionProfile(self, networkId: str, qualityRete
427470
- cloudArchiveEnabled (boolean): Create redundant video backup using Cloud Archive. Can be either true or false. Defaults to false.
428471
- motionDetectorVersion (integer): The version of the motion detector that will be used by the camera. Only applies to Gen 2 cameras. Defaults to v2.
429472
- scheduleId (string): Schedule for which this camera will record video, or 'null' to always record.
430-
- maxRetentionDays (integer): The maximum number of days for which the data will be stored, or 'null' to keep data until storage space runs out. If the former, it can be one of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 30, 60, 90] days
473+
- maxRetentionDays (integer): The maximum number of days for which the data will be stored, or 'null' to keep data until storage space runs out. If the former, it can be one of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 30, 60, 90] days.
431474
- videoSettings (object): Video quality and resolution settings for all the camera models.
432475
"""
433476

@@ -481,3 +524,168 @@ def getNetworkCameraSchedules(self, networkId: str):
481524

482525
return self._session.get(metadata, resource)
483526

527+
528+
529+
def createNetworkCameraWirelessProfile(self, networkId: str, name: str, ssid: dict, **kwargs):
530+
"""
531+
**Creates a new camera wireless profile for this network.**
532+
https://developer.cisco.com/meraki/api-v1/#!create-network-camera-wireless-profile
533+
534+
- networkId (string): (required)
535+
- name (string): The name of the camera wireless profile. This parameter is required.
536+
- ssid (object): The details of the SSID config.
537+
- identity (object): The identity of the wireless profile. Required for creating wireless profiles in 8021x-radius auth mode.
538+
"""
539+
540+
kwargs.update(locals())
541+
542+
metadata = {
543+
'tags': ['camera', 'configure', 'wirelessProfiles'],
544+
'operation': 'createNetworkCameraWirelessProfile'
545+
}
546+
resource = f'/networks/{networkId}/camera/wirelessProfiles'
547+
548+
body_params = ['name', 'ssid', 'identity', ]
549+
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
550+
551+
return self._session.post(metadata, resource, payload)
552+
553+
554+
555+
def getNetworkCameraWirelessProfiles(self, networkId: str):
556+
"""
557+
**List the camera wireless profiles for this network.**
558+
https://developer.cisco.com/meraki/api-v1/#!get-network-camera-wireless-profiles
559+
560+
- networkId (string): (required)
561+
"""
562+
563+
metadata = {
564+
'tags': ['camera', 'configure', 'wirelessProfiles'],
565+
'operation': 'getNetworkCameraWirelessProfiles'
566+
}
567+
resource = f'/networks/{networkId}/camera/wirelessProfiles'
568+
569+
return self._session.get(metadata, resource)
570+
571+
572+
573+
def getNetworkCameraWirelessProfile(self, networkId: str, wirelessProfileId: str):
574+
"""
575+
**Retrieve a single camera wireless profile.**
576+
https://developer.cisco.com/meraki/api-v1/#!get-network-camera-wireless-profile
577+
578+
- networkId (string): (required)
579+
- wirelessProfileId (string): (required)
580+
"""
581+
582+
metadata = {
583+
'tags': ['camera', 'configure', 'wirelessProfiles'],
584+
'operation': 'getNetworkCameraWirelessProfile'
585+
}
586+
resource = f'/networks/{networkId}/camera/wirelessProfiles/{wirelessProfileId}'
587+
588+
return self._session.get(metadata, resource)
589+
590+
591+
592+
def updateNetworkCameraWirelessProfile(self, networkId: str, wirelessProfileId: str, **kwargs):
593+
"""
594+
**Update an existing camera wireless profile in this network.**
595+
https://developer.cisco.com/meraki/api-v1/#!update-network-camera-wireless-profile
596+
597+
- networkId (string): (required)
598+
- wirelessProfileId (string): (required)
599+
- name (string): The name of the camera wireless profile.
600+
- ssid (object): The details of the SSID config.
601+
- identity (object): The identity of the wireless profile. Required for creating wireless profiles in 8021x-radius auth mode.
602+
"""
603+
604+
kwargs.update(locals())
605+
606+
metadata = {
607+
'tags': ['camera', 'configure', 'wirelessProfiles'],
608+
'operation': 'updateNetworkCameraWirelessProfile'
609+
}
610+
resource = f'/networks/{networkId}/camera/wirelessProfiles/{wirelessProfileId}'
611+
612+
body_params = ['name', 'ssid', 'identity', ]
613+
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
614+
615+
return self._session.put(metadata, resource, payload)
616+
617+
618+
619+
def deleteNetworkCameraWirelessProfile(self, networkId: str, wirelessProfileId: str):
620+
"""
621+
**Delete an existing camera wireless profile for this network.**
622+
https://developer.cisco.com/meraki/api-v1/#!delete-network-camera-wireless-profile
623+
624+
- networkId (string): (required)
625+
- wirelessProfileId (string): (required)
626+
"""
627+
628+
metadata = {
629+
'tags': ['camera', 'configure', 'wirelessProfiles'],
630+
'operation': 'deleteNetworkCameraWirelessProfile'
631+
}
632+
resource = f'/networks/{networkId}/camera/wirelessProfiles/{wirelessProfileId}'
633+
634+
return self._session.delete(metadata, resource)
635+
636+
637+
638+
def getOrganizationCameraOnboardingStatuses(self, organizationId: str, **kwargs):
639+
"""
640+
**Fetch onboarding status of cameras**
641+
https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-onboarding-statuses
642+
643+
- organizationId (string): (required)
644+
- serials (array): A list of serial numbers. The returned cameras will be filtered to only include these serials.
645+
- networkIds (array): A list of network IDs. The returned cameras will be filtered to only include these networks.
646+
"""
647+
648+
kwargs.update(locals())
649+
650+
metadata = {
651+
'tags': ['camera', 'configure', 'onboarding', 'statuses'],
652+
'operation': 'getOrganizationCameraOnboardingStatuses'
653+
}
654+
resource = f'/organizations/{organizationId}/camera/onboarding/statuses'
655+
656+
query_params = ['serials', 'networkIds', ]
657+
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
658+
659+
array_params = ['serials', 'networkIds', ]
660+
for k, v in kwargs.items():
661+
if k.strip() in array_params:
662+
params[f'{k.strip()}[]'] = kwargs[f'{k}']
663+
params.pop(k.strip())
664+
665+
return self._session.get(metadata, resource, params)
666+
667+
668+
669+
def updateOrganizationCameraOnboardingStatuses(self, organizationId: str, **kwargs):
670+
"""
671+
**Notify that credential handoff to camera has completed**
672+
https://developer.cisco.com/meraki/api-v1/#!update-organization-camera-onboarding-statuses
673+
674+
- organizationId (string): (required)
675+
- serial (string): Serial of camera
676+
- wirelessCredentialsSent (boolean): Note whether credentials were sent successfully
677+
"""
678+
679+
kwargs.update(locals())
680+
681+
metadata = {
682+
'tags': ['camera', 'configure', 'onboarding', 'statuses'],
683+
'operation': 'updateOrganizationCameraOnboardingStatuses'
684+
}
685+
resource = f'/organizations/{organizationId}/camera/onboarding/statuses'
686+
687+
body_params = ['serial', 'wirelessCredentialsSent', ]
688+
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
689+
690+
return self._session.put(metadata, resource, payload)
691+

meraki/aio/api/insight.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,34 @@ def __init__(self, session):
55

66

77

8+
def getNetworkInsightApplicationHealthByTime(self, network_id: str, application_id: str, **kwargs):
9+
"""
10+
**Get application health by time**
11+
https://developer.cisco.com/meraki/api-v1/#!get-network-insight-application-health-by-time
12+
13+
- network_id (string): (required)
14+
- application_id (string): (required)
15+
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today.
16+
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0.
17+
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 2 hours.
18+
- resolution (integer): The time resolution in seconds for returned data. The valid resolutions are: 60, 300, 3600, 86400. The default is 300.
19+
"""
20+
21+
kwargs.update(locals())
22+
23+
metadata = {
24+
'tags': ['insight', 'monitor', 'applications', 'healthByTime'],
25+
'operation': 'getNetworkInsightApplicationHealthByTime'
26+
}
27+
resource = f'/networks/{network_id}/insight/applications/{application_id}/healthByTime'
28+
29+
query_params = ['t0', 't1', 'timespan', 'resolution', ]
30+
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
31+
32+
return self._session.get(metadata, resource, params)
33+
34+
35+
836
def getOrganizationInsightMonitoredMediaServers(self, organizationId: str):
937
"""
1038
**List the monitored media servers for this organization**
@@ -112,3 +140,21 @@ def deleteOrganizationInsightMonitoredMediaServer(self, organizationId: str, mon
112140

113141
return self._session.delete(metadata, resource)
114142

143+
144+
145+
def getOrganizationInsightApplications(self, organization_id: str):
146+
"""
147+
**List all Insight tracked applications**
148+
https://developer.cisco.com/meraki/api-v1/#!get-organization-insight-applications
149+
150+
- organization_id (string): (required)
151+
"""
152+
153+
metadata = {
154+
'tags': ['insight', 'configure', 'applications'],
155+
'operation': 'getOrganizationInsightApplications'
156+
}
157+
resource = f'/organizations/{organization_id}/insight/applications'
158+
159+
return self._session.get(metadata, resource)
160+

meraki/aio/api/networks.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,33 @@ def getNetworkClientsApplicationUsage(self, networkId: str, clients: str, total_
261261

262262

263263

264+
def getNetworkClientsOverview(self, networkId: str, **kwargs):
265+
"""
266+
**Return overview statistics for network clients**
267+
https://developer.cisco.com/meraki/api-v1/#!get-network-clients-overview
268+
269+
- networkId (string): (required)
270+
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today.
271+
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0.
272+
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day.
273+
- resolution (integer): The time resolution in seconds for returned data. The valid resolutions are: 7200, 86400, 604800, 2592000. The default is 604800.
274+
"""
275+
276+
kwargs.update(locals())
277+
278+
metadata = {
279+
'tags': ['networks', 'monitor', 'clients', 'overview'],
280+
'operation': 'getNetworkClientsOverview'
281+
}
282+
resource = f'/networks/{networkId}/clients/overview'
283+
284+
query_params = ['t0', 't1', 'timespan', 'resolution', ]
285+
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
286+
287+
return self._session.get(metadata, resource, params)
288+
289+
290+
264291
def provisionNetworkClients(self, networkId: str, clients: list, devicePolicy: str, **kwargs):
265292
"""
266293
**Provisions a client with a name and policy**

0 commit comments

Comments
 (0)