Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion meraki/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
)
from meraki.rest_session import *

__version__ = '1.54.0'
__version__ = '1.56.0'


class DashboardAPI(object):
Expand Down
548 changes: 547 additions & 1 deletion meraki/aio/api/appliance.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions meraki/aio/api/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,15 @@ def updateDeviceCameraQualityAndRetention(self, serial: str, **kwargs):
- motionBasedRetentionEnabled (boolean): Boolean indicating if motion-based retention is enabled(true) or disabled(false) on the camera.
- audioRecordingEnabled (boolean): Boolean indicating if audio recording is enabled(true) or disabled(false) on the camera
- restrictedBandwidthModeEnabled (boolean): Boolean indicating if restricted bandwidth is enabled(true) or disabled(false) on the camera. This setting does not apply to MV2 cameras.
- quality (string): Quality of the camera. Can be one of 'Standard', 'High' or 'Enhanced'. Not all qualities are supported by every camera model.
- quality (string): Quality of the camera. Can be one of 'Standard', 'High', 'Enhanced' or 'Ultra'. Not all qualities are supported by every camera model.
- resolution (string): Resolution of the camera. Can be one of '1280x720', '1920x1080', '1080x1080', '2112x2112', '2880x2880', '2688x1512' or '3840x2160'.Not all resolutions are supported by every camera model.
- motionDetectorVersion (integer): The version of the motion detector that will be used by the camera. Only applies to Gen 2 cameras. Defaults to v2.
"""

kwargs.update(locals())

if 'quality' in kwargs:
options = ['Enhanced', 'High', 'Standard']
options = ['Enhanced', 'High', 'Standard', 'Ultra']
assert kwargs['quality'] in options, f'''"quality" cannot be "{kwargs['quality']}", & must be set to one of: {options}'''
if 'resolution' in kwargs:
options = ['1080x1080', '1280x720', '1920x1080', '2112x2112', '2688x1512', '2880x2880', '3840x2160']
Expand Down
4 changes: 2 additions & 2 deletions meraki/aio/api/licensing.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ def getAdministeredLicensingSubscriptionEntitlements(self, **kwargs):



def getAdministeredLicensingSubscriptionSubscriptions(self, total_pages=1, direction='next', **kwargs):
def getAdministeredLicensingSubscriptionSubscriptions(self, organizationIds: list, total_pages=1, direction='next', **kwargs):
"""
**List available subscriptions**
https://developer.cisco.com/meraki/api-v1/#!get-administered-licensing-subscription-subscriptions

