Change Ports Status TimeSpan Meraki SDK

Solved
AhmedJawad
Getting noticed

Change Ports Status TimeSpan Meraki SDK

I'm using the API https://developer.cisco.com/meraki/api/get-device-switch-ports-statuses/

want to pass timespan in the SDK after the switch serial 

Status = dashboard.switch.getDeviceSwitchPortsStatuses(Serial)

 

how do I do that, please? I know the default is 1 day I want to change it to 30 days. 

 

 

___ 

Below is my loop in SDK . 

 

 

Devices = dashboard.organizations.getOrganizationDevices(org_id, total_pages='all')

for Device in Devices:
    if Device['productType'] == 'switch':
        Serial = Device['serial']
        Status = dashboard.switch.getDeviceSwitchPortsStatuses(Serial)
        print(Status)
 
1 Accepted Solution
RaphaelL
Kind of a big deal
Kind of a big deal

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.

maximum = 2678400
 
so timespan=2678400
 
have you tried : Status = dashboard.switch.getDeviceSwitchPortsStatuses(Serial,timespan=2678400)  ?

View solution in original post

2 Replies 2
RaphaelL
Kind of a big deal
Kind of a big deal

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.

maximum = 2678400
 
so timespan=2678400
 
have you tried : Status = dashboard.switch.getDeviceSwitchPortsStatuses(Serial,timespan=2678400)  ?

Awsome, I will try it ! thank you !

Get notified when there are additional replies to this discussion.