Get a list off all org devices that are whitelisted

amabt
Building a reputation

Get a list off all org devices that are whitelisted

I  need to get a list off all devices across an org that have been manualy set to "Allow list (no bandwidth limits or splash page)". I can't seem find a relevant an API endpoint.

 

Something like one of the below endpoints for would be good

get-network-client-policy

 

Thanks

2 Replies 2
CH_EDJ
Here to help

So I looked around and it seems like there is no Org level call that will provide that information. I was able to get it working but its inefficient because it needs to query data from every client at every network as it seems like "getNetworkClientPolicy" is the only way to grab that info.

 

 

import meraki, json
org_id = ''
api_key = ''
mapi = meraki.DashboardAPI(api_key=api_key)
networks = mapi.organizations.getOrganizationNetworks(organizationId=org_id,total_pages='all')
allow_clients = []
for network in networks:
    clients = mapi.networks.getNetworkClients(networkId=network.get('id'))
    for client in clients:
        data = mapi.networks.getNetworkClientPolicy(networkId=network.get('id'),clientId=client.get('id'))       
        if "Whitelisted" in data.get("devicePolicy"):
            allow_clients.append(client)
            break
print(json.dumps(allow_clients,indent=4))

 

 

 

That code will provide a list of client dicts (allow_clients) with the manually set "Allow list" / "Whitelist" attribute. 

amabt
Building a reputation

Thanks. I was hopping to not need something like that. We have hundreds of networks so that going to be lots of API calls!

Get notified when there are additional replies to this discussion.