Class: MistApi::JunosLocalPortConfig

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

Overview

Switch port config

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(usage = nil, all_networks = false, allow_dhcpd = SKIP, allow_multiple_supplicants = false, bypass_auth_when_server_down = false, bypass_auth_when_server_down_for_unknown_client = false, description = SKIP, disable_autoneg = false, disabled = false, duplex = SwitchPortLocalUsageDuplexEnum::AUTO, dynamic_vlan_networks = SKIP, enable_mac_auth = false, enable_qos = false, guest_network = SKIP, inter_switch_link = false, mac_auth_only = SKIP, mac_auth_preferred = SKIP, mac_auth_protocol = SwitchPortLocalUsageMacAuthProtocolEnum::EAPMD5, mac_limit = 0, mode = SKIP, mtu = SKIP, networks = SKIP, note = SKIP, persist_mac = false, poe_disabled = false, port_auth = SKIP, port_network = SKIP, reauth_interval = SKIP, server_fail_network = SKIP, server_reject_network = SKIP, speed = JunosPortConfigSpeedEnum::AUTO, storm_control = SKIP, stp_edge = false, stp_no_root_port = false, stp_p2p = false, use_vstp = false, voip_network = SKIP) ⇒ JunosLocalPortConfig

Returns a new instance of JunosLocalPortConfig.



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
# File 'lib/mist_api/models/junos_local_port_config.rb', line 284

def initialize(
  usage = nil, all_networks = false, allow_dhcpd = SKIP,
  allow_multiple_supplicants = false, bypass_auth_when_server_down = false,
  bypass_auth_when_server_down_for_unknown_client = false,
  description = SKIP, disable_autoneg = false, disabled = false,
  duplex = SwitchPortLocalUsageDuplexEnum::AUTO,
  dynamic_vlan_networks = SKIP, enable_mac_auth = false, enable_qos = false,
  guest_network = SKIP, inter_switch_link = false, mac_auth_only = SKIP,
  mac_auth_preferred = SKIP,
  mac_auth_protocol = SwitchPortLocalUsageMacAuthProtocolEnum::EAPMD5,
  mac_limit = 0, mode = SKIP, mtu = SKIP, networks = SKIP, note = SKIP,
  persist_mac = false, poe_disabled = false, port_auth = SKIP,
  port_network = SKIP, reauth_interval = SKIP, server_fail_network = SKIP,
  server_reject_network = SKIP, speed = JunosPortConfigSpeedEnum::AUTO,
  storm_control = SKIP, stp_edge = false, stp_no_root_port = false,
  stp_p2p = false, use_vstp = false, voip_network = SKIP
)
  @all_networks = all_networks unless all_networks == SKIP
  @allow_dhcpd = allow_dhcpd unless allow_dhcpd == SKIP
  unless allow_multiple_supplicants == SKIP
    @allow_multiple_supplicants =
      allow_multiple_supplicants
  end
  unless bypass_auth_when_server_down == SKIP
    @bypass_auth_when_server_down =
      bypass_auth_when_server_down
  end
  unless bypass_auth_when_server_down_for_unknown_client == SKIP
    @bypass_auth_when_server_down_for_unknown_client =
      bypass_auth_when_server_down_for_unknown_client
  end
  @description = description unless description == SKIP
  @disable_autoneg = disable_autoneg unless disable_autoneg == SKIP
  @disabled = disabled unless disabled == SKIP
  @duplex = duplex unless duplex == SKIP
  @dynamic_vlan_networks = dynamic_vlan_networks unless dynamic_vlan_networks == SKIP
  @enable_mac_auth = enable_mac_auth unless enable_mac_auth == SKIP
  @enable_qos = enable_qos unless enable_qos == SKIP
  @guest_network = guest_network unless guest_network == SKIP
  @inter_switch_link = inter_switch_link unless inter_switch_link == SKIP
  @mac_auth_only = mac_auth_only unless mac_auth_only == SKIP
  @mac_auth_preferred = mac_auth_preferred unless mac_auth_preferred == SKIP
  @mac_auth_protocol = mac_auth_protocol unless mac_auth_protocol == SKIP
  @mac_limit = mac_limit unless mac_limit == SKIP
  @mode = mode unless mode == SKIP
  @mtu = mtu unless mtu == SKIP
  @networks = networks unless networks == SKIP
  @note = note unless note == SKIP
  @persist_mac = persist_mac unless persist_mac == SKIP
  @poe_disabled = poe_disabled unless poe_disabled == SKIP
  @port_auth = port_auth unless port_auth == SKIP
  @port_network = port_network unless port_network == SKIP
  @reauth_interval = reauth_interval unless reauth_interval == SKIP
  @server_fail_network = server_fail_network unless server_fail_network == SKIP
  @server_reject_network = server_reject_network unless server_reject_network == SKIP
  @speed = speed unless speed == SKIP
  @storm_control = storm_control unless storm_control == SKIP
  @stp_edge = stp_edge unless stp_edge == SKIP
  @stp_no_root_port = stp_no_root_port unless stp_no_root_port == SKIP
  @stp_p2p = stp_p2p unless stp_p2p == SKIP
  @usage = usage
  @use_vstp = use_vstp unless use_vstp == SKIP
  @voip_network = voip_network unless voip_network == SKIP
