Class: MistApi::SiteWifi

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/site_wifi.rb

Overview

Wi-Fi site settings

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(cisco_enabled = true, disable_11k = false, disable_radios_when_power_constrained = false, enable_arp_spoof_check = false, enable_shared_radio_scanning = true, enabled = true, locate_connected = true, locate_unconnected = false, mesh_allow_dfs = false, mesh_enable_crm = false, mesh_enabled = false, mesh_psk = SKIP, mesh_ssid = SKIP, proxy_arp = SKIP) ⇒ SiteWifi

Returns a new instance of SiteWifi.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/mist_api/models/site_wifi.rb', line 120

def initialize(cisco_enabled = true, disable_11k = false,
               disable_radios_when_power_constrained = false,
               enable_arp_spoof_check = false,
               enable_shared_radio_scanning = true, enabled = true,
               locate_connected = true, locate_unconnected = false,
               mesh_allow_dfs = false, mesh_enable_crm = false,
               mesh_enabled = false, mesh_psk = SKIP, mesh_ssid = SKIP,
               proxy_arp = SKIP)
  @cisco_enabled = cisco_enabled unless cisco_enabled == SKIP
  @disable_11k = disable_11k unless disable_11k == SKIP
  unless disable_radios_when_power_constrained == SKIP
    @disable_radios_when_power_constrained =
      disable_radios_when_power_constrained
  end
  @enable_arp_spoof_check = enable_arp_spoof_check unless enable_arp_spoof_check == SKIP
  unless enable_shared_radio_scanning == SKIP
    @enable_shared_radio_scanning =
      enable_shared_radio_scanning
  end
  @enabled = enabled unless enabled == SKIP
  @locate_connected = locate_connected unless locate_connected == SKIP
  @locate_unconnected = locate_unconnected unless locate_unconnected == SKIP
  @mesh_allow_dfs = mesh_allow_dfs unless mesh_allow_dfs == SKIP
  @mesh_enable_crm = mesh_enable_crm unless mesh_enable_crm == SKIP
  @mesh_enabled = mesh_enabled unless mesh_enabled == SKIP
  @mesh_psk = mesh_psk unless mesh_psk == SKIP
  @mesh_ssid = mesh_ssid unless mesh_ssid == SKIP
  @proxy_arp = proxy_arp unless proxy_arp == SKIP
end

Instance Attribute Details

#cisco_enabledTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/mist_api/models/site_wifi.rb', line 14

def cisco_enabled
  @cisco_enabled
end

#disable_11kTrueClass | FalseClass

Whether to disable 11k

Returns:

  • (TrueClass | FalseClass)


18
19
20
# File 'lib/mist_api/models/site_wifi.rb', line 18

def disable_11k
  @disable_11k
end

#disable_radios_when_power_constrainedTrueClass | FalseClass

Whether to disable 11k

Returns:

  • (TrueClass | FalseClass)


22
23
24
# File 'lib/mist_api/models/site_wifi.rb', line 22

def disable_radios_when_power_constrained
  @disable_radios_when_power_constrained
end

#enable_arp_spoof_checkTrueClass | FalseClass

When proxy_arp is enabled, check for arp spoofing.

Returns:

  • (TrueClass | FalseClass)


26
27
28
# File 'lib/mist_api/models/site_wifi.rb', line 26

def enable_arp_spoof_check
  @enable_arp_spoof_check
end

#enable_shared_radio_scanningTrueClass | FalseClass

When proxy_arp is enabled, check for arp spoofing.

Returns:

  • (TrueClass | FalseClass)


30
31
32
# File 'lib/mist_api/models/site_wifi.rb', line 30

def enable_shared_radio_scanning
  @enable_shared_radio_scanning
end

#enabledTrueClass | FalseClass

Enable Wi-Fi feature (using SUB-MAN license)

Returns:

  • (TrueClass | FalseClass)


