Class: MistApi::StatsApLldpStat

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

Overview

LLDP neighbor information and power negotiations. For backward compatibility, when multiple neighbors exist, only information from the first neighbor is displayed.

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(chassis_id = SKIP, lldp_med_supported = SKIP, mgmt_addr = SKIP, mgmt_addrs = SKIP, port_desc = SKIP, port_id = SKIP, power_allocated = SKIP, power_avail = SKIP, power_budget = SKIP, power_constrained = SKIP, power_draw = SKIP, power_needed = SKIP, power_opmode = SKIP, power_request_count = SKIP, power_requested = SKIP, power_src = SKIP, power_srcs = SKIP, system_desc = SKIP, system_name = SKIP) ⇒ StatsApLldpStat

Returns a new instance of StatsApLldpStat.



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

def initialize(chassis_id = SKIP, lldp_med_supported = SKIP,
               mgmt_addr = SKIP, mgmt_addrs = SKIP, port_desc = SKIP,
               port_id = SKIP, power_allocated = SKIP, power_avail = SKIP,
               power_budget = SKIP, power_constrained = SKIP,
               power_draw = SKIP, power_needed = SKIP, power_opmode = SKIP,
               power_request_count = SKIP, power_requested = SKIP,
               power_src = SKIP, power_srcs = SKIP, system_desc = SKIP,
               system_name = SKIP)
  @chassis_id = chassis_id unless chassis_id == SKIP
  @lldp_med_supported = lldp_med_supported unless lldp_med_supported == SKIP
  @mgmt_addr = mgmt_addr unless mgmt_addr == SKIP
  @mgmt_addrs = mgmt_addrs unless mgmt_addrs == SKIP
  @port_desc = port_desc unless port_desc == SKIP
  @port_id = port_id unless port_id == SKIP
  @power_allocated = power_allocated unless power_allocated == SKIP
  @power_avail = power_avail unless power_avail == SKIP
  @power_budget = power_budget unless power_budget == SKIP
  @power_constrained = power_constrained unless power_constrained == SKIP
  @power_draw = power_draw unless power_draw == SKIP
  @power_needed = power_needed unless power_needed == SKIP
  @power_opmode = power_opmode unless power_opmode == SKIP
  @power_request_count = power_request_count unless power_request_count == SKIP
  @power_requested = power_requested unless power_requested == SKIP
  @power_src = power_src unless power_src == SKIP
  @power_srcs = power_srcs unless power_srcs == SKIP
  @system_desc = system_desc unless system_desc == SKIP
  @system_name = system_name unless system_name == SKIP
end

Instance Attribute Details

#chassis_idString

TODO: Write general description for this method

Returns:

  • (String)


16
17
18
# File 'lib/mist_api/models/stats_ap_lldp_stat.rb', line 16

def chassis_id
  @chassis_id
end

#lldp_med_supportedTrueClass | FalseClass

Whether it support LLDP-MED

Returns:

  • (TrueClass | FalseClass)


20
21
22
# File 'lib/mist_api/models/stats_ap_lldp_stat.rb', line 20

def lldp_med_supported
  @lldp_med_supported
end

#mgmt_addrString

Management IP address of the switch

Returns:

  • (String)


24
25
26
# File 'lib/mist_api/models/stats_ap_lldp_stat.rb', line 24

def mgmt_addr
  @mgmt_addr
end

#mgmt_addrsArray[String]

List of management IP addresses (IPv4 and IPv6)

Returns:

  • (Array[String])


28
29
30
# File 'lib/mist_api/models/stats_ap_lldp_stat.rb', line 28

def mgmt_addrs
  @mgmt_addrs
end

#port_descString

Port description, e.g. “2/20”, “Port 2 on Switch0”

Returns:

  • (String)


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

def port_desc
  @port_desc
end

#port_idString

Port identifier

Returns:

  • (String)


36
37
38
# File 'lib/mist_api/models/stats_ap_lldp_stat.rb', line 36

def port_id
  @port_id
end

#power_allocatedFloat

In mW, power allocated by PSE

Returns:

  • (Float)


40
41
42
# File 'lib/mist_api/models/stats_ap_lldp_stat.rb', line 40

