Refactor type generator
* Allows for generating top-level types for any embedded struct so
that sub-types can be properly instantiated from calling code
* Specifying `-no-embedded-types` will generate top-level types
rather than embedding the struct
* Refactored "Device" API
* All fields set to `omitempty` because it describes all possible
device types, so effectively any field could be omitted any time
* Fixed `get` call for "Device" API; replacing `rest` with `stat`
* Generated `get` and `update` calls for `Setting*` APIs
* Added `5.14.23` JSON files
This commit is contained in:
committed by
Paul Tyng
parent
79542b4006
commit
35eda4f67b
@@ -23,114 +23,111 @@ type Device struct {
|
||||
NoDelete bool `json:"attr_no_delete,omitempty"`
|
||||
NoEdit bool `json:"attr_no_edit,omitempty"`
|
||||
|
||||
AtfEnabled bool `json:"atf_enabled"`
|
||||
AtfEnabled bool `json:"atf_enabled,omitempty"`
|
||||
BandsteeringMode string `json:"bandsteering_mode,omitempty"` // off|equal|prefer_5g
|
||||
BaresipAuthUser string `json:"baresip_auth_user,omitempty"` // ^\+?[a-zA-Z0-9_.\-!~*'()]*
|
||||
BaresipEnabled bool `json:"baresip_enabled"`
|
||||
BaresipEnabled bool `json:"baresip_enabled,omitempty"`
|
||||
BaresipExtension string `json:"baresip_extension,omitempty"` // ^\+?[a-zA-Z0-9_.\-!~*'()]*
|
||||
ConfigNetwork struct {
|
||||
BondingEnabled bool `json:"bonding_enabled"`
|
||||
DNS1 string `json:"dns1"` // ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$|^$
|
||||
DNS2 string `json:"dns2"` // ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$|^$
|
||||
BondingEnabled bool `json:"bonding_enabled,omitempty"`
|
||||
DNS1 string `json:"dns1,omitempty"` // ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$|^$
|
||||
DNS2 string `json:"dns2,omitempty"` // ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$|^$
|
||||
DNSsuffix string `json:"dnssuffix,omitempty"`
|
||||
Gateway string `json:"gateway"` // ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^$
|
||||
Gateway string `json:"gateway,omitempty"` // ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^$
|
||||
IP string `json:"ip,omitempty"` // ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$
|
||||
Netmask string `json:"netmask,omitempty"` // ^((128|192|224|240|248|252|254)\.0\.0\.0)|(255\.(((0|128|192|224|240|248|252|254)\.0\.0)|(255\.(((0|128|192|224|240|248|252|254)\.0)|255\.(0|128|192|224|240|248|252|254)))))$
|
||||
Type string `json:"type,omitempty"` // dhcp|static
|
||||
|
||||
} `json:"config_network"`
|
||||
Disabled bool `json:"disabled"`
|
||||
Dot1XFallbackNetworkID string `json:"dot1x_fallback_networkconf_id"` // [\d\w]+|
|
||||
Dot1XPortctrlEnabled bool `json:"dot1x_portctrl_enabled"`
|
||||
DPIEnabled bool `json:"dpi_enabled"`
|
||||
} `json:"config_network,omitempty"`
|
||||
DPIEnabled bool `json:"dpi_enabled,omitempty"`
|
||||
Disabled bool `json:"disabled,omitempty"`
|
||||
Dot1XFallbackNetworkID string `json:"dot1x_fallback_networkconf_id,omitempty"` // [\d\w]+|
|
||||
Dot1XPortctrlEnabled bool `json:"dot1x_portctrl_enabled,omitempty"`
|
||||
EthernetOverrides []struct {
|
||||
Ifname string `json:"ifname,omitempty"` // eth[0-9]{1,2}
|
||||
NetworkGroup string `json:"networkgroup,omitempty"` // LAN[2-8]?|WAN[2]?
|
||||
|
||||
} `json:"ethernet_overrides,omitempty"`
|
||||
FlowctrlEnabled bool `json:"flowctrl_enabled"`
|
||||
FlowctrlEnabled bool `json:"flowctrl_enabled,omitempty"`
|
||||
HeightInMeters float64 `json:"heightInMeters,omitempty"`
|
||||
JumboframeEnabled bool `json:"jumboframe_enabled"`
|
||||
JumboframeEnabled bool `json:"jumboframe_enabled,omitempty"`
|
||||
LcmBrightness int `json:"lcm_brightness,omitempty"` // [1-9]|[1-9][0-9]|100
|
||||
LcmBrightnessOverride bool `json:"lcm_brightness_override"`
|
||||
LcmBrightnessOverride bool `json:"lcm_brightness_override,omitempty"`
|
||||
LcmIDleTimeout int `json:"lcm_idle_timeout,omitempty"` // [1-9][0-9]|[1-9][0-9][0-9]|[1-2][0-9][0-9][0-9]|3[0-5][0-9][0-9]|3600
|
||||
LcmIDleTimeoutOverride bool `json:"lcm_idle_timeout_override"`
|
||||
LcmTrackerEnabled bool `json:"lcm_tracker_enabled"`
|
||||
LcmIDleTimeoutOverride bool `json:"lcm_idle_timeout_override,omitempty"`
|
||||
LcmTrackerEnabled bool `json:"lcm_tracker_enabled,omitempty"`
|
||||
LcmTrackerSeed string `json:"lcm_tracker_seed,omitempty"` // .{0,50}
|
||||
LedOverride string `json:"led_override,omitempty"` // default|on|off
|
||||
LedOverrideColor string `json:"led_override_color,omitempty"` // ^#(?:[0-9a-fA-F]{3}){1,2}$
|
||||
LedOverrideColorBrightness int `json:"led_override_color_brightness,omitempty"` // ^[0-9][0-9]?$|^100$
|
||||
Locked bool `json:"locked"`
|
||||
LteExtAnt bool `json:"lte_ext_ant"`
|
||||
LtePoe bool `json:"lte_poe"`
|
||||
Locked bool `json:"locked,omitempty"`
|
||||
LteExtAnt bool `json:"lte_ext_ant,omitempty"`
|
||||
LtePoe bool `json:"lte_poe,omitempty"`
|
||||
LteSoftLimit int `json:"lte_soft_limit,omitempty"`
|
||||
MapID string `json:"map_id"`
|
||||
MeshStaVapEnabled bool `json:"mesh_sta_vap_enabled"`
|
||||
MgmtNetworkID string `json:"mgmt_network_id"` // [\d\w]+
|
||||
MapID string `json:"map_id,omitempty"`
|
||||
MeshStaVapEnabled bool `json:"mesh_sta_vap_enabled,omitempty"`
|
||||
MgmtNetworkID string `json:"mgmt_network_id,omitempty"` // [\d\w]+
|
||||
Name string `json:"name,omitempty"` // .{1,128}
|
||||
OutdoorModeOverride string `json:"outdoor_mode_override,omitempty"` // default|on|off
|
||||
OutletCycleEnabled bool `json:"outlet_cycle_enabled"`
|
||||
OutletCycleEnabled bool `json:"outlet_cycle_enabled,omitempty"`
|
||||
OutletOverrides []struct {
|
||||
Index int `json:"index,omitempty"`
|
||||
RelayState bool `json:"relay_state"`
|
||||
RelayState bool `json:"relay_state,omitempty"`
|
||||
} `json:"outlet_overrides,omitempty"`
|
||||
PortOverrides []struct {
|
||||
AggregateNumPorts int `json:"aggregate_num_ports,omitempty"` // [2-6]
|
||||
Autoneg bool `json:"autoneg"`
|
||||
Autoneg bool `json:"autoneg,omitempty"`
|
||||
Dot1XCtrl string `json:"dot1x_ctrl,omitempty"` // auto|force_authorized|force_unauthorized|mac_based|multi_host
|
||||
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"`
|
||||
FullDuplex bool `json:"full_duplex"`
|
||||
Isolation bool `json:"isolation"`
|
||||
LldpmedEnabled bool `json:"lldpmed_enabled"`
|
||||
LldpmedNotifyEnabled bool `json:"lldpmed_notify_enabled"`
|
||||
EgressRateLimitKbpsEnabled bool `json:"egress_rate_limit_kbps_enabled,omitempty"`
|
||||
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]
|
||||
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]
|
||||
PortSecurityEnabled bool `json:"port_security_enabled"`
|
||||
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})$
|
||||
PortconfID string `json:"portconf_id"` // [\d\w]+
|
||||
PortconfID string `json:"portconf_id,omitempty"` // [\d\w]+
|
||||
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
|
||||
Speed int `json:"speed,omitempty"` // 10|100|1000|2500|5000|10000|20000|25000|40000|50000|100000
|
||||
StormctrlBroadcastastEnabled bool `json:"stormctrl_bcast_enabled"`
|
||||
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"`
|
||||
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"`
|
||||
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"`
|
||||
StpPortMode bool `json:"stp_port_mode,omitempty"`
|
||||
} `json:"port_overrides,omitempty"`
|
||||
PowerSourceCtrl string `json:"power_source_ctrl,omitempty"` // auto|8023af|8023at|8023bt-type3|8023bt-type4|pasv24|poe-injector|ac|adapter|dc|rps
|
||||
PowerSourceCtrlEnabled bool `json:"power_source_ctrl_enabled"`
|
||||
PowerSourceCtrlEnabled bool `json:"power_source_ctrl_enabled,omitempty"`
|
||||
RADIUSProfileID string `json:"radiusprofile_id,omitempty"`
|
||||
RadioTable []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]|16|34|36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196|auto
|
||||
Channel string `json:"channel,omitempty"` // [0-9]|[1][0-4]|4.5|16|34|36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196|auto
|
||||
HardNoiseFloorEnabled bool `json:"hard_noise_floor_enabled"`
|
||||
HardNoiseFloorEnabled bool `json:"hard_noise_floor_enabled,omitempty"`
|
||||
Ht int `json:"ht,omitempty"` // 20|40|80|160|1080|2160
|
||||
MinRssi int `json:"min_rssi,omitempty"` // ^-([1-9]|[1-8][0-9]|9[0-4])$
|
||||
MinRssiEnabled bool `json:"min_rssi_enabled"`
|
||||
MinRssiEnabled bool `json:"min_rssi_enabled,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Radio string `json:"radio,omitempty"` // ng|na|ad
|
||||
SensLevel int `json:"sens_level,omitempty"` // ^-([5-8][0-9]|90)$
|
||||
SensLevelEnabled bool `json:"sens_level_enabled"`
|
||||
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"`
|
||||
WLANGroupID string `json:"wlangroup_id"` // [\d\w]+
|
||||
|
||||
VwireEnabled bool `json:"vwire_enabled,omitempty"`
|
||||
WLANGroupID string `json:"wlangroup_id,omitempty"` // [\d\w]+
|
||||
} `json:"radio_table,omitempty"`
|
||||
RADIUSProfileID string `json:"radiusprofile_id"`
|
||||
ResetbtnEnabled string `json:"resetbtn_enabled,omitempty"` // on|off
|
||||
RpsOverride struct {
|
||||
PowerManagementMode string `json:"power_management_mode,omitempty"` // dynamic|static
|
||||
@@ -138,32 +135,30 @@ type Device struct {
|
||||
Name string `json:"name,omitempty"` // .{0,32}
|
||||
PortIDX int `json:"port_idx,omitempty"` // [1-6]
|
||||
PortMode string `json:"port_mode,omitempty"` // auto|force_active|manual|disabled
|
||||
|
||||
} `json:"rps_port_table,omitempty"`
|
||||
} `json:"rps_override"`
|
||||
} `json:"rps_override,omitempty"`
|
||||
SnmpContact string `json:"snmp_contact,omitempty"` // .{0,255}
|
||||
SnmpLocation string `json:"snmp_location,omitempty"` // .{0,255}
|
||||
StpPriority int `json:"stp_priority,omitempty"` // 0|4096|8192|12288|16384|20480|24576|28672|32768|36864|40960|45056|49152|53248|57344|61440
|
||||
StpPriority string `json:"stp_priority,omitempty"` // 0|4096|8192|12288|16384|20480|24576|28672|32768|36864|40960|45056|49152|53248|57344|61440
|
||||
StpVersion string `json:"stp_version,omitempty"` // stp|rstp|disabled
|
||||
SwitchVLANEnabled bool `json:"switch_vlan_enabled"`
|
||||
SwitchVLANEnabled bool `json:"switch_vlan_enabled,omitempty"`
|
||||
UbbPairName string `json:"ubb_pair_name,omitempty"` // .{1,128}
|
||||
Volume int `json:"volume,omitempty"` // [0-9]|[1-9][0-9]|100
|
||||
WLANOverrides []struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
Name string `json:"name,omitempty"` // .{1,32}
|
||||
NameCombineEnabled bool `json:"name_combine_enabled"`
|
||||
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"`
|
||||
WLANID string `json:"wlan_id"` // [\d\w]+
|
||||
VLANEnabled bool `json:"vlan_enabled,omitempty"`
|
||||
WLANID string `json:"wlan_id,omitempty"` // [\d\w]+
|
||||
XPassphrase string `json:"x_passphrase,omitempty"` // [\x20-\x7E]{8,63}|[0-9a-fA-F]{64}
|
||||
|
||||
} `json:"wlan_overrides,omitempty"`
|
||||
X string `json:"x,omitempty"`
|
||||
X int `json:"x,omitempty"`
|
||||
XBaresipPassword string `json:"x_baresip_password,omitempty"` // ^[a-zA-Z0-9_.\-!~*'()]*
|
||||
Y string `json:"y,omitempty"`
|
||||
Y int `json:"y,omitempty"`
|
||||
}
|
||||
|
||||
func (c *Client) listDevice(ctx context.Context, site string) ([]Device, error) {
|
||||
@@ -172,7 +167,7 @@ func (c *Client) listDevice(ctx context.Context, site string) ([]Device, error)
|
||||
Data []Device `json:"data"`
|
||||
}
|
||||
|
||||
err := c.do(ctx, "GET", fmt.Sprintf("s/%s/rest/device", site), nil, &respBody)
|
||||
err := c.do(ctx, "GET", fmt.Sprintf("s/%s/stat/device", site), nil, &respBody)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -186,7 +181,7 @@ func (c *Client) getDevice(ctx context.Context, site, id string) (*Device, error
|
||||
Data []Device `json:"data"`
|
||||
}
|
||||
|
||||
err := c.do(ctx, "GET", fmt.Sprintf("s/%s/rest/device/%s", site, id), nil, &respBody)
|
||||
err := c.do(ctx, "GET", fmt.Sprintf("s/%s/stat/device/%s", site, id), nil, &respBody)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user