Skip to content

Commit ea4dba2

Browse files
Updating for v1.12.0
1 parent f350184 commit ea4dba2

19 files changed

Lines changed: 924 additions & 78 deletions

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.10.0'
28+
__version__ = '1.12.0'
2929

3030

3131
class DashboardAPI(object):

meraki/aio/api/appliance.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,6 +1234,33 @@ def updateNetworkApplianceTrafficShapingUplinkSelection(self, networkId: str, **
12341234

12351235

12361236

1237+
def getNetworkApplianceUplinksUsageHistory(self, networkId: str, **kwargs):
1238+
"""
1239+
**Get the sent and received bytes for each uplink of a network.**
1240+
https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-uplinks-usage-history
1241+
1242+
- networkId (string): (required)
1243+
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 365 days from today.
1244+
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0.
1245+
- 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 14 days. The default is 10 minutes.
1246+
- resolution (integer): The time resolution in seconds for returned data. The valid resolutions are: 60, 300, 600, 1800, 3600, 86400. The default is 60.
1247+
"""
1248+
1249+
kwargs.update(locals())
1250+
1251+
metadata = {
1252+
'tags': ['appliance', 'monitor', 'uplinks', 'usageHistory'],
1253+
'operation': 'getNetworkApplianceUplinksUsageHistory'
1254+
}
1255+
resource = f'/networks/{networkId}/appliance/uplinks/usageHistory'
1256+
1257+
query_params = ['t0', 't1', 'timespan', 'resolution', ]
1258+
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
1259+
1260+
return self._session.get(metadata, resource, params)
1261+
1262+
1263+
12371264
def getNetworkApplianceVlans(self, networkId: str):
12381265
"""
12391266
**List the VLANs for an MX network**

meraki/aio/api/camera.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def updateDeviceCameraQualityAndRetention(self, serial: str, **kwargs):
185185
- profileId (string): The ID of a quality and retention profile to assign to the camera. The profile's settings will override all of the per-camera quality and retention settings. If the value of this parameter is null, any existing profile will be unassigned from the camera.
186186
- motionBasedRetentionEnabled (boolean): Boolean indicating if motion-based retention is enabled(true) or disabled(false) on the camera.
187187
- audioRecordingEnabled (boolean): Boolean indicating if audio recording is enabled(true) or disabled(false) on the camera
188-
- restrictedBandwidthModeEnabled (boolean): Boolean indicating if restricted bandwidth is enabled(true) or disabled(false) on the camera
188+
- restrictedBandwidthModeEnabled (boolean): Boolean indicating if restricted bandwidth is enabled(true) or disabled(false) on the camera. This setting does not apply to MV2 cameras.
189189
- quality (string): Quality of the camera. Can be one of 'Standard', 'High' or 'Enhanced'. Not all qualities are supported by every camera model.
190190
- resolution (string): Resolution of the camera. Can be one of '1280x720', '1920x1080', '1080x1080' or '2058x2058'. Not all resolutions are supported by every camera model.
191191
- motionDetectorVersion (integer): The version of the motion detector that will be used by the camera. Only applies to Gen 2 cameras. Defaults to v2.
@@ -412,8 +412,8 @@ def createNetworkCameraQualityRetentionProfile(self, networkId: str, name: str,
412412
413413
- networkId (string): (required)
414414
- name (string): The name of the new profile. Must be unique. This parameter is required.
415-
- motionBasedRetentionEnabled (boolean): Deletes footage older than 3 days in which no motion was detected. Can be either true or false. Defaults to false.
416-
- restrictedBandwidthModeEnabled (boolean): Disable features that require additional bandwidth such as Motion Recap. Can be either true or false. Defaults to false.
415+
- motionBasedRetentionEnabled (boolean): Deletes footage older than 3 days in which no motion was detected. Can be either true or false. Defaults to false. This setting does not apply to MV2 cameras.
416+
- restrictedBandwidthModeEnabled (boolean): Disable features that require additional bandwidth such as Motion Recap. Can be either true or false. Defaults to false. This setting does not apply to MV2 cameras.
417417
- audioRecordingEnabled (boolean): Whether or not to record audio. Can be either true or false. Defaults to false.
418418
- cloudArchiveEnabled (boolean): Create redundant video backup using Cloud Archive. Can be either true or false. Defaults to false.
419419
- motionDetectorVersion (integer): The version of the motion detector that will be used by the camera. Only applies to Gen 2 cameras. Defaults to v2.
@@ -464,8 +464,8 @@ def updateNetworkCameraQualityRetentionProfile(self, networkId: str, qualityRete
464464
- networkId (string): (required)
465465
- qualityRetentionProfileId (string): (required)
466466
- name (string): The name of the new profile. Must be unique.
467-
- motionBasedRetentionEnabled (boolean): Deletes footage older than 3 days in which no motion was detected. Can be either true or false. Defaults to false.
468-
- restrictedBandwidthModeEnabled (boolean): Disable features that require additional bandwidth such as Motion Recap. Can be either true or false. Defaults to false.
467+
- motionBasedRetentionEnabled (boolean): Deletes footage older than 3 days in which no motion was detected. Can be either true or false. Defaults to false. This setting does not apply to MV2 cameras.
468+
- restrictedBandwidthModeEnabled (boolean): Disable features that require additional bandwidth such as Motion Recap. Can be either true or false. Defaults to false. This setting does not apply to MV2 cameras.
469469
- audioRecordingEnabled (boolean): Whether or not to record audio. Can be either true or false. Defaults to false.
470470
- cloudArchiveEnabled (boolean): Create redundant video backup using Cloud Archive. Can be either true or false. Defaults to false.
471471
- motionDetectorVersion (integer): The version of the motion detector that will be used by the camera. Only applies to Gen 2 cameras. Defaults to v2.

meraki/aio/api/insight.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ def __init__(self, session):
55

66

77

8-
def getNetworkInsightApplicationHealthByTime(self, network_id: str, application_id: str, **kwargs):
8+
def getNetworkInsightApplicationHealthByTime(self, networkId: str, applicationId: str, **kwargs):
99
"""
1010
**Get application health by time**
1111
https://developer.cisco.com/meraki/api-v1/#!get-network-insight-application-health-by-time
1212
13-
- network_id (string): (required)
14-
- application_id (string): (required)
13+
- networkId (string): (required)
14+
- applicationId (string): (required)
1515
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today.
1616
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0.
1717
- 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.
@@ -24,7 +24,7 @@ def getNetworkInsightApplicationHealthByTime(self, network_id: str, application_
2424
'tags': ['insight', 'monitor', 'applications', 'healthByTime'],
2525
'operation': 'getNetworkInsightApplicationHealthByTime'
2626
}
27-
resource = f'/networks/{network_id}/insight/applications/{application_id}/healthByTime'
27+
resource = f'/networks/{networkId}/insight/applications/{applicationId}/healthByTime'
2828

2929
query_params = ['t0', 't1', 'timespan', 'resolution', ]
3030
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
@@ -33,6 +33,24 @@ def getNetworkInsightApplicationHealthByTime(self, network_id: str, application_
3333

3434

3535

36+
def getOrganizationInsightApplications(self, organizationId: str):
37+
"""
38+
**List all Insight tracked applications**
39+
https://developer.cisco.com/meraki/api-v1/#!get-organization-insight-applications
40+
41+
- organizationId (string): (required)
42+
"""
43+
44+
metadata = {
45+
'tags': ['insight', 'configure', 'applications'],
46+
'operation': 'getOrganizationInsightApplications'
47+
}
48+
resource = f'/organizations/{organizationId}/insight/applications'
49+
50+
return self._session.get(metadata, resource)
51+
52+
53+
3654
def getOrganizationInsightMonitoredMediaServers(self, organizationId: str):
3755
"""
3856
**List the monitored media servers for this organization**
@@ -140,21 +158,3 @@ def deleteOrganizationInsightMonitoredMediaServer(self, organizationId: str, mon
140158

141159
return self._session.delete(metadata, resource)
142160

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: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,14 @@ def getNetworkClients(self, networkId: str, total_pages=1, direction='next', **k
207207
- perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10.
208208
- startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.
209209
- endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.
210+
- statuses (array): Filters clients based on status. Can be one of 'Online' or 'Offline'.
211+
- ip (string): Filters clients based on a partial or full match for the ip address field.
212+
- ip6 (string): Filters clients based on a partial or full match for the ip6 address field.
213+
- ip6Local (string): Filters clients based on a partial or full match for the ip6Local address field.
214+
- mac (string): Filters clients based on a partial or full match for the mac address field.
215+
- os (string): Filters clients based on a partial or full match for the os (operating system) field.
216+
- description (string): Filters clients based on a partial or full match for the description field.
217+
- recentDeviceConnections (array): Filters clients based on recent connection type. Can be one of 'Wired' or 'Wireless'.
210218
"""
211219

212220
kwargs.update(locals())
@@ -217,9 +225,15 @@ def getNetworkClients(self, networkId: str, total_pages=1, direction='next', **k
217225
}
218226
resource = f'/networks/{networkId}/clients'
219227

220-
query_params = ['t0', 'timespan', 'perPage', 'startingAfter', 'endingBefore', ]
228+
query_params = ['t0', 'timespan', 'perPage', 'startingAfter', 'endingBefore', 'statuses', 'ip', 'ip6', 'ip6Local', 'mac', 'os', 'description', 'recentDeviceConnections', ]
221229
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
222230

231+
array_params = ['statuses', 'recentDeviceConnections', ]
232+
for k, v in kwargs.items():
233+
if k.strip() in array_params:
234+
params[f'{k.strip()}[]'] = kwargs[f'{k}']
235+
params.pop(k.strip())
236+
223237
return self._session.get_pages(metadata, resource, params, total_pages, direction)
224238

225239

@@ -588,7 +602,7 @@ def getNetworkEvents(self, networkId: str, total_pages=1, direction='prev', even
588602
- total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages
589603
- direction (string): direction to paginate, either "next" or "prev" (default) page
590604
- event_log_end_time (string): ISO8601 Zulu/UTC time, to use in conjunction with startingAfter, to retrieve events within a time window
591-
- productType (string): The product type to fetch events for. This parameter is required for networks with multiple device types. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, and environmental
605+
- productType (string): The product type to fetch events for. This parameter is required for networks with multiple device types. Valid types are wireless, appliance, switch, systemsManager, camera, and cellularGateway
592606
- includedEventTypes (array): A list of event types. The returned events will be filtered to only include events with these types.
593607
- excludedEventTypes (array): A list of event types. The returned events will be filtered to exclude events with these types.
594608
- deviceMac (string): The MAC address of the Meraki device which the list of events will be filtered with
@@ -606,6 +620,10 @@ def getNetworkEvents(self, networkId: str, total_pages=1, direction='prev', even
606620

607621
kwargs.update(locals())
608622

623+
if 'productType' in kwargs:
624+
options = ['wireless', 'appliance', 'switch', 'systemsManager', 'camera', 'cellularGateway']
625+
assert kwargs['productType'] in options, f'''"productType" cannot be "{kwargs['productType']}", & must be set to one of: {options}'''
626+
609627
metadata = {
610628
'tags': ['networks', 'monitor', 'events'],
611629
'operation': 'getNetworkEvents'
@@ -1221,6 +1239,8 @@ def updateNetworkNetflow(self, networkId: str, **kwargs):
12211239
- reportingEnabled (boolean): Boolean indicating whether NetFlow traffic reporting is enabled (true) or disabled (false).
12221240
- collectorIp (string): The IPv4 address of the NetFlow collector.
12231241
- collectorPort (integer): The port that the NetFlow collector will be listening on.
1242+
- etaEnabled (boolean): Boolean indicating whether Encrypted Traffic Analysis is enabled (true) or disabled (false).
1243+
- etaDstPort (integer): The port that the Encrypted Traffic Analysis collector will be listening on.
12241244
"""
12251245

12261246
kwargs.update(locals())
@@ -1231,7 +1251,7 @@ def updateNetworkNetflow(self, networkId: str, **kwargs):
12311251
}
12321252
resource = f'/networks/{networkId}/netflow'
12331253

1234-
body_params = ['reportingEnabled', 'collectorIp', 'collectorPort', ]
1254+
body_params = ['reportingEnabled', 'collectorIp', 'collectorPort', 'etaEnabled', 'etaDstPort', ]
12351255
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
12361256

12371257
return self._session.put(metadata, resource, payload)

0 commit comments

Comments
 (0)