end

Instance Attribute Details

#all_networksTrueClass | FalseClass

Only if ‘mode`==`trunk` whether to trunk all network/vlans

Returns:

  • (TrueClass | FalseClass)


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

def all_networks
  @all_networks
end

#allow_dhcpdTrueClass | FalseClass

Controls whether DHCP server traffic is allowed on ports using this configuration if DHCP snooping is enabled. This is a tri-state setting; ‘true`: ports become trusted ports allowing DHCP server traffic, `false`: ports become untrusted blocking DHCP server traffic, undefined: use system defaults (access ports default to untrusted, trunk ports default to trusted).

Returns:

  • (TrueClass | FalseClass)


23
24
25
# File 'lib/mist_api/models/junos_local_port_config.rb', line 23

def allow_dhcpd
  @allow_dhcpd
end

#allow_multiple_supplicantsTrueClass | FalseClass

Controls whether DHCP server traffic is allowed on ports using this configuration if DHCP snooping is enabled. This is a tri-state setting; ‘true`: ports become trusted ports allowing DHCP server traffic, `false`: ports become untrusted blocking DHCP server traffic, undefined: use system defaults (access ports default to untrusted, trunk ports default to trusted).

Returns:

  • (TrueClass | FalseClass)


32
33
34
# File 'lib/mist_api/models/junos_local_port_config.rb', line 32

def allow_multiple_supplicants
  @allow_multiple_supplicants
end

#bypass_auth_when_server_downTrueClass | FalseClass

Only if ‘port_auth`==`dot1x` bypass auth for known clients if set to true when RADIUS server is down

Returns:

  • (TrueClass | FalseClass)


37
38
39
# File 'lib/mist_api/models/junos_local_port_config.rb', line 37

def bypass_auth_when_server_down
  @bypass_auth_when_server_down
end

#bypass_auth_when_server_down_for_unknown_clientTrueClass | FalseClass

Only if ‘port_auth`=`dot1x` bypass auth for all (including unknown clients) if set to true when RADIUS server is down

Returns:

  • (TrueClass | FalseClass)


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

def bypass_auth_when_server_down_for_unknown_client
  @bypass_auth_when_server_down_for_unknown_client
end

#descriptionString

Only if ‘port_auth`=`dot1x` bypass auth for all (including unknown clients) if set to true when RADIUS server is down

Returns:

  • (String)


47
48
49
# File 'lib/mist_api/models/junos_local_port_config.rb', line 47

def description
  @description
end

#disable_autonegTrueClass | FalseClass

Only if ‘mode`!=`dynamic` if speed and duplex are specified, whether to disable autonegotiation

Returns:

  • (TrueClass | FalseClass)


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

def disable_autoneg
  @disable_autoneg
end

#disabledTrueClass | FalseClass

Whether the port is disabled

Returns:

  • (TrueClass | FalseClass)


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

def disabled
  @disabled
end

#duplexSwitchPortLocalUsageDuplexEnum

link connection mode. enum: ‘auto`, `full`, `half`



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

