Update to v8.2.93

This commit is contained in:
appkins
2024-06-06 11:49:05 -05:00
parent 971b9fc3b0
commit 85af09f5e0
21 changed files with 1373 additions and 361 deletions

View File

@@ -39,6 +39,7 @@ type Device struct {
Disabled bool `json:"disabled,omitempty"`
Dot1XFallbackNetworkID string `json:"dot1x_fallback_networkconf_id,omitempty"` // [\d\w]+|
Dot1XPortctrlEnabled bool `json:"dot1x_portctrl_enabled,omitempty"`
EtherLighting DeviceEtherLighting `json:"ether_lighting,omitempty"`
EthernetOverrides []DeviceEthernetOverrides `json:"ethernet_overrides,omitempty"`
FlowctrlEnabled bool `json:"flowctrl_enabled,omitempty"`
GatewayVrrpMode string `json:"gateway_vrrp_mode,omitempty"` // primary|secondary
@@ -81,8 +82,11 @@ type Device struct {
OutletEnabled bool `json:"outlet_enabled,omitempty"`
OutletOverrides []DeviceOutletOverrides `json:"outlet_overrides,omitempty"`
OutletPowerCycleEnabled bool `json:"outlet_power_cycle_enabled,omitempty"`
PeerToPeerMode string `json:"peer_to_peer_mode,omitempty"` // ap|sta
PoeMode string `json:"poe_mode,omitempty"` // auto|pasv24|passthrough|off
PortOverrides []DevicePortOverrides `json:"port_overrides"`
PowerSourceCtrl string `json:"power_source_ctrl,omitempty"` // auto|8023af|8023at|8023bt-type3|8023bt-type4|pasv24|poe-injector|ac|adapter|dc|rps
PowerSourceCtrl string `json:"power_source_ctrl,omitempty"` // auto|8023af|8023at|8023bt-type3|8023bt-type4|pasv24|poe-injector|ac|adapter|dc|rps
PowerSourceCtrlBudget int `json:"power_source_ctrl_budget,omitempty"` // [0-9]|[1-9][0-9]|[1-9][0-9][0-9]
PowerSourceCtrlEnabled bool `json:"power_source_ctrl_enabled,omitempty"`
RADIUSProfileID string `json:"radiusprofile_id,omitempty"`
RadioTable []DeviceRadioTable `json:"radio_table,omitempty"`
@@ -97,7 +101,6 @@ type Device struct {
Type string `json:"type,omitempty"`
UbbPairName string `json:"ubb_pair_name,omitempty"` // .{1,128}
Volume int `json:"volume,omitempty"` // [0-9]|[1-9][0-9]|100
WLANOverrides []DeviceWLANOverrides `json:"wlan_overrides,omitempty"`
X float64 `json:"x,omitempty"`
XBaresipPassword string `json:"x_baresip_password,omitempty"` // ^[a-zA-Z0-9_.\-!~*'()]*
Y float64 `json:"y,omitempty"`
@@ -115,6 +118,7 @@ func (dst *Device) UnmarshalJSON(b []byte) error {
LtePoe booleanishString `json:"lte_poe"`
LteSimPin emptyStringInt `json:"lte_sim_pin"`
LteSoftLimit emptyStringInt `json:"lte_soft_limit"`
PowerSourceCtrlBudget emptyStringInt `json:"power_source_ctrl_budget"`
StpPriority numberOrString `json:"stp_priority"`
Volume emptyStringInt `json:"volume"`
@@ -136,6 +140,7 @@ func (dst *Device) UnmarshalJSON(b []byte) error {
dst.LtePoe = bool(aux.LtePoe)
dst.LteSimPin = int(aux.LteSimPin)
dst.LteSoftLimit = int(aux.LteSoftLimit)
dst.PowerSourceCtrlBudget = int(aux.PowerSourceCtrlBudget)
dst.StpPriority = string(aux.StpPriority)
dst.Volume = int(aux.Volume)
@@ -189,6 +194,31 @@ func (dst *DeviceConnectedBatteryOverrides) UnmarshalJSON(b []byte) error {
return nil
}
type DeviceEtherLighting struct {
Behavior string `json:"behavior,omitempty"` // breath|steady
Brightness int `json:"brightness,omitempty"` // [1-9]|[1-9][0-9]|100
Mode string `json:"mode,omitempty"` // speed|network
}
func (dst *DeviceEtherLighting) UnmarshalJSON(b []byte) error {
type Alias DeviceEtherLighting
aux := &struct {
Brightness emptyStringInt `json:"brightness"`
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
dst.Brightness = int(aux.Brightness)
return nil
}
type DeviceEthernetOverrides struct {
Ifname string `json:"ifname,omitempty"` // eth[0-9]{1,2}
NetworkGroup string `json:"networkgroup,omitempty"` // LAN[2-8]?|WAN[2]?
@@ -237,46 +267,49 @@ func (dst *DeviceOutletOverrides) UnmarshalJSON(b []byte) error {
}
type DevicePortOverrides struct {
AggregateNumPorts int `json:"aggregate_num_ports,omitempty"` // [2-8]
Autoneg bool `json:"autoneg,omitempty"`
Dot1XCtrl string `json:"dot1x_ctrl,omitempty"` // auto|force_authorized|force_unauthorized|mac_based|multi_host
Dot1XIDleTimeout int `json:"dot1x_idle_timeout,omitempty"` // [0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]
EgressRateLimitKbps int `json:"egress_rate_limit_kbps,omitempty"` // 6[4-9]|[7-9][0-9]|[1-9][0-9]{2,6}
EgressRateLimitKbpsEnabled bool `json:"egress_rate_limit_kbps_enabled,omitempty"`
ExcludedNetworkIDs []string `json:"excluded_networkconf_ids,omitempty"`
Forward string `json:"forward,omitempty"` // all|native|customize|disabled
FullDuplex bool `json:"full_duplex,omitempty"`
Isolation bool `json:"isolation,omitempty"`
LldpmedEnabled bool `json:"lldpmed_enabled,omitempty"`
LldpmedNotifyEnabled bool `json:"lldpmed_notify_enabled,omitempty"`
MirrorPortIDX int `json:"mirror_port_idx,omitempty"` // [1-9]|[1-4][0-9]|5[0-2]
NATiveNetworkID string `json:"native_networkconf_id,omitempty"`
Name string `json:"name,omitempty"` // .{0,128}
OpMode string `json:"op_mode,omitempty"` // switch|mirror|aggregate
PoeMode string `json:"poe_mode,omitempty"` // auto|pasv24|passthrough|off
PortIDX int `json:"port_idx,omitempty"` // [1-9]|[1-4][0-9]|5[0-2]
PortProfileID string `json:"portconf_id,omitempty"` // [\d\w]+
PortSecurityEnabled bool `json:"port_security_enabled,omitempty"`
PortSecurityMACAddress []string `json:"port_security_mac_address,omitempty"` // ^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$
PriorityQueue1Level int `json:"priority_queue1_level,omitempty"` // [0-9]|[1-9][0-9]|100
PriorityQueue2Level int `json:"priority_queue2_level,omitempty"` // [0-9]|[1-9][0-9]|100
PriorityQueue3Level int `json:"priority_queue3_level,omitempty"` // [0-9]|[1-9][0-9]|100
PriorityQueue4Level int `json:"priority_queue4_level,omitempty"` // [0-9]|[1-9][0-9]|100
SettingPreference string `json:"setting_preference,omitempty"` // auto|manual
ShowTrafficRestrictionAsAllowlist bool `json:"show_traffic_restriction_as_allowlist,omitempty"`
Speed int `json:"speed,omitempty"` // 10|100|1000|2500|5000|10000|20000|25000|40000|50000|100000
StormctrlBroadcastastEnabled bool `json:"stormctrl_bcast_enabled,omitempty"`
StormctrlBroadcastastLevel int `json:"stormctrl_bcast_level,omitempty"` // [0-9]|[1-9][0-9]|100
StormctrlBroadcastastRate int `json:"stormctrl_bcast_rate,omitempty"` // [0-9]|[1-9][0-9]{1,6}|1[0-3][0-9]{6}|14[0-7][0-9]{5}|148[0-7][0-9]{4}|14880000
StormctrlMcastEnabled bool `json:"stormctrl_mcast_enabled,omitempty"`
StormctrlMcastLevel int `json:"stormctrl_mcast_level,omitempty"` // [0-9]|[1-9][0-9]|100
StormctrlMcastRate int `json:"stormctrl_mcast_rate,omitempty"` // [0-9]|[1-9][0-9]{1,6}|1[0-3][0-9]{6}|14[0-7][0-9]{5}|148[0-7][0-9]{4}|14880000
StormctrlType string `json:"stormctrl_type,omitempty"` // level|rate
StormctrlUcastEnabled bool `json:"stormctrl_ucast_enabled,omitempty"`
StormctrlUcastLevel int `json:"stormctrl_ucast_level,omitempty"` // [0-9]|[1-9][0-9]|100
StormctrlUcastRate int `json:"stormctrl_ucast_rate,omitempty"` // [0-9]|[1-9][0-9]{1,6}|1[0-3][0-9]{6}|14[0-7][0-9]{5}|148[0-7][0-9]{4}|14880000
StpPortMode bool `json:"stp_port_mode,omitempty"`
VoiceNetworkID string `json:"voice_networkconf_id,omitempty"`
AggregateNumPorts int `json:"aggregate_num_ports,omitempty"` // [1-8]
Autoneg bool `json:"autoneg,omitempty"`
Dot1XCtrl string `json:"dot1x_ctrl,omitempty"` // auto|force_authorized|force_unauthorized|mac_based|multi_host
Dot1XIDleTimeout int `json:"dot1x_idle_timeout,omitempty"` // [0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]
EgressRateLimitKbps int `json:"egress_rate_limit_kbps,omitempty"` // 6[4-9]|[7-9][0-9]|[1-9][0-9]{2,6}
EgressRateLimitKbpsEnabled bool `json:"egress_rate_limit_kbps_enabled,omitempty"`
ExcludedNetworkIDs []string `json:"excluded_networkconf_ids,omitempty"`
FecMode string `json:"fec_mode,omitempty"` // rs-fec|fc-fec|default|disabled
Forward string `json:"forward,omitempty"` // all|native|customize|disabled
FullDuplex bool `json:"full_duplex,omitempty"`
Isolation bool `json:"isolation,omitempty"`
LldpmedEnabled bool `json:"lldpmed_enabled,omitempty"`
LldpmedNotifyEnabled bool `json:"lldpmed_notify_enabled,omitempty"`
MirrorPortIDX int `json:"mirror_port_idx,omitempty"` // [1-9]|[1-4][0-9]|5[0-2]
NATiveNetworkID string `json:"native_networkconf_id,omitempty"`
Name string `json:"name,omitempty"` // .{0,128}
OpMode string `json:"op_mode,omitempty"` // switch|mirror|aggregate
PoeMode string `json:"poe_mode,omitempty"` // auto|pasv24|passthrough|off
PortIDX int `json:"port_idx,omitempty"` // [1-9]|[1-4][0-9]|5[0-2]
PortKeepaliveEnabled bool `json:"port_keepalive_enabled,omitempty"`
PortProfileID string `json:"portconf_id,omitempty"` // [\d\w]+
PortSecurityEnabled bool `json:"port_security_enabled,omitempty"`
PortSecurityMACAddress []string `json:"port_security_mac_address,omitempty"` // ^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$
PriorityQueue1Level int `json:"priority_queue1_level,omitempty"` // [0-9]|[1-9][0-9]|100
PriorityQueue2Level int `json:"priority_queue2_level,omitempty"` // [0-9]|[1-9][0-9]|100
PriorityQueue3Level int `json:"priority_queue3_level,omitempty"` // [0-9]|[1-9][0-9]|100
PriorityQueue4Level int `json:"priority_queue4_level,omitempty"` // [0-9]|[1-9][0-9]|100
QOSProfile DeviceQOSProfile `json:"qos_profile,omitempty"`
SettingPreference string `json:"setting_preference,omitempty"` // auto|manual
Speed int `json:"speed,omitempty"` // 10|100|1000|2500|5000|10000|20000|25000|40000|50000|100000
StormctrlBroadcastastEnabled bool `json:"stormctrl_bcast_enabled,omitempty"`
StormctrlBroadcastastLevel int `json:"stormctrl_bcast_level,omitempty"` // [0-9]|[1-9][0-9]|100
StormctrlBroadcastastRate int `json:"stormctrl_bcast_rate,omitempty"` // [0-9]|[1-9][0-9]{1,6}|1[0-3][0-9]{6}|14[0-7][0-9]{5}|148[0-7][0-9]{4}|14880000
StormctrlMcastEnabled bool `json:"stormctrl_mcast_enabled,omitempty"`
StormctrlMcastLevel int `json:"stormctrl_mcast_level,omitempty"` // [0-9]|[1-9][0-9]|100
StormctrlMcastRate int `json:"stormctrl_mcast_rate,omitempty"` // [0-9]|[1-9][0-9]{1,6}|1[0-3][0-9]{6}|14[0-7][0-9]{5}|148[0-7][0-9]{4}|14880000
StormctrlType string `json:"stormctrl_type,omitempty"` // level|rate
StormctrlUcastEnabled bool `json:"stormctrl_ucast_enabled,omitempty"`
StormctrlUcastLevel int `json:"stormctrl_ucast_level,omitempty"` // [0-9]|[1-9][0-9]|100
StormctrlUcastRate int `json:"stormctrl_ucast_rate,omitempty"` // [0-9]|[1-9][0-9]{1,6}|1[0-3][0-9]{6}|14[0-7][0-9]{5}|148[0-7][0-9]{4}|14880000
StpPortMode bool `json:"stp_port_mode,omitempty"`
TaggedVLANMgmt string `json:"tagged_vlan_mgmt,omitempty"` // auto|block_all|custom
VoiceNetworkID string `json:"voice_networkconf_id,omitempty"`
}
func (dst *DevicePortOverrides) UnmarshalJSON(b []byte) error {
@@ -328,24 +361,157 @@ func (dst *DevicePortOverrides) UnmarshalJSON(b []byte) error {
return nil
}
type DeviceQOSMarking struct {
CosCode int `json:"cos_code,omitempty"` // [0-7]
DscpCode int `json:"dscp_code,omitempty"` // 0|8|16|24|32|40|48|56|10|12|14|18|20|22|26|28|30|34|36|38|44|46
IPPrecedenceCode int `json:"ip_precedence_code,omitempty"` // [0-7]
Queue int `json:"queue,omitempty"` // [0-7]
}
func (dst *DeviceQOSMarking) UnmarshalJSON(b []byte) error {
type Alias DeviceQOSMarking
aux := &struct {
CosCode emptyStringInt `json:"cos_code"`
DscpCode emptyStringInt `json:"dscp_code"`
IPPrecedenceCode emptyStringInt `json:"ip_precedence_code"`
Queue emptyStringInt `json:"queue"`
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
dst.CosCode = int(aux.CosCode)
dst.DscpCode = int(aux.DscpCode)
dst.IPPrecedenceCode = int(aux.IPPrecedenceCode)
dst.Queue = int(aux.Queue)
return nil
}
type DeviceQOSMatching struct {
CosCode int `json:"cos_code,omitempty"` // [0-7]
DscpCode int `json:"dscp_code,omitempty"` // [0-9]|[1-5][0-9]|6[0-3]
DstPort int `json:"dst_port,omitempty"` // [0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-4]|65535
IPPrecedenceCode int `json:"ip_precedence_code,omitempty"` // [0-7]
Protocol string `json:"protocol,omitempty"` // ([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|ah|ax.25|dccp|ddp|egp|eigrp|encap|esp|etherip|fc|ggp|gre|hip|hmp|icmp|idpr-cmtp|idrp|igmp|igp|ip|ipcomp|ipencap|ipip|ipv6|ipv6-frag|ipv6-icmp|ipv6-nonxt|ipv6-opts|ipv6-route|isis|iso-tp4|l2tp|manet|mobility-header|mpls-in-ip|ospf|pim|pup|rdp|rohc|rspf|rsvp|sctp|shim6|skip|st|tcp|udp|udplite|vmtp|vrrp|wesp|xns-idp|xtp
SrcPort int `json:"src_port,omitempty"` // [0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-4]|65535
}
func (dst *DeviceQOSMatching) UnmarshalJSON(b []byte) error {
type Alias DeviceQOSMatching
aux := &struct {
CosCode emptyStringInt `json:"cos_code"`
DscpCode emptyStringInt `json:"dscp_code"`
DstPort emptyStringInt `json:"dst_port"`
IPPrecedenceCode emptyStringInt `json:"ip_precedence_code"`
SrcPort emptyStringInt `json:"src_port"`
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
dst.CosCode = int(aux.CosCode)
dst.DscpCode = int(aux.DscpCode)
dst.DstPort = int(aux.DstPort)
dst.IPPrecedenceCode = int(aux.IPPrecedenceCode)
dst.SrcPort = int(aux.SrcPort)
return nil
}
type DeviceQOSPolicies struct {
QOSMarking DeviceQOSMarking `json:"qos_marking,omitempty"`
QOSMatching DeviceQOSMatching `json:"qos_matching,omitempty"`
}
func (dst *DeviceQOSPolicies) UnmarshalJSON(b []byte) error {
type Alias DeviceQOSPolicies
aux := &struct {
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
return nil
}
type DeviceQOSProfile struct {
QOSPolicies []DeviceQOSPolicies `json:"qos_policies,omitempty"`
QOSProfileMode string `json:"qos_profile_mode,omitempty"` // custom|unifi_play|aes67_audio|crestron_audio_video|dante_audio|ndi_aes67_audio|ndi_dante_audio|qsys_audio_video|qsys_video_dante_audio|sdvoe_aes67_audio|sdvoe_dante_audio|shure_audio
}
func (dst *DeviceQOSProfile) UnmarshalJSON(b []byte) error {
type Alias DeviceQOSProfile
aux := &struct {
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
return nil
}
type DeviceRadioIDentifiers struct {
DeviceID string `json:"device_id,omitempty"`
RadioName string `json:"radio_name,omitempty"`
}
func (dst *DeviceRadioIDentifiers) UnmarshalJSON(b []byte) error {
type Alias DeviceRadioIDentifiers
aux := &struct {
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
return nil
}
type DeviceRadioTable struct {
AntennaGain int `json:"antenna_gain,omitempty"` // ^-?([0-9]|[1-9][0-9])
AntennaID int `json:"antenna_id,omitempty"` // -1|[0-9]
BackupChannel string `json:"backup_channel,omitempty"` // [0-9]|[1][0-4]|4.5|5|16|21|33|34|36|37|38|40|41|42|44|45|46|48|49|52|53|56|57|60|61|64|65|69|73|77|81|85|89|93|97|100|101|104|105|108|109|112|113|117|116|120|121|124|125|128|129|132|133|136|137|140|141|144|145|149|153|157|161|165|169|173|177|181|183|184|185|187|188|189|192|193|196|197|201|205|209|213|217|221|225|229|233|auto
Channel string `json:"channel,omitempty"` // [0-9]|[1][0-4]|4.5|5|16|21|33|34|36|37|38|40|41|42|44|45|46|48|49|52|53|56|57|60|61|64|65|69|73|77|81|85|89|93|97|100|101|104|105|108|109|112|113|117|116|120|121|124|125|128|129|132|133|136|137|140|141|144|145|149|153|157|161|165|169|173|177|181|183|184|185|187|188|189|192|193|196|197|201|205|209|213|217|221|225|229|233|auto
HardNoiseFloorEnabled bool `json:"hard_noise_floor_enabled,omitempty"`
Ht int `json:"ht,omitempty"` // 20|40|80|160|1080|2160|4320
LoadbalanceEnabled bool `json:"loadbalance_enabled,omitempty"`
Maxsta int `json:"maxsta,omitempty"` // [1-9]|[1-9][0-9]|1[0-9]{2}|200|^$
MinRssi int `json:"min_rssi,omitempty"` // ^-(6[7-9]|[7-8][0-9]|90)$
MinRssiEnabled bool `json:"min_rssi_enabled,omitempty"`
Name string `json:"name,omitempty"`
Radio string `json:"radio,omitempty"` // ng|na|ad|6e
SensLevel int `json:"sens_level,omitempty"` // ^-([5-8][0-9]|90)$
SensLevelEnabled bool `json:"sens_level_enabled,omitempty"`
TxPower string `json:"tx_power,omitempty"` // [\d]+|auto
TxPowerMode string `json:"tx_power_mode,omitempty"` // auto|medium|high|low|custom
VwireEnabled bool `json:"vwire_enabled,omitempty"`
AntennaGain int `json:"antenna_gain,omitempty"` // ^-?([0-9]|[1-9][0-9])
AntennaID int `json:"antenna_id,omitempty"` // -1|[0-9]
BackupChannel string `json:"backup_channel,omitempty"` // [0-9]|[1][0-4]|4.5|5|16|21|33|34|36|37|38|40|41|42|44|45|46|48|49|52|53|56|57|60|61|64|65|69|73|77|81|85|89|93|97|100|101|104|105|108|109|112|113|117|116|120|121|124|125|128|129|132|133|136|137|140|141|144|145|149|153|157|161|165|169|173|177|181|183|184|185|187|188|189|192|193|196|197|201|205|209|213|217|221|225|229|233|auto
Channel string `json:"channel,omitempty"` // [0-9]|[1][0-4]|4.5|5|16|21|33|34|36|37|38|40|41|42|44|45|46|48|49|52|53|56|57|60|61|64|65|69|73|77|81|85|89|93|97|100|101|104|105|108|109|112|113|117|116|120|121|124|125|128|129|132|133|136|137|140|141|144|145|149|153|157|161|165|169|173|177|181|183|184|185|187|188|189|192|193|196|197|201|205|209|213|217|221|225|229|233|auto
ChannelOptimizationEnabled bool `json:"channel_optimization_enabled,omitempty"`
HardNoiseFloorEnabled bool `json:"hard_noise_floor_enabled,omitempty"`
Ht int `json:"ht,omitempty"` // 20|40|80|160|240|320|1080|2160|4320
LoadbalanceEnabled bool `json:"loadbalance_enabled,omitempty"`
Maxsta int `json:"maxsta,omitempty"` // [1-9]|[1-9][0-9]|1[0-9]{2}|200|^$
MinRssi int `json:"min_rssi,omitempty"` // ^-(6[7-9]|[7-8][0-9]|90)$
MinRssiEnabled bool `json:"min_rssi_enabled,omitempty"`
Name string `json:"name,omitempty"`
Radio string `json:"radio,omitempty"` // ng|na|ad|6e
RadioIDentifiers []DeviceRadioIDentifiers `json:"radio_identifiers,omitempty"`
SensLevel int `json:"sens_level,omitempty"` // ^-([5-8][0-9]|90)$
SensLevelEnabled bool `json:"sens_level_enabled,omitempty"`
TxPower string `json:"tx_power,omitempty"` // [\d]+|auto
TxPowerMode string `json:"tx_power_mode,omitempty"` // auto|medium|high|low|custom
VwireEnabled bool `json:"vwire_enabled,omitempty"`
}
func (dst *DeviceRadioTable) UnmarshalJSON(b []byte) error {
@@ -429,38 +595,6 @@ func (dst *DeviceRpsPortTable) UnmarshalJSON(b []byte) error {
return nil
}
type DeviceWLANOverrides struct {
Enabled bool `json:"enabled,omitempty"`
Name string `json:"name,omitempty"` // .{1,32}
NameCombineEnabled bool `json:"name_combine_enabled,omitempty"`
NameCombineSuffix string `json:"name_combine_suffix,omitempty"` // .{0,8}
Radio string `json:"radio,omitempty"` // ng|na
RadioName string `json:"radio_name,omitempty"`
VLAN int `json:"vlan,omitempty"` // [2-9]|[1-9][0-9]{1,2}|[1-3][0-9]{3}|40[0-8][0-9]|409[0-5]|^$
VLANEnabled bool `json:"vlan_enabled,omitempty"`
WLANID string `json:"wlan_id,omitempty"` // [\d\w]+
XPassphrase string `json:"x_passphrase,omitempty"` // [\x20-\x7E]{8,255}|[0-9a-fA-F]{64}
}
func (dst *DeviceWLANOverrides) UnmarshalJSON(b []byte) error {
type Alias DeviceWLANOverrides
aux := &struct {
VLAN emptyStringInt `json:"vlan"`
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
dst.VLAN = int(aux.VLAN)
return nil
}
func (c *Client) listDevice(ctx context.Context, site string) ([]Device, error) {
var respBody struct {
Meta meta `json:"meta"`