Ask for the total number of clients in a network

SOLVED
Namgyu
Getting noticed

Ask for the total number of clients in a network

Hello, all.

 

When I want to know the total number of clients in a network, I make a loop code to count all objects in a client list.

 

And I have a question ― Isn't there an API to let users know the total number of clients connected to a network?

In a network category, it will be nice to be added.

 

Or does there already exist but I couldn't find it?

1 ACCEPTED SOLUTION
sungod
Building a reputation

If you have a list of clients why not use len() instead of counting? i.e. (cut & pasted from a script)...

 

clients = await aiomeraki.networks.getNetworkClients(net_id, timespan=t, perPage=1000, total_pages="all")

 

...then...     len(clients)    ...will give you the number of clients seen in that timespan.

 

 

 

 

 

View solution in original post

3 REPLIES 3
sungod
Building a reputation

If you have a list of clients why not use len() instead of counting? i.e. (cut & pasted from a script)...

 

clients = await aiomeraki.networks.getNetworkClients(net_id, timespan=t, perPage=1000, total_pages="all")

 

...then...     len(clients)    ...will give you the number of clients seen in that timespan.

 

 

 

 

 

Namgyu
Getting noticed

I already know this solution, but if the network has more than 1000 clients, it is complicated to get the clients from 1001th.

So I want to get the response about the total number of clients in a network. 😎

 

Thank you for kind reply!

sungod
Building a reputation

Perhaps you are not aware, but the call I use in the example will return thousands of clients in one go, all the page handling occurs internally.

 

You could use the 'make a wish' button and ask for a new API call to return summary client data, perhaps you will be lucky.

 

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.