Class: MistApi::DeviceprofileAp

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

Overview

Device Profile

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(aeroscout = SKIP, airista = SKIP, ble_config = SKIP, created_time = SKIP, disable_eth1 = false, disable_eth2 = false, disable_eth3 = false, disable_module = false, esl_config = SKIP, for_site = SKIP, id = SKIP, iot_config = SKIP, ip_config = SKIP, lacp_config = SKIP, led = SKIP, mesh = SKIP, modified_time = SKIP, name = SKIP, ntp_servers = SKIP, org_id = SKIP, poe_passthrough = false, port_config = SKIP, pwr_config = SKIP, radio_config = SKIP, site_id = SKIP, switch_config = SKIP, uplink_port_config = SKIP, usb_config = SKIP, vars = SKIP, zigbee_config = SKIP, additional_properties = nil) ⇒ DeviceprofileAp

Returns a new instance of DeviceprofileAp.



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 223

def initialize(aeroscout = SKIP, airista = SKIP, ble_config = SKIP,
               created_time = SKIP, disable_eth1 = false,
               disable_eth2 = false, disable_eth3 = false,
               disable_module = false, esl_config = SKIP, for_site = SKIP,
               id = SKIP, iot_config = SKIP, ip_config = SKIP,
               lacp_config = SKIP, led = SKIP, mesh = SKIP,
               modified_time = SKIP, name = SKIP, ntp_servers = SKIP,
               org_id = SKIP, poe_passthrough = false, port_config = SKIP,
               pwr_config = SKIP, radio_config = SKIP, site_id = SKIP,
               switch_config = SKIP, uplink_port_config = SKIP,
               usb_config = SKIP, vars = SKIP, zigbee_config = SKIP,
               additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @aeroscout = aeroscout unless aeroscout == SKIP
  @airista = airista unless airista == SKIP
  @ble_config = ble_config unless ble_config == SKIP
  @created_time = created_time unless created_time == SKIP
  @disable_eth1 = disable_eth1 unless disable_eth1 == SKIP
  @disable_eth2 = disable_eth2 unless disable_eth2 == SKIP
  @disable_eth3 = disable_eth3 unless disable_eth3 == SKIP
  @disable_module = disable_module unless disable_module == SKIP
  @esl_config = esl_config unless esl_config == SKIP
  @for_site = for_site unless for_site == SKIP
  @id = id unless id == SKIP
  @iot_config = iot_config unless iot_config == SKIP
  @ip_config = ip_config unless ip_config == SKIP
  @lacp_config = lacp_config unless lacp_config == SKIP
  @led = led unless led == SKIP
  @mesh = mesh unless mesh == SKIP
  @modified_time = modified_time unless modified_time == SKIP
  @name = name unless name == SKIP
  @ntp_servers = ntp_servers unless ntp_servers == SKIP
  @org_id = org_id unless org_id == SKIP
  @poe_passthrough = poe_passthrough unless poe_passthrough == SKIP
  @port_config = port_config unless port_config == SKIP
  @pwr_config = pwr_config unless pwr_config == SKIP
  @radio_config = radio_config unless radio_config == SKIP
  @site_id = site_id unless site_id == SKIP
  @switch_config = switch_config unless switch_config == SKIP
  @type = 'ap'
  @uplink_port_config = uplink_port_config unless uplink_port_config == SKIP
  @usb_config = usb_config unless usb_config == SKIP
  @vars = vars unless vars == SKIP
  @zigbee_config = zigbee_config unless zigbee_config == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#aeroscoutApAeroscout

Aeroscout AP settings

Returns:



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

def aeroscout
  @aeroscout
end

#airistaApAirista

Aeroscout AP settings

Returns:



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

def airista
  @airista
end

#ble_configBleConfig

BLE AP settings

Returns:



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

def ble_config
  @ble_config
end

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


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

def created_time
  @created_time
end

#disable_eth1TrueClass | FalseClass

Whether to disable eth1 port

Returns:

  • (TrueClass | FalseClass)


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

def disable_eth1
  @disable_eth1
end

#disable_eth2TrueClass | FalseClass

Whether to disable eth2 port

Returns:

  • (TrueClass | FalseClass)


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

def disable_eth2
  @disable_eth2
end

#disable_eth3TrueClass | FalseClass

Whether to disable eth3 port

Returns:

  • (TrueClass | FalseClass)


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

def disable_eth3
  @disable_eth3
end

#disable_moduleTrueClass | FalseClass

Whether to disable module port

Returns:

  • (TrueClass | FalseClass)


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

def disable_module
  @disable_module
end

#esl_configApEslConfig

Whether to disable module port

Returns:



46
47
48
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 46

def esl_config
  @esl_config
end

#for_siteTrueClass | FalseClass

Whether to disable module port

Returns:

  • (TrueClass | FalseClass)


50
51
52
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 50

def for_site
  @for_site
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


54
55
56
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 54

def id
  @id
end

#iot_configApIot

IoT AP settings

Returns:



58
59
60
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 58

def iot_config
  @iot_config
end

#ip_configApIpConfig

IP AP settings

Returns:



62
63
64
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 62

def ip_config
  @ip_config
end

#lacp_configDeviceApLacpConfig

IP AP settings

Returns:



66
67
68
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 66

def lacp_config
  @lacp_config
end

#ledApLed

LED AP settings

Returns:



70
71
72
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 70

def led
  @led
end

#meshApMesh

Mesh AP settings

Returns:



74
75
76
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 74

def mesh
  @mesh
end

#modified_timeFloat

When the object has been modified for the last time, in epoch

Returns:

  • (Float)


78
79
80
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 78

def modified_time
  @modified_time
end

#nameString

When the object has been modified for the last time, in epoch

Returns:

  • (String)


82
83
84
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 82

def name
  @name
end

#ntp_serversArray[String]

When the object has been modified for the last time, in epoch

Returns:

  • (Array[String])


86
87
88
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 86

def ntp_servers
  @ntp_servers
end

#org_idUUID | String

When the object has been modified for the last time, in epoch

Returns:

  • (UUID | String)


90
91
92
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 90

def org_id
  @org_id
end

#poe_passthroughTrueClass | FalseClass

Whether to enable power out through module port (for APH) or eth1 (for APL/BT11)

Returns:

  • (TrueClass | FalseClass)


95
96
97
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 95

def poe_passthrough
  @poe_passthrough
end

#port_configHash[String, ApPortConfig]

eth0 is not allowed here. Property key is the interface(s) name (e.g. ‘eth1` or `eth1,eth2`). If specified, this takes precedence over switch_config (deprecated)

Returns:



101
102
103
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 101

def port_config
  @port_config
end

#pwr_configApPwrConfig

Power related configs

Returns:



105
106
107
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 105

def pwr_config
  @pwr_config
end

#radio_configApRadio

Radio AP settings

Returns:



109
110
111
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 109

def radio_config
  @radio_config
end

#site_idUUID | String

Radio AP settings

Returns:

  • (UUID | String)


113
114
115
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 113

def site_id
  @site_id
end

#switch_configApSwitch

For people who want to fully control the vlans (advanced)

Returns:



117
118
119
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 117

def switch_config
  @switch_config
end

#typeString (readonly)

Device Type. enum: ‘ap`

Returns:

  • (String)


121
122
123
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 121

def type
  @type
end

AP Uplink port configuration

Returns:



125
126
127
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 125

def uplink_port_config
  @uplink_port_config
end

#usb_configApUsb

USB AP settings

- Note: if native imagotag is enabled, BLE will be disabled

automatically

- Note: legacy, new config moved to ESL Config.

Returns:



132
133
134
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 132

def usb_config
  @usb_config
end

#varsHash[String, String]

Dictionary of name->value, the vars can then be used in Wlans. This can overwrite those from Site Vars

Returns:

  • (Hash[String, String])


137
138
139
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 137

def vars
  @vars
end

#zigbee_configApZigbee

Zigbee AP settings

Returns:



141
142
143
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 141

def zigbee_config
  @zigbee_config
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 273

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  aeroscout = ApAeroscout.from_hash(hash['aeroscout']) if hash['aeroscout']
  airista = ApAirista.from_hash(hash['airista']) if hash['airista']
  ble_config = BleConfig.from_hash(hash['ble_config']) if hash['ble_config']
  created_time = hash.key?('created_time') ? hash['created_time'] : SKIP
  disable_eth1 = hash['disable_eth1'] ||= false
  disable_eth2 = hash['disable_eth2'] ||= false
  disable_eth3 = hash['disable_eth3'] ||= false
  disable_module = hash['disable_module'] ||= false
  esl_config = ApEslConfig.from_hash(hash['esl_config']) if hash['esl_config']
  for_site = hash.key?('for_site') ? hash['for_site'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  iot_config = ApIot.from_hash(hash['iot_config']) if hash['iot_config']
  ip_config = ApIpConfig.from_hash(hash['ip_config']) if hash['ip_config']
  lacp_config = DeviceApLacpConfig.from_hash(hash['lacp_config']) if hash['lacp_config']
  led = ApLed.from_hash(hash['led']) if hash['led']
  mesh = ApMesh.from_hash(hash['mesh']) if hash['mesh']
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  ntp_servers = hash.key?('ntp_servers') ? hash['ntp_servers'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  poe_passthrough = hash['poe_passthrough'] ||= false
  port_config = ApPortConfig.from_hash(hash['port_config']) if hash['port_config']

  port_config = SKIP unless hash.key?('port_config')
  pwr_config = ApPwrConfig.from_hash(hash['pwr_config']) if hash['pwr_config']
  radio_config = ApRadio.from_hash(hash['radio_config']) if hash['radio_config']
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  switch_config = ApSwitch.from_hash(hash['switch_config']) if hash['switch_config']
  uplink_port_config = ApUplinkPortConfig.from_hash(hash['uplink_port_config']) if
    hash['uplink_port_config']
  usb_config = ApUsb.from_hash(hash['usb_config']) if hash['usb_config']
  vars = hash.key?('vars') ? hash['vars'] : SKIP
  zigbee_config = ApZigbee.from_hash(hash['zigbee_config']) if hash['zigbee_config']

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  DeviceprofileAp.new(aeroscout,
                      airista,
                      ble_config,
                      created_time,
                      disable_eth1,
                      disable_eth2,
                      disable_eth3,
                      disable_module,
                      esl_config,
                      for_site,
                      id,
                      iot_config,
                      ip_config,
                      lacp_config,
                      led,
                      mesh,
                      modified_time,
                      name,
                      ntp_servers,
                      org_id,
                      poe_passthrough,
                      port_config,
                      pwr_config,
                      radio_config,
                      site_id,
                      switch_config,
                      uplink_port_config,
                      usb_config,
                      vars,
                      zigbee_config,
                      additional_properties)
end

.namesObject

A mapping from model property names to API property names.



144
145
146
147
148
149
150
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
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 144

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['aeroscout'] = 'aeroscout'
  @_hash['airista'] = 'airista'
  @_hash['ble_config'] = 'ble_config'
  @_hash['created_time'] = 'created_time'
  @_hash['disable_eth1'] = 'disable_eth1'
  @_hash['disable_eth2'] = 'disable_eth2'
  @_hash['disable_eth3'] = 'disable_eth3'
  @_hash['disable_module'] = 'disable_module'
  @_hash['esl_config'] = 'esl_config'
  @_hash['for_site'] = 'for_site'
  @_hash['id'] = 'id'
  @_hash['iot_config'] = 'iot_config'
  @_hash['ip_config'] = 'ip_config'
  @_hash['lacp_config'] = 'lacp_config'
  @_hash['led'] = 'led'
  @_hash['mesh'] = 'mesh'
  @_hash['modified_time'] = 'modified_time'
  @_hash['name'] = 'name'
  @_hash['ntp_servers'] = 'ntp_servers'
  @_hash['org_id'] = 'org_id'
  @_hash['poe_passthrough'] = 'poe_passthrough'
  @_hash['port_config'] = 'port_config'
  @_hash['pwr_config'] = 'pwr_config'
  @_hash['radio_config'] = 'radio_config'
  @_hash['site_id'] = 'site_id'
  @_hash['switch_config'] = 'switch_config'
  @_hash['type'] = 'type'
  @_hash['uplink_port_config'] = 'uplink_port_config'
  @_hash['usb_config'] = 'usb_config'
  @_hash['vars'] = 'vars'
  @_hash['zigbee_config'] = 'zigbee_config'
  @_hash
end

.nullablesObject

An array for nullable fields



217
218
219
220
221
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 217

def self.nullables
  %w[
    name
  ]
end

.optionalsObject

An array for optional fields



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 181

def self.optionals
  %w[
    aeroscout
    airista
    ble_config
    created_time
    disable_eth1
    disable_eth2
    disable_eth3
    disable_module
    esl_config
    for_site
    id
    iot_config
    ip_config
    lacp_config
    led
    mesh
    modified_time
    name
    ntp_servers
    org_id
    poe_passthrough
    port_config
    pwr_config
    radio_config
    site_id
    switch_config
    uplink_port_config
    usb_config
    vars
    zigbee_config
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 369

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} aeroscout: #{@aeroscout.inspect}, airista: #{@airista.inspect}, ble_config:"\
  " #{@ble_config.inspect}, created_time: #{@created_time.inspect}, disable_eth1:"\
  " #{@disable_eth1.inspect}, disable_eth2: #{@disable_eth2.inspect}, disable_eth3:"\
  " #{@disable_eth3.inspect}, disable_module: #{@disable_module.inspect}, esl_config:"\
  " #{@esl_config.inspect}, for_site: #{@for_site.inspect}, id: #{@id.inspect}, iot_config:"\
  " #{@iot_config.inspect}, ip_config: #{@ip_config.inspect}, lacp_config:"\
  " #{@lacp_config.inspect}, led: #{@led.inspect}, mesh: #{@mesh.inspect}, modified_time:"\
  " #{@modified_time.inspect}, name: #{@name.inspect}, ntp_servers: #{@ntp_servers.inspect},"\
  " org_id: #{@org_id.inspect}, poe_passthrough: #{@poe_passthrough.inspect}, port_config:"\
  " #{@port_config.inspect}, pwr_config: #{@pwr_config.inspect}, radio_config:"\
  " #{@radio_config.inspect}, site_id: #{@site_id.inspect}, switch_config:"\
  " #{@switch_config.inspect}, type: #{@type.inspect}, uplink_port_config:"\
  " #{@uplink_port_config.inspect}, usb_config: #{@usb_config.inspect}, vars:"\
  " #{@vars.inspect}, zigbee_config: #{@zigbee_config.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/mist_api/models/deviceprofile_ap.rb', line 353

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} aeroscout: #{@aeroscout}, airista: #{@airista}, ble_config: #{@ble_config},"\
  " created_time: #{@created_time}, disable_eth1: #{@disable_eth1}, disable_eth2:"\
  " #{@disable_eth2}, disable_eth3: #{@disable_eth3}, disable_module: #{@disable_module},"\
  " esl_config: #{@esl_config}, for_site: #{@for_site}, id: #{@id}, iot_config:"\
  " #{@iot_config}, ip_config: #{@ip_config}, lacp_config: #{@lacp_config}, led: #{@led},"\
  " mesh: #{@mesh}, modified_time: #{@modified_time}, name: #{@name}, ntp_servers:"\
  " #{@ntp_servers}, org_id: #{@org_id}, poe_passthrough: #{@poe_passthrough}, port_config:"\
  " #{@port_config}, pwr_config: #{@pwr_config}, radio_config: #{@radio_config}, site_id:"\
  " #{@site_id}, switch_config: #{@switch_config}, type: #{@type}, uplink_port_config:"\
  " #{@uplink_port_config}, usb_config: #{@usb_config}, vars: #{@vars}, zigbee_config:"\
  " #{@zigbee_config}, additional_properties: #{@additional_properties}>"
end