From f4f2e9b8994be6c945637474d549bbcc75f63c03 Mon Sep 17 00:00:00 2001 From: jhiggins-NZ Date: Tue, 2 Apr 2019 21:31:28 +1300 Subject: [PATCH] Update meraki.py Add getuplinklossandlatency function for device's uplink(s). --- meraki.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/meraki.py b/meraki.py index b4a4fe6b..3e2476d5 100644 --- a/meraki.py +++ b/meraki.py @@ -1711,6 +1711,23 @@ def getlldpcdp(apikey, networkid, serial, timespan=10800, suppressprint=False): return result +# The uplink loss percentage and latency for wired network device. +# https://api.meraki.com/api_docs#get-the-uplink-loss-percentage-and-latency-in-milliseconds-for-a-wired-network-device +def getlossandlatencyhistory(apikey, networkid, serialnum, ip, uplink, timespan=86400, suppressprint=False): + calltype = 'Network Loss and Latency History' + geturl = '{0}/networks/{1}/devices/{2}/lossAndLatencyHistory?ip={3}×pan={4}&uplink={5}'.format(str(base_url), str(networkid), str(serialnum), str(ip), str(timespan), str(uplink)) + headers = { + 'x-cisco-meraki-api-key': format(str(apikey)), + 'Content-Type': 'application/json' + } + dashboard = requests.get(geturl, headers=headers) + # + # Call return handler function to parse Dashboard response + # + result = __returnhandler(dashboard.status_code, dashboard.text, calltype, suppressprint) + return result + + # ### MX cellular firewall### # Return the cellular firewall rules for an MX network