34
35
36
# File 'lib/mist_api/models/site_wifi.rb', line 34

def enabled
  @enabled
end

#locate_connectedTrueClass | FalseClass

Whether to locate connected clients

Returns:

  • (TrueClass | FalseClass)


38
39
40
# File 'lib/mist_api/models/site_wifi.rb', line 38

def locate_connected
  @locate_connected
end

#locate_unconnectedTrueClass | FalseClass

Whether to locate unconnected clients

Returns:

  • (TrueClass | FalseClass)


42
43
44
# File 'lib/mist_api/models/site_wifi.rb', line 42

def locate_unconnected
  @locate_unconnected
end

#mesh_allow_dfsTrueClass | FalseClass

Whether to allow Mesh to use DFS channels. For DFS channels, Remote Mesh AP would have to do CAC when scanning for new Base AP, which is slow and will disrupt the connection. If roaming is desired, keep it disabled.

Returns:

  • (TrueClass | FalseClass)


48
49
50
# File 'lib/mist_api/models/site_wifi.rb', line 48

def mesh_allow_dfs
  @mesh_allow_dfs
end

#mesh_enable_crmTrueClass | FalseClass

Used to enable/disable CRM

Returns:

  • (TrueClass | FalseClass)


52
53
54
# File 'lib/mist_api/models/site_wifi.rb', line 52

def mesh_enable_crm
  @mesh_enable_crm
end

#mesh_enabledTrueClass | FalseClass

Whether to enable Mesh feature for the site

Returns:

  • (TrueClass | FalseClass)


56
57
58
# File 'lib/mist_api/models/site_wifi.rb', line 56

def mesh_enabled
  @mesh_enabled
end

#mesh_pskString

Optional passphrase of mesh networking, default is generated randomly

Returns:

  • (String)


60
61
62
# File 'lib/mist_api/models/site_wifi.rb', line 60

def mesh_psk
  @mesh_psk
end

#mesh_ssidString

Optional ssid of mesh networking, default is based on site_id

Returns:

  • (String)


64
65
66
# File 'lib/mist_api/models/site_wifi.rb', line 64

def mesh_ssid
  @mesh_ssid
end

#proxy_arpSiteWifiProxyArpEnum

