Regenerated types so that sub-types are not embedded.

This allows callers to create complex payloads; for example, to create a
Device type for a Unifi Switch with PortOverrides, the caller needs to
create these sub-types, which is not possible when it's purely embedded.
This commit is contained in:
James Stephenson
2020-09-02 17:35:14 -04:00
committed by Paul Tyng
parent 35eda4f67b
commit bee58f48d4
8 changed files with 420 additions and 349 deletions

View File

@@ -23,39 +23,49 @@ type ChannelPlan struct {
NoDelete bool `json:"attr_no_delete,omitempty"` NoDelete bool `json:"attr_no_delete,omitempty"`
NoEdit bool `json:"attr_no_edit,omitempty"` NoEdit bool `json:"attr_no_edit,omitempty"`
ApBlacklistedChannels []struct { ApBlacklistedChannels []ChannelPlan_ApBlacklistedChannels `json:"ap_blacklisted_channels,omitempty"`
Channel int `json:"channel,omitempty"` // 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 ConfSource string `json:"conf_source,omitempty"` // manual|radio-ai
MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$ Coupling []ChannelPlan_Coupling `json:"coupling,omitempty"`
Timestamp int `json:"timestamp,omitempty"` // [1-9][0-9]{12} Date string `json:"date"` // ^$|^(20[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])Z?$
} `json:"ap_blacklisted_channels,omitempty"` Fitness float64 `json:"fitness,omitempty"`
ConfSource string `json:"conf_source,omitempty"` // manual|radio-ai Note string `json:"note,omitempty"` // .{0,1024}
Coupling []struct { Radio string `json:"radio,omitempty"` // na|ng|ng\+na
Rssi int `json:"rssi,omitempty"` RadioTable []ChannelPlan_RadioTable `json:"radio_table,omitempty"`
Source string `json:"source,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2}).*$ Satisfaction float64 `json:"satisfaction,omitempty"`
Target string `json:"target,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2}).*$ SatisfactionTable []ChannelPlan_SatisfactionTable `json:"satisfaction_table,omitempty"`
} `json:"coupling,omitempty"` SiteBlacklistedChannels []ChannelPlan_SiteBlacklistedChannels `json:"site_blacklisted_channels,omitempty"`
Date string `json:"date"` // ^$|^(20[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])Z?$ }
Fitness float64 `json:"fitness,omitempty"`
Note string `json:"note,omitempty"` // .{0,1024} type ChannelPlan_ApBlacklistedChannels struct {
Radio string `json:"radio,omitempty"` // na|ng|ng\+na Channel int `json:"channel,omitempty"` // 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
RadioTable []struct { MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$
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 Timestamp int `json:"timestamp,omitempty"` // [1-9][0-9]{12}
Channel string `json:"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 }
DeviceMAC string `json:"device_mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$
Name string `json:"name,omitempty"` // [a-z]*[0-9]* type ChannelPlan_Coupling struct {
TxPower string `json:"tx_power,omitempty"` // [\d]+|auto Rssi int `json:"rssi,omitempty"`
TxPowerMode string `json:"tx_power_mode,omitempty"` // auto|medium|high|low|custom Source string `json:"source,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2}).*$
Width int `json:"width,omitempty"` // 20|40|80|160 Target string `json:"target,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2}).*$
} `json:"radio_table,omitempty"` }
Satisfaction float64 `json:"satisfaction,omitempty"`
SatisfactionTable []struct { type ChannelPlan_RadioTable struct {
DeviceMAC string `json:"device_mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$ 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
Satisfaction float64 `json:"satisfaction,omitempty"` Channel string `json:"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
} `json:"satisfaction_table,omitempty"` DeviceMAC string `json:"device_mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$
SiteBlacklistedChannels []struct { Name string `json:"name,omitempty"` // [a-z]*[0-9]*
Channel int `json:"channel,omitempty"` // 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 TxPower string `json:"tx_power,omitempty"` // [\d]+|auto
Timestamp int `json:"timestamp,omitempty"` // [1-9][0-9]{12} TxPowerMode string `json:"tx_power_mode,omitempty"` // auto|medium|high|low|custom
} `json:"site_blacklisted_channels,omitempty"` Width int `json:"width,omitempty"` // 20|40|80|160
}
type ChannelPlan_SatisfactionTable struct {
DeviceMAC string `json:"device_mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$
Satisfaction float64 `json:"satisfaction,omitempty"`
}
type ChannelPlan_SiteBlacklistedChannels struct {
Channel int `json:"channel,omitempty"` // 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
Timestamp int `json:"timestamp,omitempty"` // [1-9][0-9]{12}
} }
func (c *Client) listChannelPlan(ctx context.Context, site string) ([]ChannelPlan, error) { func (c *Client) listChannelPlan(ctx context.Context, site string) ([]ChannelPlan, error) {

View File

@@ -23,16 +23,18 @@ type Dashboard struct {
NoDelete bool `json:"attr_no_delete,omitempty"` NoDelete bool `json:"attr_no_delete,omitempty"`
NoEdit bool `json:"attr_no_edit,omitempty"` NoEdit bool `json:"attr_no_edit,omitempty"`
ControllerVersion string `json:"controller_version,omitempty"` ControllerVersion string `json:"controller_version,omitempty"`
Desc string `json:"desc,omitempty"` Desc string `json:"desc,omitempty"`
IsPublic bool `json:"is_public"` IsPublic bool `json:"is_public"`
Modules []struct { Modules []Dashboard_Modules `json:"modules,omitempty"`
Config string `json:"config,omitempty"` Name string `json:"name,omitempty"`
ID string `json:"id"` }
ModuleID string `json:"module_id"`
Restrictions string `json:"restrictions,omitempty"` type Dashboard_Modules struct {
} `json:"modules,omitempty"` Config string `json:"config,omitempty"`
Name string `json:"name,omitempty"` ID string `json:"id"`
ModuleID string `json:"module_id"`
Restrictions string `json:"restrictions,omitempty"`
} }
func (c *Client) listDashboard(ctx context.Context, site string) ([]Dashboard, error) { func (c *Client) listDashboard(ctx context.Context, site string) ([]Dashboard, error) {

View File

@@ -23,142 +23,158 @@ type Device struct {
NoDelete bool `json:"attr_no_delete,omitempty"` NoDelete bool `json:"attr_no_delete,omitempty"`
NoEdit bool `json:"attr_no_edit,omitempty"` NoEdit bool `json:"attr_no_edit,omitempty"`
AtfEnabled bool `json:"atf_enabled,omitempty"` AtfEnabled bool `json:"atf_enabled,omitempty"`
BandsteeringMode string `json:"bandsteering_mode,omitempty"` // off|equal|prefer_5g BandsteeringMode string `json:"bandsteering_mode,omitempty"` // off|equal|prefer_5g
BaresipAuthUser string `json:"baresip_auth_user,omitempty"` // ^\+?[a-zA-Z0-9_.\-!~*'()]* BaresipAuthUser string `json:"baresip_auth_user,omitempty"` // ^\+?[a-zA-Z0-9_.\-!~*'()]*
BaresipEnabled bool `json:"baresip_enabled,omitempty"` BaresipEnabled bool `json:"baresip_enabled,omitempty"`
BaresipExtension string `json:"baresip_extension,omitempty"` // ^\+?[a-zA-Z0-9_.\-!~*'()]* BaresipExtension string `json:"baresip_extension,omitempty"` // ^\+?[a-zA-Z0-9_.\-!~*'()]*
ConfigNetwork struct { ConfigNetwork Device_ConfigNetwork `json:"config_network,omitempty"`
BondingEnabled bool `json:"bonding_enabled,omitempty"` DPIEnabled bool `json:"dpi_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]))$|^$ Disabled bool `json:"disabled,omitempty"`
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]))$|^$ Dot1XFallbackNetworkID string `json:"dot1x_fallback_networkconf_id,omitempty"` // [\d\w]+|
DNSsuffix string `json:"dnssuffix,omitempty"` Dot1XPortctrlEnabled bool `json:"dot1x_portctrl_enabled,omitempty"`
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])$|^$ EthernetOverrides []Device_EthernetOverrides `json:"ethernet_overrides,omitempty"`
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])$ FlowctrlEnabled bool `json:"flowctrl_enabled,omitempty"`
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)))))$ HeightInMeters float64 `json:"heightInMeters,omitempty"`
Type string `json:"type,omitempty"` // dhcp|static JumboframeEnabled bool `json:"jumboframe_enabled,omitempty"`
} `json:"config_network,omitempty"` LcmBrightness int `json:"lcm_brightness,omitempty"` // [1-9]|[1-9][0-9]|100
DPIEnabled bool `json:"dpi_enabled,omitempty"` LcmBrightnessOverride bool `json:"lcm_brightness_override,omitempty"`
Disabled bool `json:"disabled,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
Dot1XFallbackNetworkID string `json:"dot1x_fallback_networkconf_id,omitempty"` // [\d\w]+| LcmIDleTimeoutOverride bool `json:"lcm_idle_timeout_override,omitempty"`
Dot1XPortctrlEnabled bool `json:"dot1x_portctrl_enabled,omitempty"` LcmTrackerEnabled bool `json:"lcm_tracker_enabled,omitempty"`
EthernetOverrides []struct { LcmTrackerSeed string `json:"lcm_tracker_seed,omitempty"` // .{0,50}
Ifname string `json:"ifname,omitempty"` // eth[0-9]{1,2} LedOverride string `json:"led_override,omitempty"` // default|on|off
NetworkGroup string `json:"networkgroup,omitempty"` // LAN[2-8]?|WAN[2]? LedOverrideColor string `json:"led_override_color,omitempty"` // ^#(?:[0-9a-fA-F]{3}){1,2}$
} `json:"ethernet_overrides,omitempty"` LedOverrideColorBrightness int `json:"led_override_color_brightness,omitempty"` // ^[0-9][0-9]?$|^100$
FlowctrlEnabled bool `json:"flowctrl_enabled,omitempty"` Locked bool `json:"locked,omitempty"`
HeightInMeters float64 `json:"heightInMeters,omitempty"` LteExtAnt bool `json:"lte_ext_ant,omitempty"`
JumboframeEnabled bool `json:"jumboframe_enabled,omitempty"` LtePoe bool `json:"lte_poe,omitempty"`
LcmBrightness int `json:"lcm_brightness,omitempty"` // [1-9]|[1-9][0-9]|100 LteSoftLimit int `json:"lte_soft_limit,omitempty"`
LcmBrightnessOverride bool `json:"lcm_brightness_override,omitempty"` MapID string `json:"map_id,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 MeshStaVapEnabled bool `json:"mesh_sta_vap_enabled,omitempty"`
LcmIDleTimeoutOverride bool `json:"lcm_idle_timeout_override,omitempty"` MgmtNetworkID string `json:"mgmt_network_id,omitempty"` // [\d\w]+
LcmTrackerEnabled bool `json:"lcm_tracker_enabled,omitempty"` Name string `json:"name,omitempty"` // .{1,128}
LcmTrackerSeed string `json:"lcm_tracker_seed,omitempty"` // .{0,50} OutdoorModeOverride string `json:"outdoor_mode_override,omitempty"` // default|on|off
LedOverride string `json:"led_override,omitempty"` // default|on|off OutletCycleEnabled bool `json:"outlet_cycle_enabled,omitempty"`
LedOverrideColor string `json:"led_override_color,omitempty"` // ^#(?:[0-9a-fA-F]{3}){1,2}$ OutletOverrides []Device_OutletOverrides `json:"outlet_overrides,omitempty"`
LedOverrideColorBrightness int `json:"led_override_color_brightness,omitempty"` // ^[0-9][0-9]?$|^100$ PortOverrides []Device_PortOverrides `json:"port_overrides,omitempty"`
Locked bool `json:"locked,omitempty"` PowerSourceCtrl string `json:"power_source_ctrl,omitempty"` // auto|8023af|8023at|8023bt-type3|8023bt-type4|pasv24|poe-injector|ac|adapter|dc|rps
LteExtAnt bool `json:"lte_ext_ant,omitempty"` PowerSourceCtrlEnabled bool `json:"power_source_ctrl_enabled,omitempty"`
LtePoe bool `json:"lte_poe,omitempty"` RADIUSProfileID string `json:"radiusprofile_id,omitempty"`
LteSoftLimit int `json:"lte_soft_limit,omitempty"` RadioTable []Device_RadioTable `json:"radio_table,omitempty"`
MapID string `json:"map_id,omitempty"` ResetbtnEnabled string `json:"resetbtn_enabled,omitempty"` // on|off
MeshStaVapEnabled bool `json:"mesh_sta_vap_enabled,omitempty"` RpsOverride Device_RpsOverride `json:"rps_override,omitempty"`
MgmtNetworkID string `json:"mgmt_network_id,omitempty"` // [\d\w]+ SnmpContact string `json:"snmp_contact,omitempty"` // .{0,255}
Name string `json:"name,omitempty"` // .{1,128} SnmpLocation string `json:"snmp_location,omitempty"` // .{0,255}
OutdoorModeOverride string `json:"outdoor_mode_override,omitempty"` // default|on|off StpPriority string `json:"stp_priority,omitempty"` // 0|4096|8192|12288|16384|20480|24576|28672|32768|36864|40960|45056|49152|53248|57344|61440
OutletCycleEnabled bool `json:"outlet_cycle_enabled,omitempty"` StpVersion string `json:"stp_version,omitempty"` // stp|rstp|disabled
OutletOverrides []struct { SwitchVLANEnabled bool `json:"switch_vlan_enabled,omitempty"`
Index int `json:"index,omitempty"` UbbPairName string `json:"ubb_pair_name,omitempty"` // .{1,128}
RelayState bool `json:"relay_state,omitempty"` Volume int `json:"volume,omitempty"` // [0-9]|[1-9][0-9]|100
} `json:"outlet_overrides,omitempty"` WLANOverrides []Device_WLANOverrides `json:"wlan_overrides,omitempty"`
PortOverrides []struct { X int `json:"x,omitempty"`
AggregateNumPorts int `json:"aggregate_num_ports,omitempty"` // [2-6] XBaresipPassword string `json:"x_baresip_password,omitempty"` // ^[a-zA-Z0-9_.\-!~*'()]*
Autoneg bool `json:"autoneg,omitempty"` Y int `json:"y,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,omitempty"` type Device_ConfigNetwork struct {
FullDuplex bool `json:"full_duplex,omitempty"` BondingEnabled bool `json:"bonding_enabled,omitempty"`
Isolation bool `json:"isolation,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]))$|^$
LldpmedEnabled bool `json:"lldpmed_enabled,omitempty"` 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]))$|^$
LldpmedNotifyEnabled bool `json:"lldpmed_notify_enabled,omitempty"` DNSsuffix string `json:"dnssuffix,omitempty"`
MirrorPortIDX int `json:"mirror_port_idx,omitempty"` // [1-9]|[1-4][0-9]|5[0-2] 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])$|^$
Name string `json:"name,omitempty"` // .{0,128} 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])$
OpMode string `json:"op_mode,omitempty"` // switch|mirror|aggregate 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)))))$
PoeMode string `json:"poe_mode,omitempty"` // auto|pasv24|passthrough|off Type string `json:"type,omitempty"` // dhcp|static
PortIDX int `json:"port_idx,omitempty"` // [1-9]|[1-4][0-9]|5[0-2] }
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})$ type Device_EthernetOverrides struct {
PortconfID string `json:"portconf_id,omitempty"` // [\d\w]+ Ifname string `json:"ifname,omitempty"` // eth[0-9]{1,2}
PriorityQueue1Level int `json:"priority_queue1_level,omitempty"` // [0-9]|[1-9][0-9]|100 NetworkGroup string `json:"networkgroup,omitempty"` // LAN[2-8]?|WAN[2]?
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 type Device_OutletOverrides struct {
Speed int `json:"speed,omitempty"` // 10|100|1000|2500|5000|10000|20000|25000|40000|50000|100000 Index int `json:"index,omitempty"`
StormctrlBroadcastastEnabled bool `json:"stormctrl_bcast_enabled,omitempty"` RelayState bool `json:"relay_state,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"` type Device_PortOverrides struct {
StormctrlMcastLevel int `json:"stormctrl_mcast_level,omitempty"` // [0-9]|[1-9][0-9]|100 AggregateNumPorts int `json:"aggregate_num_ports,omitempty"` // [2-6]
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 Autoneg bool `json:"autoneg,omitempty"`
StormctrlType string `json:"stormctrl_type,omitempty"` // level|rate Dot1XCtrl string `json:"dot1x_ctrl,omitempty"` // auto|force_authorized|force_unauthorized|mac_based|multi_host
StormctrlUcastEnabled bool `json:"stormctrl_ucast_enabled,omitempty"` EgressRateLimitKbps int `json:"egress_rate_limit_kbps,omitempty"` // 6[4-9]|[7-9][0-9]|[1-9][0-9]{2,6}
StormctrlUcastLevel int `json:"stormctrl_ucast_level,omitempty"` // [0-9]|[1-9][0-9]|100 EgressRateLimitKbpsEnabled bool `json:"egress_rate_limit_kbps_enabled,omitempty"`
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 FullDuplex bool `json:"full_duplex,omitempty"`
StpPortMode bool `json:"stp_port_mode,omitempty"` Isolation bool `json:"isolation,omitempty"`
} `json:"port_overrides,omitempty"` LldpmedEnabled bool `json:"lldpmed_enabled,omitempty"`
PowerSourceCtrl string `json:"power_source_ctrl,omitempty"` // auto|8023af|8023at|8023bt-type3|8023bt-type4|pasv24|poe-injector|ac|adapter|dc|rps LldpmedNotifyEnabled bool `json:"lldpmed_notify_enabled,omitempty"`
PowerSourceCtrlEnabled bool `json:"power_source_ctrl_enabled,omitempty"` MirrorPortIDX int `json:"mirror_port_idx,omitempty"` // [1-9]|[1-4][0-9]|5[0-2]
RADIUSProfileID string `json:"radiusprofile_id,omitempty"` Name string `json:"name,omitempty"` // .{0,128}
RadioTable []struct { OpMode string `json:"op_mode,omitempty"` // switch|mirror|aggregate
AntennaGain int `json:"antenna_gain,omitempty"` // ^-?([0-9]|[1-9][0-9]) PoeMode string `json:"poe_mode,omitempty"` // auto|pasv24|passthrough|off
AntennaID int `json:"antenna_id,omitempty"` // -1|[0-9] PortIDX int `json:"port_idx,omitempty"` // [1-9]|[1-4][0-9]|5[0-2]
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 PortSecurityEnabled bool `json:"port_security_enabled,omitempty"`
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 PortSecurityMACAddress []string `json:"port_security_mac_address,omitempty"` // ^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$
HardNoiseFloorEnabled bool `json:"hard_noise_floor_enabled,omitempty"` PortconfID string `json:"portconf_id,omitempty"` // [\d\w]+
Ht int `json:"ht,omitempty"` // 20|40|80|160|1080|2160 PriorityQueue1Level int `json:"priority_queue1_level,omitempty"` // [0-9]|[1-9][0-9]|100
MinRssi int `json:"min_rssi,omitempty"` // ^-([1-9]|[1-8][0-9]|9[0-4])$ PriorityQueue2Level int `json:"priority_queue2_level,omitempty"` // [0-9]|[1-9][0-9]|100
MinRssiEnabled bool `json:"min_rssi_enabled,omitempty"` PriorityQueue3Level int `json:"priority_queue3_level,omitempty"` // [0-9]|[1-9][0-9]|100
Name string `json:"name,omitempty"` PriorityQueue4Level int `json:"priority_queue4_level,omitempty"` // [0-9]|[1-9][0-9]|100
Radio string `json:"radio,omitempty"` // ng|na|ad Speed int `json:"speed,omitempty"` // 10|100|1000|2500|5000|10000|20000|25000|40000|50000|100000
SensLevel int `json:"sens_level,omitempty"` // ^-([5-8][0-9]|90)$ StormctrlBroadcastastEnabled bool `json:"stormctrl_bcast_enabled,omitempty"`
SensLevelEnabled bool `json:"sens_level_enabled,omitempty"` StormctrlBroadcastastLevel int `json:"stormctrl_bcast_level,omitempty"` // [0-9]|[1-9][0-9]|100
TxPower string `json:"tx_power,omitempty"` // [\d]+|auto 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
TxPowerMode string `json:"tx_power_mode,omitempty"` // auto|medium|high|low|custom StormctrlMcastEnabled bool `json:"stormctrl_mcast_enabled,omitempty"`
VwireEnabled bool `json:"vwire_enabled,omitempty"` StormctrlMcastLevel int `json:"stormctrl_mcast_level,omitempty"` // [0-9]|[1-9][0-9]|100
WLANGroupID string `json:"wlangroup_id,omitempty"` // [\d\w]+ 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
} `json:"radio_table,omitempty"` StormctrlType string `json:"stormctrl_type,omitempty"` // level|rate
ResetbtnEnabled string `json:"resetbtn_enabled,omitempty"` // on|off StormctrlUcastEnabled bool `json:"stormctrl_ucast_enabled,omitempty"`
RpsOverride struct { StormctrlUcastLevel int `json:"stormctrl_ucast_level,omitempty"` // [0-9]|[1-9][0-9]|100
PowerManagementMode string `json:"power_management_mode,omitempty"` // dynamic|static 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
RpsPortTable []struct { StpPortMode bool `json:"stp_port_mode,omitempty"`
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 type Device_RadioTable struct {
} `json:"rps_port_table,omitempty"` AntennaGain int `json:"antenna_gain,omitempty"` // ^-?([0-9]|[1-9][0-9])
} `json:"rps_override,omitempty"` AntennaID int `json:"antenna_id,omitempty"` // -1|[0-9]
SnmpContact string `json:"snmp_contact,omitempty"` // .{0,255} 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
SnmpLocation string `json:"snmp_location,omitempty"` // .{0,255} 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
StpPriority string `json:"stp_priority,omitempty"` // 0|4096|8192|12288|16384|20480|24576|28672|32768|36864|40960|45056|49152|53248|57344|61440 HardNoiseFloorEnabled bool `json:"hard_noise_floor_enabled,omitempty"`
StpVersion string `json:"stp_version,omitempty"` // stp|rstp|disabled Ht int `json:"ht,omitempty"` // 20|40|80|160|1080|2160
SwitchVLANEnabled bool `json:"switch_vlan_enabled,omitempty"` MinRssi int `json:"min_rssi,omitempty"` // ^-([1-9]|[1-8][0-9]|9[0-4])$
UbbPairName string `json:"ubb_pair_name,omitempty"` // .{1,128} MinRssiEnabled bool `json:"min_rssi_enabled,omitempty"`
Volume int `json:"volume,omitempty"` // [0-9]|[1-9][0-9]|100 Name string `json:"name,omitempty"`
WLANOverrides []struct { Radio string `json:"radio,omitempty"` // ng|na|ad
Enabled bool `json:"enabled,omitempty"` SensLevel int `json:"sens_level,omitempty"` // ^-([5-8][0-9]|90)$
Name string `json:"name,omitempty"` // .{1,32} SensLevelEnabled bool `json:"sens_level_enabled,omitempty"`
NameCombineEnabled bool `json:"name_combine_enabled,omitempty"` TxPower string `json:"tx_power,omitempty"` // [\d]+|auto
NameCombineSuffix string `json:"name_combine_suffix,omitempty"` // .{0,8} TxPowerMode string `json:"tx_power_mode,omitempty"` // auto|medium|high|low|custom
Radio string `json:"radio,omitempty"` // ng|na VwireEnabled bool `json:"vwire_enabled,omitempty"`
RadioName string `json:"radio_name,omitempty"` WLANGroupID string `json:"wlangroup_id,omitempty"` // [\d\w]+
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]+ type Device_RpsOverride struct {
XPassphrase string `json:"x_passphrase,omitempty"` // [\x20-\x7E]{8,63}|[0-9a-fA-F]{64} PowerManagementMode string `json:"power_management_mode,omitempty"` // dynamic|static
} `json:"wlan_overrides,omitempty"` RpsPortTable []Device_RpsPortTable `json:"rps_port_table,omitempty"`
X int `json:"x,omitempty"` }
XBaresipPassword string `json:"x_baresip_password,omitempty"` // ^[a-zA-Z0-9_.\-!~*'()]*
Y int `json:"y,omitempty"` type Device_RpsPortTable 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
}
type Device_WLANOverrides 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,63}|[0-9a-fA-F]{64}
} }
func (c *Client) listDevice(ctx context.Context, site string) ([]Device, error) { func (c *Client) listDevice(ctx context.Context, site string) ([]Device, error) {

View File

@@ -23,100 +23,121 @@ type Hotspot2Conf struct {
NoDelete bool `json:"attr_no_delete,omitempty"` NoDelete bool `json:"attr_no_delete,omitempty"`
NoEdit bool `json:"attr_no_edit,omitempty"` NoEdit bool `json:"attr_no_edit,omitempty"`
ApIsolate bool `json:"ap_isolate"` ApIsolate bool `json:"ap_isolate"`
Capab []struct { Capab []Hotspot2Conf_Capab `json:"capab,omitempty"`
Port string `json:"port,omitempty"` // (([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])|([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])-([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5]))+(,([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])|,([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])-([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])){0,14} CellularNetworkList []Hotspot2Conf_CellularNetworkList `json:"cellular_network_list,omitempty"`
Protocol string `json:"protocol,omitempty"` // icmp|tcp_udp|tcp|udp DeauthReqTimeout int `json:"deauth_req_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
Status string `json:"status,omitempty"` // closed|open|unknown DisableDgaf bool `json:"disable_dgaf"`
} `json:"capab,omitempty"` DomainNameList []string `json:"domain_name_list,omitempty"` // .{1,128}
CellularNetworkList []struct { FriendlyName []Hotspot2Conf_FriendlyName `json:"friendly_name,omitempty"`
Mcc int `json:"mcc,omitempty"` GasComebackDelay int `json:"gas_comeback_delay,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]|300
Mnc int `json:"mnc,omitempty"` Hessid string `json:"hessid"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$|^$
Name string `json:"name,omitempty"` // .{1,128} Icons []Hotspot2Conf_Icons `json:"icons,omitempty"`
} `json:"cellular_network_list,omitempty"` MetricsDownlinkLoad int `json:"metrics_downlink_load,omitempty"`
DeauthReqTimeout int `json:"deauth_req_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 MetricsDownlinkSpeed int `json:"metrics_downlink_speed,omitempty"`
DisableDgaf bool `json:"disable_dgaf"` MetricsInfo string `json:"metrics_info,omitempty"` // [0-9A-Fa-f]{1,2}
DomainNameList []string `json:"domain_name_list,omitempty"` // .{1,128} MetricsMeasurement int `json:"metrics_measurement,omitempty"`
FriendlyName []struct { MetricsStatus bool `json:"metrics_status"`
Language string `json:"language,omitempty"` // [a-z]{3} MetricsUplinkLoad int `json:"metrics_uplink_load,omitempty"`
Text string `json:"text,omitempty"` // .{1,128} MetricsUplinkSpeed int `json:"metrics_uplink_speed,omitempty"`
} `json:"friendly_name,omitempty"` NaiRealmList []Hotspot2Conf_NaiRealmList `json:"nai_realm_list,omitempty"`
GasComebackDelay int `json:"gas_comeback_delay,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]|300 Name string `json:"name,omitempty"` // .{1,128}
Hessid string `json:"hessid"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$|^$ NetworkAccessAsra bool `json:"network_access_asra"`
Icons []struct { NetworkAccessEsr bool `json:"network_access_esr"`
Data string `json:"data,omitempty"` NetworkAccessInternet bool `json:"network_access_internet"`
Filename string `json:"filename,omitempty"` // .{1,256} NetworkAccessUesa bool `json:"network_access_uesa"`
Height int `json:"height,omitempty"` NetworkType int `json:"network_type,omitempty"` // 0|1|2|3|4|5|14|15
Language string `json:"language,omitempty"` // [a-z]{3} Osu []Hotspot2Conf_Osu `json:"osu,omitempty"`
Media string `json:"media,omitempty"` // .{1,256} OsuSSID string `json:"osu_ssid"`
Name string `json:"name,omitempty"` // .{1,256} P2P bool `json:"p2p"`
Size int `json:"size,omitempty"` ProxyArp bool `json:"proxy_arp"`
Width int `json:"width,omitempty"` QOSMapDcsp []Hotspot2Conf_QOSMapDcsp `json:"qos_map_dcsp,omitempty"`
} `json:"icons,omitempty"` QOSMapExceptions []Hotspot2Conf_QOSMapExceptions `json:"qos_map_exceptions,omitempty"`
MetricsDownlinkLoad int `json:"metrics_downlink_load,omitempty"` QOSMapStatus bool `json:"qos_map_status"`
MetricsDownlinkSpeed int `json:"metrics_downlink_speed,omitempty"` RoamingConsortiumList []Hotspot2Conf_RoamingConsortiumList `json:"roaming_consortium_list,omitempty"`
MetricsInfo string `json:"metrics_info,omitempty"` // [0-9A-Fa-f]{1,2} TCFilename string `json:"t_c_filename,omitempty"` // .{1,256}
MetricsMeasurement int `json:"metrics_measurement,omitempty"` TCTimestamp int `json:"t_c_timestamp,omitempty"`
MetricsStatus bool `json:"metrics_status"` VenueGroup int `json:"venue_group,omitempty"` // 0|1|2|3|4|5|6|7|8|9|10|11
MetricsUplinkLoad int `json:"metrics_uplink_load,omitempty"` VenueName []Hotspot2Conf_VenueName `json:"venue_name,omitempty"`
MetricsUplinkSpeed int `json:"metrics_uplink_speed,omitempty"` VenueType int `json:"venue_type,omitempty"` // 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15
NaiRealmList []struct { }
AuthIDs string `json:"auth_ids,omitempty"`
AuthVals string `json:"auth_vals,omitempty"` type Hotspot2Conf_Capab struct {
EapMethod int `json:"eap_method,omitempty"` // 13|21|18|23|50 Port string `json:"port,omitempty"` // (([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])|([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])-([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5]))+(,([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])|,([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])-([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])){0,14}
Encoding int `json:"encoding,omitempty"` // 0|1 Protocol string `json:"protocol,omitempty"` // icmp|tcp_udp|tcp|udp
Name string `json:"name,omitempty"` // .{1,128} Status string `json:"status,omitempty"` // closed|open|unknown
Status bool `json:"status"` }
} `json:"nai_realm_list,omitempty"`
Name string `json:"name,omitempty"` // .{1,128} type Hotspot2Conf_CellularNetworkList struct {
NetworkAccessAsra bool `json:"network_access_asra"` Mcc int `json:"mcc,omitempty"`
NetworkAccessEsr bool `json:"network_access_esr"` Mnc int `json:"mnc,omitempty"`
NetworkAccessInternet bool `json:"network_access_internet"` Name string `json:"name,omitempty"` // .{1,128}
NetworkAccessUesa bool `json:"network_access_uesa"` }
NetworkType int `json:"network_type,omitempty"` // 0|1|2|3|4|5|14|15
Osu []struct { type Hotspot2Conf_Description struct {
Description []struct { Language string `json:"language,omitempty"` // [a-z]{3}
Language string `json:"language,omitempty"` // [a-z]{3} Text string `json:"text,omitempty"` // .{1,128}
Text string `json:"text,omitempty"` // .{1,128} }
} `json:"description,omitempty"`
FriendlyName []struct { type Hotspot2Conf_FriendlyName struct {
Language string `json:"language,omitempty"` // [a-z]{3} Language string `json:"language,omitempty"` // [a-z]{3}
Text string `json:"text,omitempty"` // .{1,128} Text string `json:"text,omitempty"` // .{1,128}
} `json:"friendly_name,omitempty"` }
Icon []struct {
Name string `json:"name,omitempty"` // .{1,128} type Hotspot2Conf_Icon struct {
} `json:"icon,omitempty"` Name string `json:"name,omitempty"` // .{1,128}
MethodOmaDm bool `json:"method_oma_dm"` }
MethodSoapXmlSpp bool `json:"method_soap_xml_spp"`
Nai string `json:"nai,omitempty"` type Hotspot2Conf_Icons struct {
Nai2 string `json:"nai2,omitempty"` Data string `json:"data,omitempty"`
OperatingClass string `json:"operating_class,omitempty"` // [0-9A-Fa-f]{12} Filename string `json:"filename,omitempty"` // .{1,256}
ServerUri string `json:"server_uri,omitempty"` Height int `json:"height,omitempty"`
} `json:"osu,omitempty"` Language string `json:"language,omitempty"` // [a-z]{3}
OsuSSID string `json:"osu_ssid"` Media string `json:"media,omitempty"` // .{1,256}
P2P bool `json:"p2p"` Name string `json:"name,omitempty"` // .{1,256}
ProxyArp bool `json:"proxy_arp"` Size int `json:"size,omitempty"`
QOSMapDcsp []struct { Width int `json:"width,omitempty"`
High int `json:"high,omitempty"` }
Low int `json:"low,omitempty"`
} `json:"qos_map_dcsp,omitempty"` type Hotspot2Conf_NaiRealmList struct {
QOSMapExceptions []struct { AuthIDs string `json:"auth_ids,omitempty"`
Dcsp int `json:"dcsp,omitempty"` AuthVals string `json:"auth_vals,omitempty"`
Up int `json:"up,omitempty"` // [0-7] EapMethod int `json:"eap_method,omitempty"` // 13|21|18|23|50
} `json:"qos_map_exceptions,omitempty"` Encoding int `json:"encoding,omitempty"` // 0|1
QOSMapStatus bool `json:"qos_map_status"` Name string `json:"name,omitempty"` // .{1,128}
RoamingConsortiumList []struct { Status bool `json:"status"`
Name string `json:"name,omitempty"` // .{1,128} }
Oid string `json:"oid,omitempty"` // .{1,128}
} `json:"roaming_consortium_list,omitempty"` type Hotspot2Conf_Osu struct {
TCFilename string `json:"t_c_filename,omitempty"` // .{1,256} Description []Hotspot2Conf_Description `json:"description,omitempty"`
TCTimestamp int `json:"t_c_timestamp,omitempty"` FriendlyName []Hotspot2Conf_FriendlyName `json:"friendly_name,omitempty"`
VenueGroup int `json:"venue_group,omitempty"` // 0|1|2|3|4|5|6|7|8|9|10|11 Icon []Hotspot2Conf_Icon `json:"icon,omitempty"`
VenueName []struct { MethodOmaDm bool `json:"method_oma_dm"`
Language string `json:"language,omitempty"` // [a-z]{3} MethodSoapXmlSpp bool `json:"method_soap_xml_spp"`
Name string `json:"name,omitempty"` // .{1,128} Nai string `json:"nai,omitempty"`
} `json:"venue_name,omitempty"` Nai2 string `json:"nai2,omitempty"`
VenueType int `json:"venue_type,omitempty"` // 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15 OperatingClass string `json:"operating_class,omitempty"` // [0-9A-Fa-f]{12}
ServerUri string `json:"server_uri,omitempty"`
}
type Hotspot2Conf_QOSMapDcsp struct {
High int `json:"high,omitempty"`
Low int `json:"low,omitempty"`
}
type Hotspot2Conf_QOSMapExceptions struct {
Dcsp int `json:"dcsp,omitempty"`
Up int `json:"up,omitempty"` // [0-7]
}
type Hotspot2Conf_RoamingConsortiumList struct {
Name string `json:"name,omitempty"` // .{1,128}
Oid string `json:"oid,omitempty"` // .{1,128}
}
type Hotspot2Conf_VenueName struct {
Language string `json:"language,omitempty"` // [a-z]{3}
Name string `json:"name,omitempty"` // .{1,128}
} }
func (c *Client) listHotspot2Conf(ctx context.Context, site string) ([]Hotspot2Conf, error) { func (c *Client) listHotspot2Conf(ctx context.Context, site string) ([]Hotspot2Conf, error) {

View File

@@ -23,24 +23,28 @@ type RADIUSProfile struct {
NoDelete bool `json:"attr_no_delete,omitempty"` NoDelete bool `json:"attr_no_delete,omitempty"`
NoEdit bool `json:"attr_no_edit,omitempty"` NoEdit bool `json:"attr_no_edit,omitempty"`
AccountingEnabled bool `json:"accounting_enabled"` AccountingEnabled bool `json:"accounting_enabled"`
AcctServers []struct { AcctServers []RADIUSProfile_AcctServers `json:"acct_servers,omitempty"`
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])$ AuthServers []RADIUSProfile_AuthServers `json:"auth_servers,omitempty"`
Port int `json:"port,omitempty"` // ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])$|^$ InterimUpdateEnabled bool `json:"interim_update_enabled"`
XSecret string `json:"x_secret,omitempty"` InterimUpdateInterval int `json:"interim_update_interval,omitempty"` // ^([6-9][0-9]|[1-9][0-9]{2,3}|[1-7][0-9]{4}|8[0-5][0-9]{3}|86[0-3][0-9][0-9]|86400)$
} `json:"acct_servers,omitempty"` Name string `json:"name,omitempty"` // .{1,128}
AuthServers []struct { UseUsgAcctServer bool `json:"use_usg_acct_server"`
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])$ UseUsgAuthServer bool `json:"use_usg_auth_server"`
Port int `json:"port,omitempty"` // ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])$|^$ VLANEnabled bool `json:"vlan_enabled"`
XSecret string `json:"x_secret,omitempty"` VLANWLANMode string `json:"vlan_wlan_mode,omitempty"` // disabled|optional|required
} `json:"auth_servers,omitempty"` }
InterimUpdateEnabled bool `json:"interim_update_enabled"`
InterimUpdateInterval int `json:"interim_update_interval,omitempty"` // ^([6-9][0-9]|[1-9][0-9]{2,3}|[1-7][0-9]{4}|8[0-5][0-9]{3}|86[0-3][0-9][0-9]|86400)$ type RADIUSProfile_AcctServers struct {
Name string `json:"name,omitempty"` // .{1,128} 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])$
UseUsgAcctServer bool `json:"use_usg_acct_server"` Port int `json:"port,omitempty"` // ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])$|^$
UseUsgAuthServer bool `json:"use_usg_auth_server"` XSecret string `json:"x_secret,omitempty"`
VLANEnabled bool `json:"vlan_enabled"` }
VLANWLANMode string `json:"vlan_wlan_mode,omitempty"` // disabled|optional|required
type RADIUSProfile_AuthServers struct {
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])$
Port int `json:"port,omitempty"` // ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])$|^$
XSecret string `json:"x_secret,omitempty"`
} }
func (c *Client) listRADIUSProfile(ctx context.Context, site string) ([]RADIUSProfile, error) { func (c *Client) listRADIUSProfile(ctx context.Context, site string) ([]RADIUSProfile, error) {

View File

@@ -23,18 +23,20 @@ type ScheduleTask struct {
NoDelete bool `json:"attr_no_delete,omitempty"` NoDelete bool `json:"attr_no_delete,omitempty"`
NoEdit bool `json:"attr_no_edit,omitempty"` NoEdit bool `json:"attr_no_edit,omitempty"`
Action string `json:"action,omitempty"` // stream|upgrade Action string `json:"action,omitempty"` // stream|upgrade
AdditionalSoundsEnabled bool `json:"additional_sounds_enabled"` AdditionalSoundsEnabled bool `json:"additional_sounds_enabled"`
BroadcastgroupID string `json:"broadcastgroup_id"` BroadcastgroupID string `json:"broadcastgroup_id"`
CronExpr string `json:"cron_expr,omitempty"` CronExpr string `json:"cron_expr,omitempty"`
ExecuteOnlyOnce bool `json:"execute_only_once"` ExecuteOnlyOnce bool `json:"execute_only_once"`
MediafileID string `json:"mediafile_id"` MediafileID string `json:"mediafile_id"`
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
SampleFilename string `json:"sample_filename,omitempty"` SampleFilename string `json:"sample_filename,omitempty"`
StreamType string `json:"stream_type,omitempty"` // media|sample StreamType string `json:"stream_type,omitempty"` // media|sample
UpgradeTargets []struct { UpgradeTargets []ScheduleTask_UpgradeTargets `json:"upgrade_targets,omitempty"`
MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$ }
} `json:"upgrade_targets,omitempty"`
type ScheduleTask_UpgradeTargets struct {
MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$
} }
func (c *Client) listScheduleTask(ctx context.Context, site string) ([]ScheduleTask, error) { func (c *Client) listScheduleTask(ctx context.Context, site string) ([]ScheduleTask, error) {

View File

@@ -25,43 +25,55 @@ type SettingIps struct {
Key string `json:"key"` Key string `json:"key"`
DNSFiltering bool `json:"dns_filtering"` DNSFiltering bool `json:"dns_filtering"`
DNSFilters []struct { DNSFilters []SettingIps_DNSFilters `json:"dns_filters,omitempty"`
Filter string `json:"filter,omitempty"` // security|adult|family EnabledCategories []string `json:"enabled_categories,omitempty"` // emerging-activex|emerging-attackresponse|botcc|emerging-chat|ciarmy|compromised|emerging-dns|emerging-dos|dshield|emerging-exploit|emerging-ftp|emerging-games|emerging-icmp|emerging-icmpinfo|emerging-imap|emerging-inappropriate|emerging-info|emerging-malware|emerging-misc|emerging-mobile|emerging-netbios|emerging-p2p|emerging-policy|emerging-pop3|emerging-rpc|emerging-scada|emerging-scan|emerging-shellcode|emerging-smtp|emerging-snmp|spamhaus|emerging-sql|emerging-telnet|emerging-tftp|tor|emerging-trojan|emerging-useragent|emerging-voip|emerging-webapps|emerging-webclient|emerging-webserver|emerging-worm
NetworkID string `json:"network_id"` EndpointScanning bool `json:"endpoint_scanning"`
Version string `json:"version,omitempty"` // v4|v6 Honeypot []SettingIps_Honeypot `json:"honeypot,omitempty"`
} `json:"dns_filters,omitempty"` HoneypotEnabled bool `json:"honeypot_enabled"`
EnabledCategories []string `json:"enabled_categories,omitempty"` // emerging-activex|emerging-attackresponse|botcc|emerging-chat|ciarmy|compromised|emerging-dns|emerging-dos|dshield|emerging-exploit|emerging-ftp|emerging-games|emerging-icmp|emerging-icmpinfo|emerging-imap|emerging-inappropriate|emerging-info|emerging-malware|emerging-misc|emerging-mobile|emerging-netbios|emerging-p2p|emerging-policy|emerging-pop3|emerging-rpc|emerging-scada|emerging-scan|emerging-shellcode|emerging-smtp|emerging-snmp|spamhaus|emerging-sql|emerging-telnet|emerging-tftp|tor|emerging-trojan|emerging-useragent|emerging-voip|emerging-webapps|emerging-webclient|emerging-webserver|emerging-worm IPsMode string `json:"ips_mode,omitempty"` // ids|ips|ipsInline|disabled
EndpointScanning bool `json:"endpoint_scanning"` RestrictIPAddresses bool `json:"restrict_ip_addresses"`
Honeypot []struct { RestrictTor bool `json:"restrict_tor"`
IPAddress string `json:"ip_address,omitempty"` RestrictTorrents bool `json:"restrict_torrents"`
NetworkID string `json:"network_id"` Suppression SettingIps_Suppression `json:"suppression,omitempty"`
Version string `json:"version,omitempty"` // v4|v6 }
} `json:"honeypot,omitempty"`
HoneypotEnabled bool `json:"honeypot_enabled"` type SettingIps_Alerts struct {
IPsMode string `json:"ips_mode,omitempty"` // ids|ips|ipsInline|disabled Category string `json:"category,omitempty"`
RestrictIPAddresses bool `json:"restrict_ip_addresses"` Gid int `json:"gid,omitempty"`
RestrictTor bool `json:"restrict_tor"` ID int `json:"id,omitempty"`
RestrictTorrents bool `json:"restrict_torrents"` Signature string `json:"signature,omitempty"`
Suppression struct { Tracking []SettingIps_Tracking `json:"tracking,omitempty"`
Alerts []struct { Type string `json:"type,omitempty"` // all|track
Category string `json:"category,omitempty"` }
Gid int `json:"gid,omitempty"`
ID int `json:"id,omitempty"` type SettingIps_DNSFilters struct {
Signature string `json:"signature,omitempty"` Filter string `json:"filter,omitempty"` // security|adult|family
Tracking []struct { NetworkID string `json:"network_id"`
Direction string `json:"direction,omitempty"` // both|src|dest Version string `json:"version,omitempty"` // v4|v6
Mode string `json:"mode,omitempty"` // ip|subnet|network }
Value string `json:"value,omitempty"`
} `json:"tracking,omitempty"` type SettingIps_Honeypot struct {
Type string `json:"type,omitempty"` // all|track IPAddress string `json:"ip_address,omitempty"`
} `json:"alerts,omitempty"` NetworkID string `json:"network_id"`
Whitelist []struct { Version string `json:"version,omitempty"` // v4|v6
Direction string `json:"direction,omitempty"` // both|src|dest }
Mode string `json:"mode,omitempty"` // ip|subnet|network
Value string `json:"value,omitempty"` type SettingIps_Suppression struct {
} `json:"whitelist,omitempty"` Alerts []SettingIps_Alerts `json:"alerts,omitempty"`
} `json:"suppression,omitempty"` Whitelist []SettingIps_Whitelist `json:"whitelist,omitempty"`
}
type SettingIps_Tracking struct {
Direction string `json:"direction,omitempty"` // both|src|dest
Mode string `json:"mode,omitempty"` // ip|subnet|network
Value string `json:"value,omitempty"`
}
type SettingIps_Whitelist struct {
Direction string `json:"direction,omitempty"` // both|src|dest
Mode string `json:"mode,omitempty"` // ip|subnet|network
Value string `json:"value,omitempty"`
} }
func (c *Client) getSettingIps(ctx context.Context, site string) (*SettingIps, error) { func (c *Client) getSettingIps(ctx context.Context, site string) (*SettingIps, error) {

View File

@@ -23,15 +23,19 @@ type SpatialRecord struct {
NoDelete bool `json:"attr_no_delete,omitempty"` NoDelete bool `json:"attr_no_delete,omitempty"`
NoEdit bool `json:"attr_no_edit,omitempty"` NoEdit bool `json:"attr_no_edit,omitempty"`
Devices []struct { Devices []SpatialRecord_Devices `json:"devices,omitempty"`
MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$ Name string `json:"name,omitempty"` // .{1,128}
Position struct { }
X float64 `json:"x,omitempty"` // (^([-]?[\d]+)$)|(^([-]?[\d]+[.]?[\d]+)$)
Y float64 `json:"y,omitempty"` // (^([-]?[\d]+)$)|(^([-]?[\d]+[.]?[\d]+)$) type SpatialRecord_Devices struct {
Z float64 `json:"z,omitempty"` // (^([-]?[\d]+)$)|(^([-]?[\d]+[.]?[\d]+)$) MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$
} `json:"position,omitempty"` Position SpatialRecord_Position `json:"position,omitempty"`
} `json:"devices,omitempty"` }
Name string `json:"name,omitempty"` // .{1,128}
type SpatialRecord_Position struct {
X float64 `json:"x,omitempty"` // (^([-]?[\d]+)$)|(^([-]?[\d]+[.]?[\d]+)$)
Y float64 `json:"y,omitempty"` // (^([-]?[\d]+)$)|(^([-]?[\d]+[.]?[\d]+)$)
Z float64 `json:"z,omitempty"` // (^([-]?[\d]+)$)|(^([-]?[\d]+[.]?[\d]+)$)
} }
func (c *Client) listSpatialRecord(ctx context.Context, site string) ([]SpatialRecord, error) { func (c *Client) listSpatialRecord(ctx context.Context, site string) ([]SpatialRecord, error) {