2016-03-12 12:32:55 +00:00
|
|
|
package data
|
|
|
|
|
2016-03-12 17:18:35 +00:00
|
|
|
/*
|
|
|
|
Nodes Lua based respondd do not have a integer type.
|
|
|
|
They always return float.
|
|
|
|
*/
|
|
|
|
|
2017-01-20 21:27:44 +00:00
|
|
|
//Statistics struct
|
2016-03-12 12:32:55 +00:00
|
|
|
type Statistics struct {
|
2017-01-20 21:27:44 +00:00
|
|
|
NodeID string `json:"node_id"`
|
2016-03-19 02:08:19 +00:00
|
|
|
Clients Clients `json:"clients"`
|
2016-06-18 22:01:12 +00:00
|
|
|
RootFsUsage float64 `json:"rootfs_usage,omitempty"`
|
|
|
|
LoadAverage float64 `json:"loadavg,omitempty"`
|
|
|
|
Memory Memory `json:"memory,omitempty"`
|
|
|
|
Uptime float64 `json:"uptime,omitempty"`
|
|
|
|
Idletime float64 `json:"idletime,omitempty"`
|
2017-03-06 19:18:08 +00:00
|
|
|
GatewayIPv4 string `json:"gateway,omitempty"`
|
|
|
|
GatewayIPv6 string `json:"gateway6,omitempty"`
|
2016-03-12 12:32:55 +00:00
|
|
|
Processes struct {
|
|
|
|
Total uint32 `json:"total"`
|
|
|
|
Running uint32 `json:"running"`
|
2016-06-18 22:01:12 +00:00
|
|
|
} `json:"processes,omitempty"`
|
2017-01-20 22:23:31 +00:00
|
|
|
MeshVPN *MeshVPN `json:"mesh_vpn,omitempty"`
|
2016-03-19 02:08:19 +00:00
|
|
|
Traffic struct {
|
|
|
|
Tx *Traffic `json:"tx"`
|
|
|
|
Rx *Traffic `json:"rx"`
|
|
|
|
Forward *Traffic `json:"forward"`
|
|
|
|
MgmtTx *Traffic `json:"mgmt_tx"`
|
|
|
|
MgmtRx *Traffic `json:"mgmt_rx"`
|
2016-06-18 22:01:12 +00:00
|
|
|
} `json:"traffic,omitempty"`
|
2016-07-04 12:39:48 +00:00
|
|
|
Switch map[string]*SwitchPort `json:"switch,omitempty"`
|
2016-12-22 02:14:51 +00:00
|
|
|
Wireless WirelessStatistics `json:"wireless,omitempty"`
|
2016-03-12 12:32:55 +00:00
|
|
|
}
|
|
|
|
|
2017-01-20 21:27:44 +00:00
|
|
|
// MeshVPNPeerLink struct
|
2016-03-12 12:32:55 +00:00
|
|
|
type MeshVPNPeerLink struct {
|
|
|
|
Established float64 `json:"established"`
|
|
|
|
}
|
|
|
|
|
2017-01-20 21:27:44 +00:00
|
|
|
// MeshVPNPeerGroup struct
|
2016-03-12 12:32:55 +00:00
|
|
|
type MeshVPNPeerGroup struct {
|
|
|
|
Peers map[string]*MeshVPNPeerLink `json:"peers"`
|
|
|
|
Groups map[string]*MeshVPNPeerGroup `json:"groups"`
|
|
|
|
}
|
|
|
|
|
2017-01-20 21:27:44 +00:00
|
|
|
// MeshVPN struct
|
2016-03-12 12:32:55 +00:00
|
|
|
type MeshVPN struct {
|
|
|
|
Groups map[string]*MeshVPNPeerGroup `json:"groups,omitempty"`
|
|
|
|
}
|
|
|
|
|
2017-01-20 21:27:44 +00:00
|
|
|
// Traffic struct
|
2016-03-19 02:08:19 +00:00
|
|
|
type Traffic struct {
|
2016-03-12 12:32:55 +00:00
|
|
|
Bytes float64 `json:"bytes,omitempty"`
|
|
|
|
Packets float64 `json:"packets,omitempty"`
|
|
|
|
Dropped float64 `json:"dropped,omitempty"`
|
|
|
|
}
|
|
|
|
|
2017-01-20 21:27:44 +00:00
|
|
|
// Clients struct
|
2016-03-12 12:32:55 +00:00
|
|
|
type Clients struct {
|
|
|
|
Wifi uint32 `json:"wifi"`
|
|
|
|
Wifi24 uint32 `json:"wifi24"`
|
|
|
|
Wifi5 uint32 `json:"wifi5"`
|
|
|
|
Total uint32 `json:"total"`
|
|
|
|
}
|
|
|
|
|
2017-01-20 21:27:44 +00:00
|
|
|
// Memory struct
|
2016-03-12 12:32:55 +00:00
|
|
|
type Memory struct {
|
2016-03-23 21:19:53 +00:00
|
|
|
Cached uint32 `json:"cached"`
|
|
|
|
Total uint32 `json:"total"`
|
|
|
|
Buffers uint32 `json:"buffers"`
|
|
|
|
Free uint32 `json:"free"`
|
2016-03-12 12:32:55 +00:00
|
|
|
}
|
2016-07-13 23:19:03 +00:00
|
|
|
|
2017-01-20 21:27:44 +00:00
|
|
|
// SwitchPort struct
|
2016-07-13 23:19:03 +00:00
|
|
|
type SwitchPort struct {
|
|
|
|
Speed uint32 `json:"speed"`
|
|
|
|
}
|