Merge pull request #49 from unifi-poller/dn2_spf

Add SFP data to a Port.
This commit is contained in:
David Newhall 2021-03-14 17:09:17 -07:00 committed by GitHub
commit 98e070a338
1 changed files with 78 additions and 62 deletions

View File

@ -100,68 +100,84 @@ type MacTable struct {
// Port is a physical connection on a USW or Gateway. // Port is a physical connection on a USW or Gateway.
// Not every port has the same capabilities. // Not every port has the same capabilities.
type Port struct { type Port struct {
AggregatedBy FlexBool `json:"aggregated_by"` AggregatedBy FlexBool `json:"aggregated_by"`
Autoneg FlexBool `json:"autoneg,omitempty"` Autoneg FlexBool `json:"autoneg,omitempty"`
BytesR FlexInt `json:"bytes-r"` BytesR FlexInt `json:"bytes-r"`
DNS []string `json:"dns,omitempty"` DNS []string `json:"dns,omitempty"`
Dot1XMode string `json:"dot1x_mode"` Dot1XMode string `json:"dot1x_mode"`
Dot1XStatus string `json:"dot1x_status"` Dot1XStatus string `json:"dot1x_status"`
Enable FlexBool `json:"enable"` Enable FlexBool `json:"enable"`
FlowctrlRx FlexBool `json:"flowctrl_rx"` FlowctrlRx FlexBool `json:"flowctrl_rx"`
FlowctrlTx FlexBool `json:"flowctrl_tx"` FlowctrlTx FlexBool `json:"flowctrl_tx"`
FullDuplex FlexBool `json:"full_duplex"` FullDuplex FlexBool `json:"full_duplex"`
IP string `json:"ip,omitempty"` IP string `json:"ip,omitempty"`
Ifname string `json:"ifname,omitempty"` Ifname string `json:"ifname,omitempty"`
IsUplink FlexBool `json:"is_uplink"` IsUplink FlexBool `json:"is_uplink"`
Mac string `json:"mac,omitempty"` Mac string `json:"mac,omitempty"`
MacTable []MacTable `json:"mac_table,omitempty"` MacTable []MacTable `json:"mac_table,omitempty"`
Jumbo FlexBool `json:"jumbo,omitempty"` Jumbo FlexBool `json:"jumbo,omitempty"`
Masked FlexBool `json:"masked"` Masked FlexBool `json:"masked"`
Media string `json:"media"` Media string `json:"media"`
Name string `json:"name"` Name string `json:"name"`
NetworkName string `json:"network_name,omitempty"` NetworkName string `json:"network_name,omitempty"`
Netmask string `json:"netmask,omitempty"` Netmask string `json:"netmask,omitempty"`
NumPort int `json:"num_port,omitempty"` NumPort int `json:"num_port,omitempty"`
OpMode string `json:"op_mode"` OpMode string `json:"op_mode"`
PoeCaps FlexInt `json:"poe_caps"` PoeCaps FlexInt `json:"poe_caps"`
PoeClass string `json:"poe_class,omitempty"` PoeClass string `json:"poe_class,omitempty"`
PoeCurrent FlexInt `json:"poe_current,omitempty"` PoeCurrent FlexInt `json:"poe_current,omitempty"`
PoeEnable FlexBool `json:"poe_enable,omitempty"` PoeEnable FlexBool `json:"poe_enable,omitempty"`
PoeGood FlexBool `json:"poe_good,omitempty"` PoeGood FlexBool `json:"poe_good,omitempty"`
PoeMode string `json:"poe_mode,omitempty"` PoeMode string `json:"poe_mode,omitempty"`
PoePower FlexInt `json:"poe_power,omitempty"` PoePower FlexInt `json:"poe_power,omitempty"`
PoeVoltage FlexInt `json:"poe_voltage,omitempty"` PoeVoltage FlexInt `json:"poe_voltage,omitempty"`
PortDelta struct { PortDelta PortDelta `json:"port_delta,omitempty"`
TimeDelta int64 `json:"time_delta"` PortIdx FlexInt `json:"port_idx"`
TimeDeltaActivity int64 `json:"time_delta_activity"` PortPoe FlexBool `json:"port_poe"`
} `json:"port_delta,omitempty"` PortconfID string `json:"portconf_id"`
PortIdx FlexInt `json:"port_idx"` RxBroadcast FlexInt `json:"rx_broadcast"`
PortPoe FlexBool `json:"port_poe"` RxBytes FlexInt `json:"rx_bytes"`
PortconfID string `json:"portconf_id"` RxBytesR FlexInt `json:"rx_bytes-r"`
RxBroadcast FlexInt `json:"rx_broadcast"` RxDropped FlexInt `json:"rx_dropped"`
RxBytes FlexInt `json:"rx_bytes"` RxErrors FlexInt `json:"rx_errors"`
RxBytesR FlexInt `json:"rx_bytes-r"` RxMulticast FlexInt `json:"rx_multicast"`
RxDropped FlexInt `json:"rx_dropped"` RxPackets FlexInt `json:"rx_packets"`
RxErrors FlexInt `json:"rx_errors"` RxRate FlexInt `json:"rx_rate,omitempty"`
RxMulticast FlexInt `json:"rx_multicast"` Satisfaction FlexInt `json:"satisfaction,omitempty"`
RxPackets FlexInt `json:"rx_packets"` SatisfactionReason FlexInt `json:"satisfaction_reason"`
RxRate FlexInt `json:"rx_rate,omitempty"` SFPCompliance string `json:"sfp_compliance"`
Satisfaction FlexInt `json:"satisfaction,omitempty"` SFPCurrent FlexInt `json:"sfp_current"`
SfpFound FlexBool `json:"sfp_found,omitempty"` SFPFound FlexBool `json:"sfp_found"`
Speed FlexInt `json:"speed"` SFPPart string `json:"sfp_part"`
SpeedCaps FlexInt `json:"speed_caps"` SFPRev string `json:"sfp_rev"`
StpPathcost FlexInt `json:"stp_pathcost"` SFPRxfault FlexBool `json:"sfp_rxfault"`
StpState string `json:"stp_state"` SFPRxpower FlexInt `json:"sfp_rxpower"`
TxBroadcast FlexInt `json:"tx_broadcast"` SFPSerial string `json:"sfp_serial"`
TxBytes FlexInt `json:"tx_bytes"` SFPTemperature FlexInt `json:"sfp_temperature"`
TxBytesR FlexInt `json:"tx_bytes-r"` SFPTxfault FlexBool `json:"sfp_txfault"`
TxDropped FlexInt `json:"tx_dropped"` SFPTxpower FlexInt `json:"sfp_txpower"`
TxErrors FlexInt `json:"tx_errors"` SFPVendor string `json:"sfp_vendor"`
TxMulticast FlexInt `json:"tx_multicast"` SFPVoltage FlexInt `json:"sfp_voltage"`
TxPackets FlexInt `json:"tx_packets"` Speed FlexInt `json:"speed"`
TxRate FlexInt `json:"tx_rate,omitempty"` SpeedCaps FlexInt `json:"speed_caps"`
Type string `json:"type,omitempty"` StpPathcost FlexInt `json:"stp_pathcost"`
Up FlexBool `json:"up"` StpState string `json:"stp_state"`
TxBroadcast FlexInt `json:"tx_broadcast"`
TxBytes FlexInt `json:"tx_bytes"`
TxBytesR FlexInt `json:"tx_bytes-r"`
TxDropped FlexInt `json:"tx_dropped"`
TxErrors FlexInt `json:"tx_errors"`
TxMulticast FlexInt `json:"tx_multicast"`
TxPackets FlexInt `json:"tx_packets"`
TxRate FlexInt `json:"tx_rate,omitempty"`
Type string `json:"type,omitempty"`
Up FlexBool `json:"up"`
}
// PortDelta is part of a Port.
type PortDelta struct {
TimeDelta FlexInt `json:"time_delta"`
TimeDeltaActivity FlexInt `json:"time_delta_activity"`
} }
// USWStat holds the "stat" data for a switch. // USWStat holds the "stat" data for a switch.