def power_allocated
  @power_allocated
end

#power_availInteger

In mW, total Power Avail at AP from pwr source

Returns:

  • (Integer)


44
45
46
# File 'lib/mist_api/models/stats_ap_lldp_stat.rb', line 44

def power_avail
  @power_avail
end

#power_budgetInteger

In mW, surplus if positive or deficit if negative

Returns:

  • (Integer)


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

def power_budget
  @power_budget
end

#power_constrainedTrueClass | FalseClass

Whether power is insufficient

Returns:

  • (TrueClass | FalseClass)


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

def power_constrained
  @power_constrained
end

#power_drawFloat

In mW, total power needed by PD

Returns:

  • (Float)


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

def power_draw
  @power_draw
end

#power_neededInteger

In mW, total Power needed incl Peripherals

Returns:

  • (Integer)


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

def power_needed
  @power_needed
end

#power_opmodeString

Constrained mode

Returns:

  • (String)


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

def power_opmode
  @power_opmode
end

#power_request_countInteger

Number of negotiations, if it keeps increasing, we don’ t have a stable power

Returns:

  • (Integer)


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

def power_request_count
  @power_request_count
end

#power_requestedFloat

In mW, power requested by PD

Returns:

  • (Float)


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

def power_requested
  @power_requested
end

#power_srcString

Single power source (DC Input / PoE 802.3at / PoE 802.3af / PoE 802.3bt / MULTI-PD / LLDP / ? (unknown)).

Returns:

  • (String)


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

def power_src
  @power_src
end

#power_srcsArray[String]

List of management IP addresses (IPv4 and IPv6)

Returns:

  • (Array[String])


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

def power_srcs
  @power_srcs
end

#system_descString

Description provided by switch

Returns:

  • (String)


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

def system_desc
  @system_desc
end

#system_nameString

Name of the switch

Returns:

  • (String)


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

def system_name
  @system_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
231
232
233
234
235
236
237
238
# File 'lib/mist_api/models/stats_ap_lldp_stat.rb', line 189

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  chassis_id = hash.key?('chassis_id') ? hash['chassis_id'] : SKIP
  lldp_med_supported =
    hash.key?('lldp_med_supported') ? hash['lldp_med_supported'] : SKIP
  mgmt_addr = hash.key?('mgmt_addr') ? hash['mgmt_addr'] : SKIP
  mgmt_addrs = hash.key?('mgmt_addrs') ? hash['mgmt_addrs'] : SKIP
  port_desc = hash.key?('port_desc') ? hash['port_desc'] : SKIP
  port_id = hash.key?('port_id') ? hash['port_id'] : SKIP
  power_allocated =
    hash.key?('power_allocated') ? hash['power_allocated'] : SKIP
  power_avail = hash.key?('power_avail') ? hash['power_avail'] : SKIP
  power_budget = hash.key?('power_budget') ? hash['power_budget'] : SKIP
  power_constrained =
    hash.key?('power_constrained') ? hash['power_constrained'] : SKIP
  power_draw = hash.key?('power_draw') ? hash['power_draw'] : SKIP
  power_needed = hash.key?('power_needed') ? hash['power_needed'] : SKIP
  power_opmode = hash.key?('power_opmode') ? hash['power_opmode'] : SKIP
  power_request_count =
    hash.key?('power_request_count') ? hash['power_request_count'] : SKIP
  power_requested =
    hash.key?('power_requested') ? hash['power_requested'] : SKIP
  power_src = hash.key?('power_src') ? hash['power_src'] : SKIP
  power_srcs = hash.key?('power_srcs') ? hash['power_srcs'] : SKIP
  system_desc = hash.key?('system_desc') ? hash['system_desc'] : SKIP
  system_name = hash.key?('system_name') ? hash['system_name'] : SKIP

  # Create object from extracted values.
  StatsApLldpStat.new(chassis_id,
                      lldp_med_supported,
                      mgmt_addr,
                      mgmt_addrs,
                      port_desc,
                      port_id,
                      power_allocated,
                      power_avail,
                      power_budget,
                      power_constrained,
                      power_draw,
                      power_needed,
                      power_opmode,
                      power_request_count,
                      power_requested,
                      power_src,
                      power_srcs,
                      system_desc,
                      system_name)