enum: ‘default`, `disabled`, `enabled`



68
69
70
# File 'lib/mist_api/models/site_wifi.rb', line 68

def proxy_arp
  @proxy_arp
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/mist_api/models/site_wifi.rb', line 151

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  cisco_enabled = hash['cisco_enabled'] ||= true
  disable_11k = hash['disable_11k'] ||= false
  disable_radios_when_power_constrained =
    hash['disable_radios_when_power_constrained'] ||= false
  enable_arp_spoof_check = hash['enable_arp_spoof_check'] ||= false
  enable_shared_radio_scanning =
    hash['enable_shared_radio_scanning'] ||= true
  enabled = hash['enabled'] ||= true
  locate_connected = hash['locate_connected'] ||= true
  locate_unconnected = hash['locate_unconnected'] ||= false
  mesh_allow_dfs = hash['mesh_allow_dfs'] ||= false
  mesh_enable_crm = hash['mesh_enable_crm'] ||= false
  mesh_enabled = hash['mesh_enabled'] ||= false
  mesh_psk = hash.key?('mesh_psk') ? hash['mesh_psk'] : SKIP
  mesh_ssid = hash.key?('mesh_ssid') ? hash['mesh_ssid'] : SKIP
  proxy_arp = hash.key?('proxy_arp') ? hash['proxy_arp'] : SKIP

  # Create object from extracted values.
  SiteWifi.new(cisco_enabled,
               disable_11k,
               disable_radios_when_power_constrained,
               enable_arp_spoof_check,
               enable_shared_radio_scanning,
               enabled,
               locate_connected,
               locate_unconnected,
               mesh_allow_dfs,
               mesh_enable_crm,
               mesh_enabled,
               mesh_psk,
               mesh_ssid,
               proxy_arp)
end

.namesObject

A mapping from model property names to API property names.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/mist_api/models/site_wifi.rb', line 71

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['cisco_enabled'] = 'cisco_enabled'
  @_hash['disable_11k'] = 'disable_11k'
  @_hash['disable_radios_when_power_constrained'] =
    'disable_radios_when_power_constrained'
  @_hash['enable_arp_spoof_check'] = 'enable_arp_spoof_check'
  @_hash['enable_shared_radio_scanning'] = 'enable_shared_radio_scanning'
  @_hash['enabled'] = 'enabled'
  @_hash['locate_connected'] = 'locate_connected'
  @_hash['locate_unconnected'] = 'locate_unconnected'
  @_hash['mesh_allow_dfs'] = 'mesh_allow_dfs'
  @_hash['mesh_enable_crm'] = 'mesh_enable_crm'
  @_hash['mesh_enabled'] = 'mesh_enabled'
  @_hash['mesh_psk'] = 'mesh_psk'
  @_hash['mesh_ssid'] = 'mesh_ssid'
  @_hash['proxy_arp'] = 'proxy_arp'
  @_hash
end

.nullablesObject

An array for nullable fields



112
113
114
115
116
117
118
# File 'lib/mist_api/models/site_wifi.rb', line 112

def self.nullables
  %w[
    mesh_psk
    mesh_ssid
    proxy_arp
  ]
end

.optionalsObject

An array for optional fields



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/mist_api/models/site_wifi.rb', line 92

def self.optionals
  %w[
    cisco_enabled
    disable_11k
    disable_radios_when_power_constrained
    enable_arp_spoof_check
    enable_shared_radio_scanning
    enabled
    locate_connected
    locate_unconnected
    mesh_allow_dfs
    mesh_enable_crm
    mesh_enabled
    mesh_psk
    mesh_ssid
    proxy_arp
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/mist_api/models/site_wifi.rb', line 202

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} cisco_enabled: #{@cisco_enabled.inspect}, disable_11k:"\
  " #{@disable_11k.inspect}, disable_radios_when_power_constrained:"\
  " #{@disable_radios_when_power_constrained.inspect}, enable_arp_spoof_check:"\
  " #{@enable_arp_spoof_check.inspect}, enable_shared_radio_scanning:"\
  " #{@enable_shared_radio_scanning.inspect}, enabled: #{@enabled.inspect}, locate_connected:"\
  " #{@locate_connected.inspect}, locate_unconnected: #{@locate_unconnected.inspect},"\
  " mesh_allow_dfs: #{@mesh_allow_dfs.inspect}, mesh_enable_crm: #{@mesh_enable_crm.inspect},"\
  " mesh_enabled: #{@mesh_enabled.inspect}, mesh_psk: #{@mesh_psk.inspect}, mesh_ssid:"\
  " #{@mesh_ssid.inspect}, proxy_arp: #{@proxy_arp.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



190
191
192
193
194
195
196
197
198
199
# File 'lib/mist_api/models/site_wifi.rb', line 190

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} cisco_enabled: #{@cisco_enabled}, disable_11k: #{@disable_11k},"\
  " disable_radios_when_power_constrained: #{@disable_radios_when_power_constrained},"\
  " enable_arp_spoof_check: #{@enable_arp_spoof_check}, enable_shared_radio_scanning:"\
  " #{@enable_shared_radio_scanning}, enabled: #{@enabled}, locate_connected:"\
  " #{@locate_connected}, locate_unconnected: #{@locate_unconnected}, mesh_allow_dfs:"\
  " #{@mesh_allow_dfs}, mesh_enable_crm: #{@mesh_enable_crm}, mesh_enabled: #{@mesh_enabled},"\
  " mesh_psk: #{@mesh_psk}, mesh_ssid: #{@mesh_ssid}, proxy_arp: #{@proxy_arp}>"
end