Try something like this; #! /usr/bin/env python3
import meraki
def main():
# Instantiate Meraki Dashboard API object - Assumes APIKEY stored as env var MERAKI_DASHBOARD_API_KEY
dashboard = meraki.DashboardAPI()
# Organizations ID
org_id = ""
networks = dashboard.organizations.getOrganizationNetworks(org_id)
Network_Devices = []
for network in networks:
network_devices = dashboard.networks.getNetworkDevices(network['id'])
Network_Devices.append({
'id': network['id'],
'name': network['name'],
'devices': network_devices
})
for network in Network_Devices:
print("Network",network['name'],"with id",network['id'],"has the following devices")
for device in network['devices']:
print("\tDevice",device['serial'],"is located at Lat",device['lat'],"and long",device['lng'])
if __name__ == "__main__":
main()
... View more