33 lines
1.3 KiB
Go
33 lines
1.3 KiB
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
"time"
|
|
)
|
|
|
|
const (
|
|
// LoginPath is Unifi Controller Login API Path
|
|
LoginPath = "/api/login"
|
|
// ClientPath is Unifi Clients API Path
|
|
ClientPath = "/api/s/default/stat/sta"
|
|
// DevicePath is where we get data about Unifi devices.
|
|
DevicePath = "/api/s/default/stat/device"
|
|
// NetworkPath contains network-configuration data. Not really graphable.
|
|
NetworkPath = "/api/s/default/rest/networkconf"
|
|
// UserGroupPath contains usergroup configurations.
|
|
UserGroupPath = "/api/s/default/rest/usergroup"
|
|
)
|
|
|
|
// Config represents the data needed to poll a controller and report to influxdb.
|
|
type Config struct {
|
|
Interval time.Duration `json:"interval",toml:"interval",yaml:"interval"`
|
|
InfluxAddr string `json:"influx_addr",toml:"influx_addr",yaml:"influx_addr"`
|
|
InfluxUser string `json:"influx_user",toml:"influx_user",yaml:"influx_user"`
|
|
InfluxPass string `json:"influx_pass",toml:"influx_pass",yaml:"influx_pass"`
|
|
InfluxDB string `json:"influx_db",toml:"influx_db",yaml:"influx_db"`
|
|
UnifiUser string `json:"unifi_user",toml:"unifi_user",yaml:"unifi_user"`
|
|
UnifiPass string `json:"unifi_pass"toml:"unifi_pass",yaml:"unifi_pass"`
|
|
UnifiBase string `json:"unifi_url",toml:"unifi_url",yaml:"unifi_url"`
|
|
uniClient *http.Client
|
|
}
|