Skip to content

Commit 1e944cc

Browse files
author
Shiyue Cheng
committed
updated w/ releases 1.0.0b12 & 0.110.5
1 parent d0d8eb3 commit 1e944cc

26 files changed

Lines changed: 349 additions & 832 deletions

meraki/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
)
8989

9090

91-
__version__ = '0.110.4'
91+
__version__ = '0.110.5'
9292

9393

9494
class DashboardAPI(object):

meraki/aio/rest_session.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,10 @@ async def _request(self, metadata, method, url, **kwargs):
233233
try:
234234
message = await response.json()
235235
except aiohttp.client_exceptions.ContentTypeError:
236-
message = (await response.content())[:100]
236+
try:
237+
message = (await response.text())[:100]
238+
except:
239+
message = None
237240

238241
# Check specifically for action batch concurrency error
239242
action_batch_concurrency_error = {

meraki/exceptions.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ def __init__(self, metadata, response):
1919
try:
2020
self.message = self.response.json() if self.response is not None and self.response.json() else None
2121
except ValueError:
22-
self.message = self.response.content[:100]
22+
self.message = self.response.content[:100].decode('UTF-8').strip()
23+
if self.status == 404 and self.reason == 'Not Found':
24+
self.message += 'please wait a minute if the key or org was just newly created.'
2325
super(APIError, self).__init__(f'{self.tag}, {self.operation} - {self.status} {self.reason}, {self.message}')
2426

2527
def __repr__(self):
@@ -34,6 +36,10 @@ def __init__(self, metadata, response, message):
3436
self.status = response.status if response is not None and response.status else None
3537
self.reason = response.reason if response is not None and response.reason else None
3638
self.message = message
39+
if type(self.message) == str:
40+
self.message = self.message.strip()
41+
if self.status == 404 and self.reason == 'Not Found':
42+
self.message += 'please wait a minute if the key or org was just newly created.'
3743

3844
super().__init__(
3945
f'{self.tag}, {self.operation} - {self.status} {self.reason}, {self.message}'

meraki_v1/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
SUPPRESS_LOGGING, SIMULATE_API_CALLS, BE_GEO_ID, MERAKI_PYTHON_SDK_CALLER
2121
)
2222

23-
__version__ = '1.0.0b11'
23+
__version__ = '1.0.0b12'
2424

2525
class DashboardAPI(object):
2626
"""

meraki_v1/aio/api/appliance.py

Lines changed: 1 addition & 72 deletions
Large diffs are not rendered by default.

meraki_v1/aio/api/camera.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ def getDeviceCameraAnalyticsLive(self, serial: str):
77
"""
88
**Returns live state from camera of analytics zones**
99
https://developer.cisco.com/meraki/api-v1/#!get-device-camera-analytics-live
10-
1110
- serial (string): (required)
1211
"""
1312

@@ -23,7 +22,6 @@ def getDeviceCameraAnalyticsOverview(self, serial: str, **kwargs):
2322
"""
2423
**Returns an overview of aggregate analytics data for a timespan**
2524
https://developer.cisco.com/meraki/api-v1/#!get-device-camera-analytics-overview
26-
2725
- serial (string): (required)
2826
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 365 days from today.
2927
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0.
@@ -52,7 +50,6 @@ def getDeviceCameraAnalyticsRecent(self, serial: str, **kwargs):
5250
"""
5351
**Returns most recent record for analytics zones**
5452
https://developer.cisco.com/meraki/api-v1/#!get-device-camera-analytics-recent
55-
5653
- serial (string): (required)
5754
- objectType (string): [optional] The object type for which analytics will be retrieved. The default object type is person. The available types are [person, vehicle].
5855
"""
@@ -78,7 +75,6 @@ def getDeviceCameraAnalyticsZones(self, serial: str):
7875
"""
7976
**Returns all configured analytic zones for this camera**
8077
https://developer.cisco.com/meraki/api-v1/#!get-device-camera-analytics-zones
81-
8278
- serial (string): (required)
8379
"""
8480

@@ -94,7 +90,6 @@ def getDeviceCameraAnalyticsZoneHistory(self, serial: str, zoneId: str, **kwargs
9490
"""
9591
**Return historical records for analytic zones**
9692
https://developer.cisco.com/meraki/api-v1/#!get-device-camera-analytics-zone-history
97-
9893
- serial (string): (required)
9994
- zoneId (string): (required)
10095
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 365 days from today.
@@ -125,7 +120,6 @@ def generateDeviceCameraSnapshot(self, serial: str, **kwargs):
125120
"""
126121
**Generate a snapshot of what the camera sees at the specified time and return a link to that image.**
127122
https://developer.cisco.com/meraki/api-v1/#!generate-device-camera-snapshot
128-
129123
- serial (string): (required)
130124
- timestamp (string): [optional] The snapshot will be taken from this time on the camera. The timestamp is expected to be in ISO 8601 format. If no timestamp is specified, we will assume current time.
131125
- fullframe (boolean): [optional] If set to "true" the snapshot will be taken at full sensor resolution. This will error if used with timestamp.
@@ -148,7 +142,6 @@ def getDeviceCameraQualityAndRetention(self, serial: str):
148142
"""
149143
**Returns quality and retention settings for the given camera**
150144
https://developer.cisco.com/meraki/api-v1/#!get-device-camera-quality-and-retention
151-
152145
- serial (string): (required)
153146
"""
154147

@@ -164,7 +157,6 @@ def updateDeviceCameraQualityAndRetention(self, serial: str, **kwargs):
164157
"""
165158
**Update quality and retention settings for the given camera**
166159
https://developer.cisco.com/meraki/api-v1/#!update-device-camera-quality-and-retention
167-
168160
- serial (string): (required)
169161
- 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.
170162
- motionBasedRetentionEnabled (boolean): Boolean indicating if motion-based retention is enabled(true) or disabled(false) on the camera
@@ -202,7 +194,6 @@ def getDeviceCameraSense(self, serial: str):
202194
"""
203195
**Returns sense settings for a given camera**
204196
https://developer.cisco.com/meraki/api-v1/#!get-device-camera-sense
205-
206197
- serial (string): (required)
207198
"""
208199

@@ -218,7 +209,6 @@ def updateDeviceCameraSense(self, serial: str, **kwargs):
218209
"""
219210
**Update sense settings for the given camera**
220211
https://developer.cisco.com/meraki/api-v1/#!update-device-camera-sense
221-
222212
- serial (string): (required)
223213
- senseEnabled (boolean): Boolean indicating if sense(license) is enabled(true) or disabled(false) on the camera
224214
- mqttBrokerId (string): The ID of the MQTT broker to be enabled on the camera. A value of null will disable MQTT on the camera
@@ -242,7 +232,6 @@ def getDeviceCameraSenseObjectDetectionModels(self, serial: str):
242232
"""
243233
**Returns the MV Sense object detection model list for the given camera**
244234
https://developer.cisco.com/meraki/api-v1/#!get-device-camera-sense-object-detection-models
245-
246235
- serial (string): (required)
247236
"""
248237

@@ -258,7 +247,6 @@ def getDeviceCameraVideoSettings(self, serial: str):
258247
"""
259248
**Returns video settings for the given camera**
260249
https://developer.cisco.com/meraki/api-v1/#!get-device-camera-video-settings
261-
262250
- serial (string): (required)
263251
"""
264252

@@ -274,7 +262,6 @@ def updateDeviceCameraVideoSettings(self, serial: str, **kwargs):
274262
"""
275263
**Update video settings for the given camera**
276264
https://developer.cisco.com/meraki/api-v1/#!update-device-camera-video-settings
277-
278265
- serial (string): (required)
279266
- externalRtspEnabled (boolean): Boolean indicating if external rtsp stream is exposed
280267
"""
@@ -296,7 +283,6 @@ def getDeviceCameraVideoLink(self, serial: str, **kwargs):
296283
"""
297284
**Returns video link to the specified camera. If a timestamp is supplied, it links to that timestamp.**
298285
https://developer.cisco.com/meraki/api-v1/#!get-device-camera-video-link
299-
300286
- serial (string): (required)
301287
- timestamp (string): [optional] The video link will start at this time. The timestamp should be a string in ISO8601 format. If no timestamp is specified, we will assume current time.
302288
"""
@@ -318,7 +304,6 @@ def getNetworkCameraQualityRetentionProfiles(self, networkId: str):
318304
"""
319305
**List the quality retention profiles for this network**
320306
https://developer.cisco.com/meraki/api-v1/#!get-network-camera-quality-retention-profiles
321-
322307
- networkId (string): (required)
323308
"""
324309

@@ -334,7 +319,6 @@ def createNetworkCameraQualityRetentionProfile(self, networkId: str, name: str,
334319
"""
335320
**Creates new quality retention profile for this network.**
336321
https://developer.cisco.com/meraki/api-v1/#!create-network-camera-quality-retention-profile
337-
338322
- networkId (string): (required)
339323
- name (string): The name of the new profile. Must be unique. This parameter is required.
340324
- motionBasedRetentionEnabled (boolean): Deletes footage older than 3 days in which no motion was detected. Can be either true or false. Defaults to false.
@@ -364,7 +348,6 @@ def getNetworkCameraQualityRetentionProfile(self, networkId: str, qualityRetenti
364348
"""
365349
**Retrieve a single quality retention profile**
366350
https://developer.cisco.com/meraki/api-v1/#!get-network-camera-quality-retention-profile
367-
368351
- networkId (string): (required)
369352
- qualityRetentionProfileId (string): (required)
370353
"""
@@ -381,7 +364,6 @@ def updateNetworkCameraQualityRetentionProfile(self, networkId: str, qualityRete
381364
"""
382365
**Update an existing quality retention profile for this network.**
383366
https://developer.cisco.com/meraki/api-v1/#!update-network-camera-quality-retention-profile
384-
385367
- networkId (string): (required)
386368
- qualityRetentionProfileId (string): (required)
387369
- name (string): The name of the new profile. Must be unique.
@@ -412,7 +394,6 @@ def deleteNetworkCameraQualityRetentionProfile(self, networkId: str, qualityRete
412394
"""
413395
**Delete an existing quality retention profile for this network.**
414396
https://developer.cisco.com/meraki/api-v1/#!delete-network-camera-quality-retention-profile
415-
416397
- networkId (string): (required)
417398
- qualityRetentionProfileId (string): (required)
418399
"""
@@ -429,7 +410,6 @@ def getNetworkCameraSchedules(self, networkId: str):
429410
"""
430411
**Returns a list of all camera recording schedules.**
431412
https://developer.cisco.com/meraki/api-v1/#!get-network-camera-schedules
432-
433413
- networkId (string): (required)
434414
"""
435415

meraki_v1/aio/api/cellularGateway.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ def getDeviceCellularGatewayLan(self, serial: str):
77
"""
88
**Show the LAN Settings of a MG**
99
https://developer.cisco.com/meraki/api-v1/#!get-device-cellular-gateway-lan
10-
1110
- serial (string): (required)
1211
"""
1312

@@ -23,7 +22,6 @@ def updateDeviceCellularGatewayLan(self, serial: str, **kwargs):
2322
"""
2423
**Update the LAN Settings for a single MG.**
2524
https://developer.cisco.com/meraki/api-v1/#!update-device-cellular-gateway-lan
26-
2725
- serial (string): (required)
2826
- reservedIpRanges (array): list of all reserved IP ranges for a single MG
2927
- fixedIpAssignments (array): list of all fixed IP assignments for a single MG
@@ -46,7 +44,6 @@ def getDeviceCellularGatewayPortForwardingRules(self, serial: str):
4644
"""
4745
**Returns the port forwarding rules for a single MG.**
4846
https://developer.cisco.com/meraki/api-v1/#!get-device-cellular-gateway-port-forwarding-rules
49-
5047
- serial (string): (required)
5148
"""
5249

@@ -62,7 +59,6 @@ def updateDeviceCellularGatewayPortForwardingRules(self, serial: str, **kwargs):
6259
"""
6360
**Updates the port forwarding rules for a single MG.**
6461
https://developer.cisco.com/meraki/api-v1/#!update-device-cellular-gateway-port-forwarding-rules
65-
6662
- serial (string): (required)
6763
- rules (array): An array of port forwarding params
6864
"""
@@ -84,7 +80,6 @@ def getNetworkCellularGatewayConnectivityMonitoringDestinations(self, networkId:
8480
"""
8581
**Return the connectivity testing destinations for an MG network**
8682
https://developer.cisco.com/meraki/api-v1/#!get-network-cellular-gateway-connectivity-monitoring-destinations
87-
8883
- networkId (string): (required)
8984
"""
9085

@@ -100,7 +95,6 @@ def updateNetworkCellularGatewayConnectivityMonitoringDestinations(self, network
10095
"""
10196
**Update the connectivity testing destinations for an MG network**
10297
https://developer.cisco.com/meraki/api-v1/#!update-network-cellular-gateway-connectivity-monitoring-destinations
103-
10498
- networkId (string): (required)
10599
- destinations (array): The list of connectivity monitoring destinations
106100
"""
@@ -122,7 +116,6 @@ def getNetworkCellularGatewayDhcp(self, networkId: str):
122116
"""
123117
**List common DHCP settings of MGs**
124118
https://developer.cisco.com/meraki/api-v1/#!get-network-cellular-gateway-dhcp
125-
126119
- networkId (string): (required)
127120
"""
128121

@@ -138,7 +131,6 @@ def updateNetworkCellularGatewayDhcp(self, networkId: str, **kwargs):
138131
"""
139132
**Update common DHCP settings of MGs**
140133
https://developer.cisco.com/meraki/api-v1/#!update-network-cellular-gateway-dhcp
141-
142134
- networkId (string): (required)
143135
- dhcpLeaseTime (string): DHCP Lease time for all MG of the network. It can be '30 minutes', '1 hour', '4 hours', '12 hours', '1 day' or '1 week'.
144136
- dnsNameservers (string): DNS name servers mode for all MG of the network. It can take 4 different values: 'upstream_dns', 'google_dns', 'opendns', 'custom'.
@@ -162,7 +154,6 @@ def getNetworkCellularGatewaySubnetPool(self, networkId: str):
162154
"""
163155
**Return the subnet pool and mask configured for MGs in the network.**
164156
https://developer.cisco.com/meraki/api-v1/#!get-network-cellular-gateway-subnet-pool
165-
166157
- networkId (string): (required)
167158
"""
168159

@@ -178,7 +169,6 @@ def updateNetworkCellularGatewaySubnetPool(self, networkId: str, **kwargs):
178169
"""
179170
**Update the subnet pool and mask configuration for MGs in the network.**
180171
https://developer.cisco.com/meraki/api-v1/#!update-network-cellular-gateway-subnet-pool
181-
182172
- networkId (string): (required)
183173
- mask (integer): Mask used for the subnet of all MGs in this network.
184174
- cidr (string): CIDR of the pool of subnets. Each MG in this network will automatically pick a subnet from this pool.
@@ -201,7 +191,6 @@ def getNetworkCellularGatewayUplink(self, networkId: str):
201191
"""
202192
**Returns the uplink settings for your MG network.**
203193
https://developer.cisco.com/meraki/api-v1/#!get-network-cellular-gateway-uplink
204-
205194
- networkId (string): (required)
206195
"""
207196

@@ -217,7 +206,6 @@ def updateNetworkCellularGatewayUplink(self, networkId: str, **kwargs):
217206
"""
218207
**Updates the uplink settings for your MG network.**
219208
https://developer.cisco.com/meraki/api-v1/#!update-network-cellular-gateway-uplink
220-
221209
- networkId (string): (required)
222210
- bandwidthLimits (object): The bandwidth settings for the 'cellular' uplink
223211
"""

meraki_v1/aio/api/devices.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ def getDevice(self, serial: str):
77
"""
88
**Return a single device**
99
https://developer.cisco.com/meraki/api-v1/#!get-device
10-
1110
- serial (string): (required)
1211
"""
1312

@@ -23,7 +22,6 @@ def updateDevice(self, serial: str, **kwargs):
2322
"""
2423
**Update the attributes of a device**
2524
https://developer.cisco.com/meraki/api-v1/#!update-device
26-
2725
- serial (string): (required)
2826
- name (string): The name of a device
2927
- tags (array): The list of tags of a device
@@ -53,7 +51,6 @@ def blinkDeviceLeds(self, serial: str, **kwargs):
5351
"""
5452
**Blink the LEDs on a device**
5553
https://developer.cisco.com/meraki/api-v1/#!blink-device-leds
56-
5754
- serial (string): (required)
5855
- duration (integer): The duration in seconds. Must be between 5 and 120. Default is 20 seconds
5956
- period (integer): The period in milliseconds. Must be between 100 and 1000. Default is 160 milliseconds
@@ -77,7 +74,6 @@ def getDeviceClients(self, serial: str, **kwargs):
7774
"""
7875
**List the clients of a device, up to a maximum of a month ago. The usage of each client is returned in kilobytes. If the device is a switch, the switchport is returned; otherwise the switchport field is null.**
7976
https://developer.cisco.com/meraki/api-v1/#!get-device-clients
80-
8177
- serial (string): (required)
8278
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today.
8379
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 1 day.
@@ -100,7 +96,6 @@ def getDeviceLldpCdp(self, serial: str):
10096
"""
10197
**List LLDP and CDP information for a device**
10298
https://developer.cisco.com/meraki/api-v1/#!get-device-lldp-cdp
103-
10499
- serial (string): (required)
105100
"""
106101

@@ -116,7 +111,6 @@ def getDeviceLossAndLatencyHistory(self, serial: str, ip: str, **kwargs):
116111
"""
117112
**Get the uplink loss percentage and latency in milliseconds for a wired network device.**
118113
https://developer.cisco.com/meraki/api-v1/#!get-device-loss-and-latency-history
119-
120114
- serial (string): (required)
121115
- ip (string): The destination IP used to obtain the requested stats. This is required.
122116
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 365 days from today.
@@ -147,7 +141,6 @@ def getDeviceManagementInterface(self, serial: str):
147141
"""
148142
**Return the management interface settings for a device**
149143
https://developer.cisco.com/meraki/api-v1/#!get-device-management-interface
150-
151144
- serial (string): (required)
152145
"""
153146

@@ -163,7 +156,6 @@ def updateDeviceManagementInterface(self, serial: str, **kwargs):
163156
"""
164157
**Update the management interface settings for a device**
165158
https://developer.cisco.com/meraki/api-v1/#!update-device-management-interface
166-
167159
- serial (string): (required)
168160
- wan1 (object): WAN 1 settings
169161
- wan2 (object): WAN 2 settings (only for MX devices)
@@ -186,7 +178,6 @@ def rebootDevice(self, serial: str):
186178
"""
187179
**Reboot a device**
188180
https://developer.cisco.com/meraki/api-v1/#!reboot-device
189-
190181
- serial (string): (required)
191182
"""
192183

@@ -202,7 +193,6 @@ def getDeviceUplink(self, serial: str):
202193
"""
203194
**Return the uplink information for a device.**
204195
https://developer.cisco.com/meraki/api-v1/#!get-device-uplink
205-
206196
- serial (string): (required)
207197
"""
208198

0 commit comments

Comments
 (0)