Browse files

Import 2 functions from unifi-lab: get_users and get_user_groups

Obtained via unifi-lab, adds 2 simple functions to get more
user and configuration data.

get_users likely represents a couple of things that are shown
in the "All Clients" tab of UniFi's web interface. (though not all)

In contrast to get_clients, it shows both curently connected as well
as disconnected clients. Infortunately I don't have knowledge about
how long exactly this data is stored in the DB, but it seems to store
quite some data back in time.

get_user_groups gives mostly QoS rate limitation information
about user groups defined in the web interface.
  • Loading branch information...
1 parent 07619bf commit 377088f0cb04eedb5580e06cff1fa6953e9dd7df @matsimon matsimon committed Sep 6, 2013
Showing with 19 additions and 1 deletion.
  1. +9 −1 README.md
  2. +10 −0 unifi/controller.py
View
10 README.md
@@ -133,7 +133,15 @@ Return a list of all AP:s, with significant information about each.
### `get_clients(self)`
Return a list of all active clients, with significant information about each.
-
+
+### `get_users(self)`
+
+Return a list of all known clients, with significant information about each.
+
+### `get_user_groups(self)`
+
+Return a list of user groups with its rate limiting settings.
+
### `get_wlan_conf(self)`
Return a list of configured WLANs with their configuration parameters.
View
10 unifi/controller.py
@@ -111,6 +111,16 @@ def get_clients(self):
return self._read(self.api_url + 'stat/sta')
+ def get_users(self):
+ """Return a list of all known clients, with significant information about each."""
+
+ return self._read(self.api_url + 'list/user')
+
+ def get_user_groups(self):
+ """Return a list of user groups with its rate limiting settings."""
+
+ return self._read(self.api_url + 'list/usergroup')
+
def get_wlan_conf(self):
"""Return a list of configured WLANs with their configuration parameters."""

0 comments on commit 377088f

Please sign in to comment.