vnStat
- async OPNsenseClient.get_vnstat_metrics(period)
Return parsed vnStat traffic rows for one supported reporting period.
- Parameters:
period (str) – Requested vnStat period identifier. Supported values are
hourly,daily,monthly, andyearly.- Returns:
- Parsed vnStat payload containing the selected
periodand aninterfacesmapping of interface names to traffic rows. Returns an empty mapping for unsupported periods or when no interface rows are available.
- Return type:
- async OPNsenseClient.get_vnstat()
Collect summarized vnStat usage data across available interfaces.
- Returns:
- Mapping with
interfaceskeyed by interface name and
interface_count. Each interface contains parsedhourly,daily, andmonthlyrows plus convenience byte counters for today, this month, yesterday, last month, and the last complete hour. An hourly 404 returns an empty summary. A daily or monthly 404 supplies empty rows for that period. Other failed or undecodable period reads returnNonewiththrow_errorsdisabled and raise anOPNsenseErrorwith it enabled.
- Mapping with
- Return type:
MutableMapping[str, Any] | None