- organizationIds (array): Organizations to get associated subscriptions for
- total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages
- direction (string): direction to paginate, either "next" (default) or "prev" page
- perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000.
- 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.
- 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.
- subscriptionIds (array): List of subscription ids to fetch
- organizationIds (array): Organizations to get associated subscriptions for
- startDate (string): Filter subscriptions by start date, ISO 8601 format. To filter with a range of dates, use 'startDate[<option>]=?' in the request. Accepted options include lt, gt, lte, gte.
- endDate (string): Filter subscriptions by end date, ISO 8601 format. To filter with a range of dates, use 'endDate[<option>]=?' in the request. Accepted options include lt, gt, lte, gte.
- statuses (array): List of statuses that returned subscriptions can have
Expand Down
16 changes: 12 additions & 4 deletions meraki/aio/api/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,7 @@ def createNetworkFloorPlan(self, networkId: str, name: str, imageContents: str,
- bottomRightCorner (object): The longitude and latitude of the bottom right corner of your floor plan.
- topLeftCorner (object): The longitude and latitude of the top left corner of your floor plan.
- topRightCorner (object): The longitude and latitude of the top right corner of your floor plan.
- floorNumber (integer): The floor number of the floors within the building
"""

kwargs.update(locals())
Expand All @@ -1194,7 +1195,7 @@ def createNetworkFloorPlan(self, networkId: str, name: str, imageContents: str,
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/floorPlans'

body_params = ['name', 'center', 'bottomLeftCorner', 'bottomRightCorner', 'topLeftCorner', 'topRightCorner', 'imageContents', ]
body_params = ['name', 'center', 'bottomLeftCorner', 'bottomRightCorner', 'topLeftCorner', 'topRightCorner', 'floorNumber', 'imageContents', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}

return self._session.post(metadata, resource, payload)
Expand Down Expand Up @@ -1360,6 +1361,7 @@ def updateNetworkFloorPlan(self, networkId: str, floorPlanId: str, **kwargs):
- bottomRightCorner (object): The longitude and latitude of the bottom right corner of your floor plan.
- topLeftCorner (object): The longitude and latitude of the top left corner of your floor plan.
- topRightCorner (object): The longitude and latitude of the top right corner of your floor plan.
- floorNumber (integer): The floor number of the floors within the building
- imageContents (string): The file contents (a base 64 encoded string) of your new image. Supported formats are PNG, GIF, and JPG. Note that all images are saved as PNG files, regardless of the format they are uploaded in. If you upload a new image, and you do NOT specify any new geolocation fields ('center, 'topLeftCorner', etc), the floor plan will be recentered with no rotation in order to maintain the aspect ratio of your new image.
"""

Expand All @@ -1373,7 +1375,7 @@ def updateNetworkFloorPlan(self, networkId: str, floorPlanId: str, **kwargs):
floorPlanId = urllib.parse.quote(str(floorPlanId), safe='')
resource = f'/networks/{networkId}/floorPlans/{floorPlanId}'

body_params = ['name', 'center', 'bottomLeftCorner', 'bottomRightCorner', 'topLeftCorner', 'topRightCorner', 'imageContents', ]
body_params = ['name', 'center', 'bottomLeftCorner', 'bottomRightCorner', 'topLeftCorner', 'topRightCorner', 'floorNumber', 'imageContents', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}

return self._session.put(metadata, resource, payload)
Expand Down Expand Up @@ -1541,7 +1543,10 @@ def deleteNetworkGroupPolicy(self, networkId: str, groupPolicyId: str, **kwargs)
groupPolicyId = urllib.parse.quote(str(groupPolicyId), safe='')
resource = f'/networks/{networkId}/groupPolicies/{groupPolicyId}'

return self._session.delete(metadata, resource)
query_params = ['force', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}

return self._session.delete(metadata, resource, params)



Expand Down Expand Up @@ -1659,7 +1664,10 @@ def deleteNetworkMerakiAuthUser(self, networkId: str, merakiAuthUserId: str, **k
merakiAuthUserId = urllib.parse.quote(str(merakiAuthUserId), safe='')
resource = f'/networks/{networkId}/merakiAuthUsers/{merakiAuthUserId}'

return self._session.delete(metadata, resource)
query_params = ['delete', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}

return self._session.delete(metadata, resource, params)



Expand Down
42 changes: 42 additions & 0 deletions meraki/aio/api/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2284,6 +2284,48 @@ def getOrganizationDevicesStatusesOverview(self, organizationId: str, **kwargs):



def getOrganizationDevicesSystemMemoryUsageHistoryByInterval(self, organizationId: str, total_pages=1, direction='next', **kwargs):
"""
**Return the memory utilization history in kB for devices in the organization.**
https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-system-memory-usage-history-by-interval

- organizationId (string): Organization ID
- total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages
- direction (string): direction to paginate, either "next" (default) or "prev" page
- perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10.
- 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.
- 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.
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0.
- 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 2 hours. If interval is provided, the timespan will be autocalculated.
- interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 1200, 3600, 14400. The default is 300. Interval is calculated if time params are provided.
- networkIds (array): Optional parameter to filter the result set by the included set of network IDs
- serials (array): Optional parameter to filter device availabilities history by device serial numbers
- productTypes (array): Optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect.
"""

kwargs.update(locals())

metadata = {
'tags': ['organizations', 'monitor', 'devices', 'system', 'memory', 'usage', 'history', 'byInterval'],
'operation': 'getOrganizationDevicesSystemMemoryUsageHistoryByInterval'
}
organizationId = urllib.parse.quote(str(organizationId), safe='')
resource = f'/organizations/{organizationId}/devices/system/memory/usage/history/byInterval'

query_params = ['perPage', 'startingAfter', 'endingBefore', 't0', 't1', 'timespan', 'interval', 'networkIds', 'serials', 'productTypes', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}

array_params = ['networkIds', 'serials', 'productTypes', ]
for k, v in kwargs.items():
if k.strip() in array_params:
params[f'{k.strip()}[]'] = kwargs[f'{k}']
params.pop(k.strip())

return self._session.get_pages(metadata, resource, params, total_pages, direction)



def getOrganizationDevicesUplinksAddressesByDevice(self, organizationId: str, total_pages=1, direction='next', **kwargs):
"""
**List the current uplink addresses for devices in an organization.**
Expand Down
12 changes: 8 additions & 4 deletions meraki/aio/api/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ def createNetworkSensorAlertsProfile(self, networkId: str, name: str, conditions
- schedule (object): The sensor schedule to use with the alert profile.
- recipients (object): List of recipients that will receive the alert.
- serials (array): List of device serials assigned to this sensor alert profile.
- includeSensorUrl (boolean): Include dashboard link to sensor in messages (default: true).
- message (string): A custom message that will appear in email and text message alerts.
"""

kwargs.update(locals())
Expand All @@ -230,7 +232,7 @@ def createNetworkSensorAlertsProfile(self, networkId: str, name: str, conditions
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/sensor/alerts/profiles'

body_params = ['name', 'schedule', 'conditions', 'recipients', 'serials', ]
body_params = ['name', 'schedule', 'conditions', 'recipients', 'serials', 'includeSensorUrl', 'message', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}

return self._session.post(metadata, resource, payload)
Expand Down Expand Up @@ -270,6 +272,8 @@ def updateNetworkSensorAlertsProfile(self, networkId: str, id: str, **kwargs):
- conditions (array): List of conditions that will cause the profile to send an alert.
- recipients (object): List of recipients that will receive the alert.
- serials (array): List of device serials assigned to this sensor alert profile.
- includeSensorUrl (boolean): Include dashboard link to sensor in messages (default: true).
- message (string): A custom message that will appear in email and text message alerts.
"""

kwargs.update(locals())
Expand All @@ -282,7 +286,7 @@ def updateNetworkSensorAlertsProfile(self, networkId: str, id: str, **kwargs):
id = urllib.parse.quote(str(id), safe='')
resource = f'/networks/{networkId}/sensor/alerts/profiles/{id}'

body_params = ['name', 'schedule', 'conditions', 'recipients', 'serials', ]
body_params = ['name', 'schedule', 'conditions', 'recipients', 'serials', 'includeSensorUrl', 'message', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}

return self._session.put(metadata, resource, payload)
Expand Down Expand Up @@ -412,7 +416,7 @@ def getOrganizationSensorReadingsHistory(self, organizationId: str, total_pages=
- 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.
- networkIds (array): Optional parameter to filter readings by network.
- serials (array): Optional parameter to filter readings by sensor.
- metrics (array): Types of sensor readings to retrieve. If no metrics are supplied, all available types of readings will be retrieved. Allowed values are apparentPower, battery, button, co2, current, door, downstreamPower, frequency, humidity, indoorAirQuality, noise, pm25, powerFactor, realPower, remoteLockoutSwitch, temperature, tvoc, voltage, and water.
- metrics (array): Types of sensor readings to retrieve. If no metrics are supplied, all available types of readings will be retrieved.
"""

kwargs.update(locals())
Expand Down Expand Up @@ -450,7 +454,7 @@ def getOrganizationSensorReadingsLatest(self, organizationId: str, total_pages=1
- 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.
- networkIds (array): Optional parameter to filter readings by network.
- serials (array): Optional parameter to filter readings by sensor.
- metrics (array): Types of sensor readings to retrieve. If no metrics are supplied, all available types of readings will be retrieved. Allowed values are apparentPower, battery, button, co2, current, door, downstreamPower, frequency, humidity, indoorAirQuality, noise, pm25, powerFactor, realPower, remoteLockoutSwitch, temperature, tvoc, voltage, and water.
- metrics (array): Types of sensor readings to retrieve. If no metrics are supplied, all available types of readings will be retrieved.
"""

kwargs.update(locals())
Expand Down
Loading