- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
cycleDeviceSwitchPorts - 400 Bad Request, {'errors': ["'ports' must be an array"]}
Hi All,
I'm getting the error in the subject when I try to cycle switch port. i can apply or remove the access policy using the same for loop with no issues. But when I try to cycle I'm getting the error. below is my code.
any idea please?
Solved! Go to solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,
If you look at the documentation the input must be an array : https://developer.cisco.com/meraki/api-v1/#!cycle-device-switch-ports
like : ports = ['1', '2-5'] or simply ports = ['1'] while you are probably passing a string from getDeviceSwitchPorts ( portId = "1" )
There are many ways to fix it.
portlist = []
portlist.append(port['portId'])
port_Cycle = dashboard.switch.cycleDeviceSwitchPorts(device['serial'], portlist)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,
If you look at the documentation the input must be an array : https://developer.cisco.com/meraki/api-v1/#!cycle-device-switch-ports
like : ports = ['1', '2-5'] or simply ports = ['1'] while you are probably passing a string from getDeviceSwitchPorts ( portId = "1" )
There are many ways to fix it.
portlist = []
portlist.append(port['portId'])
port_Cycle = dashboard.switch.cycleDeviceSwitchPorts(device['serial'], portlist)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, that worked!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Excellent ! Glad we were able to help you !
Have a good one
