Created
December 4, 2023 22:27
-
-
Save yujiterada/5c198d07092bf359db785290af569fc5 to your computer and use it in GitHub Desktop.
Reapply port schedule to a port
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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