def duplex
  @duplex
end

#dynamic_vlan_networksArray[String]

Only if ‘port_auth`==`dot1x`, if dynamic vlan is used, specify the possible networks/vlans RADIUS can return

Returns:

  • (Array[String])


65
66
67
# File 'lib/mist_api/models/junos_local_port_config.rb', line 65

def dynamic_vlan_networks
  @dynamic_vlan_networks
end

#enable_mac_authTrueClass | FalseClass

Only if ‘port_auth`==`dot1x` whether to enable MAC Auth

Returns:

  • (TrueClass | FalseClass)


69
70
71
# File 'lib/mist_api/models/junos_local_port_config.rb', line 69

def enable_mac_auth
  @enable_mac_auth
end

#enable_qosTrueClass | FalseClass

Only if ‘port_auth`==`dot1x` whether to enable MAC Auth

Returns:

  • (TrueClass | FalseClass)


73
74
75
# File 'lib/mist_api/models/junos_local_port_config.rb', line 73

def enable_qos
  @enable_qos
end

#guest_networkString

Only if ‘port_auth`==`dot1x` which network to put the device into if the device cannot do dot1x. default is null (i.e. not allowed)

Returns:

  • (String)


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

def guest_network
  @guest_network
end

inter_switch_link is used together with “isolation” under networks. NOTE: inter_switch_link works only between Juniper devices. This has to be applied to both ports connected together

Returns:

  • (TrueClass | FalseClass)


84
85
86
# File 'lib/mist_api/models/junos_local_port_config.rb', line 84

def inter_switch_link
  @inter_switch_link
end

#mac_auth_onlyTrueClass | FalseClass

Only if ‘enable_mac_auth`==`true`

Returns:

  • (TrueClass | FalseClass)


88
89
90
# File 'lib/mist_api/models/junos_local_port_config.rb', line 88

def mac_auth_only
  @mac_auth_only
end

#mac_auth_preferredTrueClass | FalseClass

Only if ‘enable_mac_auth`==`true` + `mac_auth_only`==`false`, dot1x will be given priority then mac_auth. Enable this to prefer mac_auth over dot1x.

Returns:

  • (TrueClass | FalseClass)


94
95
96
# File 'lib/mist_api/models/junos_local_port_config.rb', line 94

def mac_auth_preferred
  @mac_auth_preferred
end

#mac_auth_protocolSwitchPortLocalUsageMacAuthProtocolEnum

Only if ‘enable_mac_auth` ==`true`. This type is ignored if mist_nac is enabled. enum: `eap-md5`, `eap-peap`, `pap`



99
100
101
# File 'lib/mist_api/models/junos_local_port_config.rb', line 99

def mac_auth_protocol
  @mac_auth_protocol
end

#mac_limitInteger

Max number of mac addresses, default is 0 for unlimited, otherwise range is 1 or higher, with upper bound constrained by platform

Returns:

  • (Integer)


104
105
106
# File 'lib/mist_api/models/junos_local_port_config.rb', line 104

def mac_limit
  @mac_limit
end

#modeSwitchPortLocalUsageModeEnum

enum: ‘access`, `inet`, `trunk`



108
109
110
# File 'lib/mist_api/models/junos_local_port_config.rb', line 108

def mode
  @mode
end

#mtuInteger

Media maximum transmission unit (MTU) is the largest data unit that can be forwarded without fragmentation. The default value is 1514.

Returns:

  • (Integer)


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

def mtu
  @mtu
end

#networksArray[String]

Only if ‘mode`==`trunk`, the list of network/vlans

Returns:

  • (Array[String])


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

def networks
  @networks
end

#noteString

Additional note for the port config override

Returns:

  • (String)


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

def note
  @note
end

#persist_macTrueClass | FalseClass

Only if ‘mode`==`access` and `port_auth`!=`dot1x` whether the port should retain dynamically learned MAC addresses

Returns:

  • (TrueClass | FalseClass)


