The Meraki Community
Register or Sign in
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • About CITS
CITS

CITS

Just browsing

Member since Jan 17, 2020

‎01-21-2020

Community Record

2
Posts
0
Kudos
0
Solutions
Latest Contributions by CITS
  • Topics CITS has Participated In
  • Latest Contributions by CITS

Re: reboot_network_device command not working inside while loop

by CITS in Developers & APIs
‎01-20-2020 09:48 PM
‎01-20-2020 09:48 PM
I revised my code   while n < len(serials): print(n+1, ' - ', serials[n]) reboot['network_id'] = rebootnetids[n] reboot['serial'] = serials[n] try: devices_controller.reboot_network_device(reboot) except APIException as e: print(e) n += 1 print(reboot)  The code executes the same. No exceptions thrown, but still no reboots to be seen on the dashboard. ... View more

reboot_network_device command not working inside while loop

by CITS in Developers & APIs
‎01-17-2020 08:29 AM
‎01-17-2020 08:29 AM
I have been trying to get this script running that will reboot all access points in an organization nightly. All code for discovering access points works correctly. At the end I have a loop to go through all the discovered APs and issue the reboot command to each one.   while n < len(serials): #print(n+1, ' - ', serials[n]) reboot[ 'network_id' ] = rebootnetids[n] reboot[ 'serial' ] = serials[n] devices_controller.reboot_network_device(reboot) n += 1 #print(reboot) The script will run with no errors, and the lines I have commented out here will print all the correct info when not commented. I have also tried just a single reboot command for a single device outside the while loop and that worked. It seems putting it inside a loop breaks the command. What am I missing? ... View more
Labels:
  • Labels:
  • Code Sample
  • Dashboard API
custom.footer.
  • Community Guidelines
  • Cisco Privacy
  • Khoros Privacy
  • Privacy Settings
  • Terms of Use
© 2022 Meraki