With a file named "name.csv", that contains the following,
name,serial
ap1,xxx
ap2,yyy
ap3,zzz
You can use the following
#! /usr/bin/env python3
import meraki
import csv
def main():
dashboard = meraki.DashboardAPI(suppress_logging=True)
with open("name.csv") as csvfile:
ap = csv.DictReader(csvfile, delimiter=',')
for row in ap:
# print(row['name'],row['serial'])
print("Updating:",row['serial'])
response = dashboard.devices.updateDevice(
row['serial'],
name=row['name'],
)
if response['name'] is row['name']:
print("Success!")
if __name__ == "__main__":
main()
LinkedIn :::
https://blog.rhbirkelund.dk/Like what you see? - Give a Kudo ## Did it answer your question? - Mark it as a Solution
🙂All code examples are provided as is. Responsibility for Code execution lies solely your own.