end

.namesObject

A mapping from model property names to API property names.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/mist_api/models/stats_ap_lldp_stat.rb', line 93

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['chassis_id'] = 'chassis_id'
  @_hash['lldp_med_supported'] = 'lldp_med_supported'
  @_hash['mgmt_addr'] = 'mgmt_addr'
  @_hash['mgmt_addrs'] = 'mgmt_addrs'
  @_hash['port_desc'] = 'port_desc'
  @_hash['port_id'] = 'port_id'
  @_hash['power_allocated'] = 'power_allocated'
  @_hash['power_avail'] = 'power_avail'
  @_hash['power_budget'] = 'power_budget'
  @_hash['power_constrained'] = 'power_constrained'
  @_hash['power_draw'] = 'power_draw'
  @_hash['power_needed'] = 'power_needed'
  @_hash['power_opmode'] = 'power_opmode'
  @_hash['power_request_count'] = 'power_request_count'
  @_hash['power_requested'] = 'power_requested'
  @_hash['power_src'] = 'power_src'
  @_hash['power_srcs'] = 'power_srcs'
  @_hash['system_desc'] = 'system_desc'
  @_hash['system_name'] = 'system_name'
  @_hash
end

.nullablesObject

An array for nullable fields



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/mist_api/models/stats_ap_lldp_stat.rb', line 143

def self.nullables
  %w[
    chassis_id
    lldp_med_supported
    mgmt_addr
    port_desc
    port_id
    power_allocated
    power_draw
    power_request_count
    power_requested
    system_desc
    system_name
  ]
end

.optionalsObject

An array for optional fields



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/mist_api/models/stats_ap_lldp_stat.rb', line 118

def self.optionals
  %w[
    chassis_id
    lldp_med_supported
    mgmt_addr
    mgmt_addrs
    port_desc
    port_id
    power_allocated
    power_avail
    power_budget
    power_constrained
    power_draw
    power_needed
    power_opmode
    power_request_count
    power_requested
    power_src
    power_srcs
    system_desc
    system_name
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/mist_api/models/stats_ap_lldp_stat.rb', line 254

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} chassis_id: #{@chassis_id.inspect}, lldp_med_supported:"\
  " #{@lldp_med_supported.inspect}, mgmt_addr: #{@mgmt_addr.inspect}, mgmt_addrs:"\
  " #{@mgmt_addrs.inspect}, port_desc: #{@port_desc.inspect}, port_id: #{@port_id.inspect},"\
  " power_allocated: #{@power_allocated.inspect}, power_avail: #{@power_avail.inspect},"\
  " power_budget: #{@power_budget.inspect}, power_constrained: #{@power_constrained.inspect},"\
  " power_draw: #{@power_draw.inspect}, power_needed: #{@power_needed.inspect}, power_opmode:"\
  " #{@power_opmode.inspect}, power_request_count: #{@power_request_count.inspect},"\
  " power_requested: #{@power_requested.inspect}, power_src: #{@power_src.inspect},"\
  " power_srcs: #{@power_srcs.inspect}, system_desc: #{@system_desc.inspect}, system_name:"\
  " #{@system_name.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



241
242
243
244
245
246
247
248
249
250
251
# File 'lib/mist_api/models/stats_ap_lldp_stat.rb', line 241

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} chassis_id: #{@chassis_id}, lldp_med_supported: #{@lldp_med_supported},"\
  " mgmt_addr: #{@mgmt_addr}, mgmt_addrs: #{@mgmt_addrs}, port_desc: #{@port_desc}, port_id:"\
  " #{@port_id}, power_allocated: #{@power_allocated}, power_avail: #{@power_avail},"\
  " power_budget: #{@power_budget}, power_constrained: #{@power_constrained}, power_draw:"\
  " #{@power_draw}, power_needed: #{@power_needed}, power_opmode: #{@power_opmode},"\
  " power_request_count: #{@power_request_count}, power_requested: #{@power_requested},"\
  " power_src: #{@power_src}, power_srcs: #{@power_srcs}, system_desc: #{@system_desc},"\
  " system_name: #{@system_name}>"
end