126
127
128
# File 'lib/mist_api/models/junos_local_port_config.rb', line 126

def persist_mac
  @persist_mac
end

#poe_disabledTrueClass | FalseClass

Whether PoE capabilities are disabled for a port

Returns:

  • (TrueClass | FalseClass)


130
131
132
# File 'lib/mist_api/models/junos_local_port_config.rb', line 130

def poe_disabled
  @poe_disabled
end

#port_authSwitchPortLocalUsageDot1xEnum

if dot1x is desired, set to dot1x. enum: ‘dot1x`



134
135
136
# File 'lib/mist_api/models/junos_local_port_config.rb', line 134

def port_auth
  @port_auth
end

#port_networkString

Native network/vlan for untagged traffic

Returns:

  • (String)


138
139
140
# File 'lib/mist_api/models/junos_local_port_config.rb', line 138

def port_network
  @port_network
end

#reauth_intervalObject

Only if ‘mode`!=`dynamic` and `port_auth`=`dot1x` reauthentication interval range (min: 10, max: 65535, default: 3600). Set to 0 to disable reauthentication (no-reauthentication).

Returns:

  • (Object)


144
145
146
# File 'lib/mist_api/models/junos_local_port_config.rb', line 144

def reauth_interval
  @reauth_interval
end

#server_fail_networkString

Only if ‘port_auth`==`dot1x` sets server fail fallback vlan

Returns:

  • (String)


148
149
150
# File 'lib/mist_api/models/junos_local_port_config.rb', line 148

def server_fail_network
  @server_fail_network
end

#server_reject_networkString

Only if ‘port_auth`==`dot1x` when radius server reject / fails

Returns:

  • (String)


152
153
154
# File 'lib/mist_api/models/junos_local_port_config.rb', line 152

def server_reject_network
  @server_reject_network
end

#speedJunosPortConfigSpeedEnum

