Skip to content

Instantly share code, notes, and snippets.

@yujiterada
Created December 4, 2023 22:27
Show Gist options
  • Save yujiterada/5c198d07092bf359db785290af569fc5 to your computer and use it in GitHub Desktop.
Save yujiterada/5c198d07092bf359db785290af569fc5 to your computer and use it in GitHub Desktop.
Reapply port schedule to a port
import json
import meraki
import os
API_KEY = os.environ.get('MERAKI_API_KEY')
DATA = {
"Q4CD-XXXX-YYYY": {
11: "726205439913492796"
}
}
m_client = meraki.DashboardAPI(API_KEY, output_log=False, suppress_logging=True)
for serial, ports in DATA.items():
for port, schedule_id in ports.items():
resp = m_client.switch.updateDeviceSwitchPort(
serial=serial, portId=port, portScheduleId=schedule_id)
print(json.dumps(resp, indent=4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment