forked from spinesystemspublic/documentation
Add docs for shaper
Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
This commit is contained in:
@@ -1,3 +1,45 @@
|
||||
# GlobalOS API
|
||||
|
||||
## Setting up
|
||||
|
||||
To enable API, you need to add following file /etc/api.conf
|
||||
|
||||
```ini
|
||||
# set API key
|
||||
apikey=ZZZZZ
|
||||
# disable API key check
|
||||
# disableapikey=1
|
||||
|
||||
allowip=1.2.3.4,2.4.5.6
|
||||
```
|
||||
|
||||
API key should be present in header X-Auth-Token: ZZZZZ
|
||||
|
||||
## Hooks
|
||||
|
||||
### API hook: /hooks/counters
|
||||
|
||||
Available counters for a given interface
|
||||
GET parameters:
|
||||
iface - interface name
|
||||
source - source of data (tc, ip, ethtool)
|
||||
type - type of data (for source tc: qdisc, class, filter; for source ip: link, addr; for source ethtool: statistics, module)
|
||||
|
||||
Example:
|
||||
/hook/counters?iface=ppp100&source=ip&type=link
|
||||
|
||||
### API hook: /ppp/list
|
||||
|
||||
Optional GET params:
|
||||
&tag=XXXX - filter by radattr tag
|
||||
&tag=XXXX&value=YYYY - filter by radattr tag and value (full match)
|
||||
X-Auth-Token: XXXX
|
||||
Login-LAT-Service gaming
|
||||
curl -H "X-Auth-Token: XXXX" http://localhost:8080/ppp/list?tag=Login-LAT-Service&value=gaming
|
||||
|
||||
|
||||
|
||||
|
||||
Work in progress...
|
||||
```
|
||||
http.HandleFunc("/hooks/counters", counters_hook)
|
||||
|
||||
Reference in New Issue
Block a user