enum: ‘100m`, `10m`, `1g`, `2.5g`, `5g`, `10g`, `25g`, `40g`, `100g`,`auto`



157
158
159
# File 'lib/mist_api/models/junos_local_port_config.rb', line 157

def speed
  @speed
end

#storm_controlSwitchPortLocalUsageStormControl

Switch storm control



161
162
163
# File 'lib/mist_api/models/junos_local_port_config.rb', line 161

def storm_control
  @storm_control
end

#stp_edgeTrueClass | FalseClass

When enabled, the port is not expected to receive BPDU frames

Returns:

  • (TrueClass | FalseClass)


165
166
167
# File 'lib/mist_api/models/junos_local_port_config.rb', line 165

def stp_edge
  @stp_edge
end

#stp_no_root_portTrueClass | FalseClass

When enabled, the port is not expected to receive BPDU frames

Returns:

  • (TrueClass | FalseClass)


169
170
171
# File 'lib/mist_api/models/junos_local_port_config.rb', line 169

def stp_no_root_port
  @stp_no_root_port
end

#stp_p2pTrueClass | FalseClass

When enabled, the port is not expected to receive BPDU frames

Returns:

  • (TrueClass | FalseClass)


173
174
175
# File 'lib/mist_api/models/junos_local_port_config.rb', line 173

def stp_p2p
  @stp_p2p
end

#usageString

Port usage name.

Returns:

  • (String)


177
178
179
# File 'lib/mist_api/models/junos_local_port_config.rb', line 177

def usage
  @usage
end

#use_vstpTrueClass | FalseClass

If this is connected to a vstp network

Returns:

  • (TrueClass | FalseClass)


181
182
183
# File 'lib/mist_api/models/junos_local_port_config.rb', line 181

def use_vstp
  @use_vstp
end

#voip_networkString

Network/vlan for voip traffic, must also set port_network. to authenticate device, set port_auth

Returns:

  • (String)


186
187
188
# File 'lib/mist_api/models/junos_local_port_config.rb', line 186

def voip_network
  @voip_network
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/mist_api/models/junos_local_port_config.rb', line 350

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  usage = hash.key?('usage') ? hash['usage'] : nil
  all_networks = hash['all_networks'] ||= false
  allow_dhcpd = hash.key?('allow_dhcpd') ? hash['allow_dhcpd'] : SKIP
  allow_multiple_supplicants = hash['allow_multiple_supplicants'] ||= false
  bypass_auth_when_server_down =
    hash['bypass_auth_when_server_down'] ||= false
  bypass_auth_when_server_down_for_unknown_client =
    hash['bypass_auth_when_server_down_for_unknown_client'] ||= false
  description = hash.key?('description') ? hash['description'] : SKIP
  disable_autoneg = hash['disable_autoneg'] ||= false
  disabled = hash['disabled'] ||= false
  duplex = hash['duplex'] ||= SwitchPortLocalUsageDuplexEnum::AUTO
  dynamic_vlan_networks =
    hash.key?('dynamic_vlan_networks') ? hash['dynamic_vlan_networks'] : SKIP
  enable_mac_auth = hash['enable_mac_auth'] ||= false
  enable_qos = hash['enable_qos'] ||= false
  guest_network = hash.key?('guest_network') ? hash['guest_network'] : SKIP
  inter_switch_link = hash['inter_switch_link'] ||= false
  mac_auth_only = hash.key?('mac_auth_only') ? hash['mac_auth_only'] : SKIP
  mac_auth_preferred =
    hash.key?('mac_auth_preferred') ? hash['mac_auth_preferred'] : SKIP
  mac_auth_protocol =
    hash['mac_auth_protocol'] ||= SwitchPortLocalUsageMacAuthProtocolEnum::EAPMD5
  mac_limit = hash['mac_limit'] ||= 0
  mode = hash.key?('mode') ? hash['mode'] : SKIP
  mtu = hash.key?('mtu') ? hash['mtu'] : SKIP
  networks = hash.key?('networks') ? hash['networks'] : SKIP
  note = hash.key?('note') ? hash['note'] : SKIP
  persist_mac = hash['persist_mac'] ||= false
  poe_disabled = hash['poe_disabled'] ||= false
  port_auth = hash.key?('port_auth') ? hash['port_auth'] : SKIP
  port_network = hash.key?('port_network') ? hash['port_network'] : SKIP
  reauth_interval = hash.key?('reauth_interval') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:SwitchPortUsageReauthInterval), hash['reauth_interval']
  ) : SKIP
  server_fail_network =
    hash.key?('server_fail_network') ? hash['server_fail_network'] : SKIP
  server_reject_network =
    hash.key?('server_reject_network') ? hash['server_reject_network'] : SKIP
  speed = hash['speed'] ||= JunosPortConfigSpeedEnum::AUTO
  storm_control = SwitchPortLocalUsageStormControl.from_hash(hash['storm_control']) if
    hash['storm_control']
  stp_edge = hash['stp_edge'] ||= false
  stp_no_root_port = hash['stp_no_root_port'] ||= false
  stp_p2p = hash['stp_p2p'] ||= false
  use_vstp = hash['use_vstp'] ||= false
  voip_network = hash.key?('voip_network') ? hash['voip_network'] : SKIP

  # Create object from extracted values.
  JunosLocalPortConfig.new(usage,
                           all_networks,
                           allow_dhcpd,
                           allow_multiple_supplicants,
                           bypass_auth_when_server_down,
                           bypass_auth_when_server_down_for_unknown_client,
                           description,
                           disable_autoneg,
                           disabled,
                           duplex,
                           dynamic_vlan_networks,
                           enable_mac_auth,
                           enable_qos,
                           guest_network,
                           inter_switch_link,
                           mac_auth_only,
                           mac_auth_preferred,
                           mac_auth_protocol,
                           mac_limit,
                           mode,
                           mtu,
                           networks,
                           note,
                           persist_mac,
                           poe_disabled,
                           port_auth,
                           port_network,
                           reauth_interval,
                           server_fail_network,
                           server_reject_network,
                           speed,
                           storm_control,
                           stp_edge,
                           stp_no_root_port,
                           stp_p2p,
                           use_vstp,
                           voip_network)
end

.namesObject

A mapping from model property names to API property names.



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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/mist_api/models/junos_local_port_config.rb', line 189

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['all_networks'] = 'all_networks'
  @_hash['allow_dhcpd'] = 'allow_dhcpd'
  @_hash['allow_multiple_supplicants'] = 'allow_multiple_supplicants'
  @_hash['bypass_auth_when_server_down'] = 'bypass_auth_when_server_down'
  @_hash['bypass_auth_when_server_down_for_unknown_client'] =
    'bypass_auth_when_server_down_for_unknown_client'
  @_hash['description'] = 'description'
  @_hash['disable_autoneg'] = 'disable_autoneg'
  @_hash['disabled'] = 'disabled'
  @_hash['duplex'] = 'duplex'
  @_hash['dynamic_vlan_networks'] = 'dynamic_vlan_networks'
  @_hash['enable_mac_auth'] = 'enable_mac_auth'
  @_hash['enable_qos'] = 'enable_qos'
  @_hash['guest_network'] = 'guest_network'
  @_hash['inter_switch_link'] = 'inter_switch_link'
  @_hash['mac_auth_only'] = 'mac_auth_only'
  @_hash['mac_auth_preferred'] = 'mac_auth_preferred'
  @_hash['mac_auth_protocol'] = 'mac_auth_protocol'
  @_hash['mac_limit'] = 'mac_limit'
  @_hash['mode'] = 'mode'
  @_hash['mtu'] = 'mtu'
  @_hash['networks'] = 'networks'
  @_hash['note'] = 'note'
  @_hash['persist_mac'] = 'persist_mac'
  @_hash['poe_disabled'] = 'poe_disabled'
  @_hash['port_auth'] = 'port_auth'
  @_hash['port_network'] = 'port_network'
  @_hash['reauth_interval'] = 'reauth_interval'
  @_hash['server_fail_network'] = 'server_fail_network'
  @_hash['server_reject_network'] = 'server_reject_network'
  @_hash['speed'] = 'speed'
  @_hash['storm_control'] = 'storm_control'
  @_hash['stp_edge'] = 'stp_edge'
  @_hash['stp_no_root_port'] = 'stp_no_root_port'
  @_hash['stp_p2p'] = 'stp_p2p'
  @_hash['usage'] = 'usage'
  @_hash['use_vstp'] = 'use_vstp'
  @_hash['voip_network'] = 'voip_network'
  @_hash
end

.nullablesObject

An array for nullable fields



275
276
277
278
279
280
281
282
# File 'lib/mist_api/models/junos_local_port_config.rb', line 275

def self.nullables
  %w[
    guest_network
    port_auth
    server_fail_network
    server_reject_network
  ]
end

.optionalsObject

An array for optional fields



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
271
272
# File 'lib/mist_api/models/junos_local_port_config.rb', line 233

def self.optionals
  %w[
    all_networks
    allow_dhcpd
    allow_multiple_supplicants
    bypass_auth_when_server_down
    bypass_auth_when_server_down_for_unknown_client
    description
    disable_autoneg
    disabled
    duplex
    dynamic_vlan_networks
    enable_mac_auth
    enable_qos
    guest_network
    inter_switch_link
    mac_auth_only
    mac_auth_preferred
    mac_auth_protocol
    mac_limit
    mode
    mtu
    networks
    note
    persist_mac
    poe_disabled
    port_auth
    port_network
    reauth_interval
    server_fail_network
    server_reject_network
    speed
    storm_control
    stp_edge
    stp_no_root_port
    stp_p2p
    use_vstp
    voip_network
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



444
445
446
447
448
449
450
451
452
453
454
# File 'lib/mist_api/models/junos_local_port_config.rb', line 444

def self.validate(value)
  if value.instance_of? self
    return APIHelper.valid_type?(value.usage,
                                 ->(val) { val.instance_of? String })
  end

  return false unless value.instance_of? Hash

  APIHelper.valid_type?(value['usage'],
                        ->(val) { val.instance_of? String })
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
# File 'lib/mist_api/models/junos_local_port_config.rb', line 478

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} all_networks: #{@all_networks.inspect}, allow_dhcpd:"\
  " #{@allow_dhcpd.inspect}, allow_multiple_supplicants:"\
  " #{@allow_multiple_supplicants.inspect}, bypass_auth_when_server_down:"\
  " #{@bypass_auth_when_server_down.inspect}, bypass_auth_when_server_down_for_unknown_client:"\
  " #{@bypass_auth_when_server_down_for_unknown_client.inspect}, description:"\
  " #{@description.inspect}, disable_autoneg: #{@disable_autoneg.inspect}, disabled:"\
  " #{@disabled.inspect}, duplex: #{@duplex.inspect}, dynamic_vlan_networks:"\
  " #{@dynamic_vlan_networks.inspect}, enable_mac_auth: #{@enable_mac_auth.inspect},"\
  " enable_qos: #{@enable_qos.inspect}, guest_network: #{@guest_network.inspect},"\
  " inter_switch_link: #{@inter_switch_link.inspect}, mac_auth_only:"\
  " #{@mac_auth_only.inspect}, mac_auth_preferred: #{@mac_auth_preferred.inspect},"\
  " mac_auth_protocol: #{@mac_auth_protocol.inspect}, mac_limit: #{@mac_limit.inspect}, mode:"\
  " #{@mode.inspect}, mtu: #{@mtu.inspect}, networks: #{@networks.inspect}, note:"\
  " #{@note.inspect}, persist_mac: #{@persist_mac.inspect}, poe_disabled:"\
  " #{@poe_disabled.inspect}, port_auth: #{@port_auth.inspect}, port_network:"\
  " #{@port_network.inspect}, reauth_interval: #{@reauth_interval.inspect},"\
  " server_fail_network: #{@server_fail_network.inspect}, server_reject_network:"\
  " #{@server_reject_network.inspect}, speed: #{@speed.inspect}, storm_control:"\
  " #{@storm_control.inspect}, stp_edge: #{@stp_edge.inspect}, stp_no_root_port:"\
  " #{@stp_no_root_port.inspect}, stp_p2p: #{@stp_p2p.inspect}, usage: #{@usage.inspect},"\
  " use_vstp: #{@use_vstp.inspect}, voip_network: #{@voip_network.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
# File 'lib/mist_api/models/junos_local_port_config.rb', line 457

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} all_networks: #{@all_networks}, allow_dhcpd: #{@allow_dhcpd},"\
  " allow_multiple_supplicants: #{@allow_multiple_supplicants}, bypass_auth_when_server_down:"\
  " #{@bypass_auth_when_server_down}, bypass_auth_when_server_down_for_unknown_client:"\
  " #{@bypass_auth_when_server_down_for_unknown_client}, description: #{@description},"\
  " disable_autoneg: #{@disable_autoneg}, disabled: #{@disabled}, duplex: #{@duplex},"\
  " dynamic_vlan_networks: #{@dynamic_vlan_networks}, enable_mac_auth: #{@enable_mac_auth},"\
  " enable_qos: #{@enable_qos}, guest_network: #{@guest_network}, inter_switch_link:"\
  " #{@inter_switch_link}, mac_auth_only: #{@mac_auth_only}, mac_auth_preferred:"\
  " #{@mac_auth_preferred}, mac_auth_protocol: #{@mac_auth_protocol}, mac_limit:"\
  " #{@mac_limit}, mode: #{@mode}, mtu: #{@mtu}, networks: #{@networks}, note: #{@note},"\
  " persist_mac: #{@persist_mac}, poe_disabled: #{@poe_disabled}, port_auth: #{@port_auth},"\
  " port_network: #{@port_network}, reauth_interval: #{@reauth_interval}, server_fail_network:"\
  " #{@server_fail_network}, server_reject_network: #{@server_reject_network}, speed:"\
  " #{@speed}, storm_control: #{@storm_control}, stp_edge: #{@stp_edge}, stp_no_root_port:"\
  " #{@stp_no_root_port}, stp_p2p: #{@stp_p2p}, usage: #{@usage}, use_vstp: #{@use_vstp},"\
  " voip_network: #{@voip_network}>"
end