Class: MistApi::StatsGatewayModuleStatItem

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

Overview

StatsGatewayModuleStatItem Model.

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(backup_version = SKIP, bios_version = SKIP, boot_partition = SKIP, cpld_version = SKIP, fans = SKIP, fpga_version = SKIP, last_seen = SKIP, locating = SKIP, mac = SKIP, memory_stat = SKIP, model = SKIP, network_resources = SKIP, optics_cpld_version = SKIP, pending_version = SKIP, poe = SKIP, poe_version = SKIP, power_cpld_version = SKIP, psus = SKIP, re_fpga_version = SKIP, recovery_version = SKIP, serial = SKIP, status = SKIP, temperatures = SKIP, tmc_fpga_version = SKIP, uboot_version = SKIP, uptime = SKIP, vc_links = SKIP, vc_mode = SKIP, vc_role = SKIP, vc_state = SKIP, version = SKIP) ⇒ StatsGatewayModuleStatItem

Returns a new instance of StatsGatewayModuleStatItem.



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
273
274
275
276
277
278
279
280
# File 'lib/mist_api/models/stats_gateway_module_stat_item.rb', line 237

def initialize(backup_version = SKIP, bios_version = SKIP,
               boot_partition = SKIP, cpld_version = SKIP, fans = SKIP,
               fpga_version = SKIP, last_seen = SKIP, locating = SKIP,
               mac = SKIP, memory_stat = SKIP, model = SKIP,
               network_resources = SKIP, optics_cpld_version = SKIP,
               pending_version = SKIP, poe = SKIP, poe_version = SKIP,
               power_cpld_version = SKIP, psus = SKIP,
               re_fpga_version = SKIP, recovery_version = SKIP,
               serial = SKIP, status = SKIP, temperatures = SKIP,
               tmc_fpga_version = SKIP, uboot_version = SKIP, uptime = SKIP,
               vc_links = SKIP, vc_mode = SKIP, vc_role = SKIP,
               vc_state = SKIP, version = SKIP)
  @backup_version = backup_version unless backup_version == SKIP
  @bios_version = bios_version unless bios_version == SKIP
  @boot_partition = boot_partition unless boot_partition == SKIP
  @cpld_version = cpld_version unless cpld_version == SKIP
  @fans = fans unless fans == SKIP
  @fpga_version = fpga_version unless fpga_version == SKIP
  @last_seen = last_seen unless last_seen == SKIP
  @locating = locating unless locating == SKIP
  @mac = mac unless mac == SKIP
  @memory_stat = memory_stat unless memory_stat == SKIP
  @model = model unless model == SKIP
  @network_resources = network_resources unless network_resources == SKIP
  @optics_cpld_version = optics_cpld_version unless optics_cpld_version == SKIP
  @pending_version = pending_version unless pending_version == SKIP
  @poe = poe unless poe == SKIP
  @poe_version = poe_version unless poe_version == SKIP
  @power_cpld_version = power_cpld_version unless power_cpld_version == SKIP
  @psus = psus unless psus == SKIP
  @re_fpga_version = re_fpga_version unless re_fpga_version == SKIP
  @recovery_version = recovery_version unless recovery_version == SKIP
  @serial = serial unless serial == SKIP
  @status = status unless status == SKIP
  @temperatures = temperatures unless temperatures == SKIP
  @tmc_fpga_version = tmc_fpga_version unless tmc_fpga_version == SKIP
  @uboot_version = uboot_version unless uboot_version == SKIP
  @uptime = uptime unless uptime == SKIP
  @vc_links = vc_links unless vc_links == SKIP
  @vc_mode = vc_mode unless vc_mode == SKIP
  @vc_role = vc_role unless vc_role == SKIP
  @vc_state = vc_state unless vc_state == SKIP
  @version = version unless version == SKIP
end

Instance Attribute Details

#backup_versionString

TODO: Write general description for this method

Returns:

  • (String)


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

def backup_version
  @backup_version
end

#bios_versionString

TODO: Write general description for this method

Returns:

  • (String)


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

def bios_version
  @bios_version
end

#boot_partitionString

TODO: Write general description for this method

Returns:

  • (String)


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

def boot_partition
  @boot_partition
end

#cpld_versionString

TODO: Write general description for this method

Returns:

  • (String)


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

def cpld_version
  @cpld_version
end

#fansArray[ModuleStatItemFansItems]

TODO: Write general description for this method

Returns:



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

def fans
  @fans
end

#fpga_versionString

TODO: Write general description for this method

Returns:

  • (String)


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

def fpga_version
  @fpga_version
end

#last_seenFloat

Last seen timestamp

Returns:

  • (Float)


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

def last_seen
  @last_seen
end

#locatingTrueClass | FalseClass

Last seen timestamp

Returns:

  • (TrueClass | FalseClass)


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

def locating
  @locating
end

#macString

Last seen timestamp

Returns:

  • (String)


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

def mac
  @mac
end

#memory_statMemoryStat

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:



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

def memory_stat
  @memory_stat
end

#modelString

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:

  • (String)


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

def model
  @model
end

#network_resourcesArray[ModuleStatItemNetworkResource]

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:



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

def network_resources
  @network_resources
end

#optics_cpld_versionString

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:

  • (String)


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

def optics_cpld_version
  @optics_cpld_version
end

#pending_versionString

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:

  • (String)


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

def pending_version
  @pending_version
end

#poeModuleStatItemPoe

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:



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

def poe
  @poe
end

#poe_versionString

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:

  • (String)


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

def poe_version
  @poe_version
end

#power_cpld_versionString

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:

  • (String)


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

def power_cpld_version
  @power_cpld_version
end

#psusArray[ModuleStatItemPsusItem]

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:



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

def psus
  @psus
end

#re_fpga_versionString

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:

  • (String)


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

def re_fpga_version
  @re_fpga_version
end

#recovery_versionString

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:

  • (String)


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

def recovery_version
  @recovery_version
end

#serialString

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:

  • (String)


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

def serial
  @serial
end

#statusString

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:

  • (String)


98
99
100
# File 'lib/mist_api/models/stats_gateway_module_stat_item.rb', line 98

def status
  @status
end

#temperaturesArray[ModuleStatItemTemperaturesItem]

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:



102
103
104
# File 'lib/mist_api/models/stats_gateway_module_stat_item.rb', line 102

def temperatures
  @temperatures
end

#tmc_fpga_versionString

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:

  • (String)


106
107
108
# File 'lib/mist_api/models/stats_gateway_module_stat_item.rb', line 106

def tmc_fpga_version
  @tmc_fpga_version
end

#uboot_versionString

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:

  • (String)


110
111
112
# File 'lib/mist_api/models/stats_gateway_module_stat_item.rb', line 110

def uboot_version
  @uboot_version
end

#uptimeInteger

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:

  • (Integer)


114
115
116
# File 'lib/mist_api/models/stats_gateway_module_stat_item.rb', line 114

def uptime
  @uptime
end

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:



118
119
120
# File 'lib/mist_api/models/stats_gateway_module_stat_item.rb', line 118

def vc_links
  @vc_links
end

#vc_modeString

Memory usage stat (for virtual chassis, memory usage of master RE)

Returns:

  • (String)


122
123
124
# File 'lib/mist_api/models/stats_gateway_module_stat_item.rb', line 122

def vc_mode
  @vc_mode
end

#vc_roleString

enum: ‘master`, `backup`, `linecard`

Returns:

  • (String)


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

def vc_role
  @vc_role
end

#vc_stateString

enum: ‘master`, `backup`, `linecard`

Returns:

  • (String)


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

def vc_state
  @vc_state
end

#versionString

enum: ‘master`, `backup`, `linecard`

Returns:

  • (String)


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

def version
  @version
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  backup_version =
    hash.key?('backup_version') ? hash['backup_version'] : SKIP
  bios_version = hash.key?('bios_version') ? hash['bios_version'] : SKIP
  boot_partition =
    hash.key?('boot_partition') ? hash['boot_partition'] : SKIP
  cpld_version = hash.key?('cpld_version') ? hash['cpld_version'] : SKIP
  # Parameter is an array, so we need to iterate through it
  fans = nil
  unless hash['fans'].nil?
    fans = []
    hash['fans'].each do |structure|
      fans << (ModuleStatItemFansItems.from_hash(structure) if structure)
    end
  end

  fans = SKIP unless hash.key?('fans')
  fpga_version = hash.key?('fpga_version') ? hash['fpga_version'] : SKIP
  last_seen = hash.key?('last_seen') ? hash['last_seen'] : SKIP
  locating = hash.key?('locating') ? hash['locating'] : SKIP
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  memory_stat = MemoryStat.from_hash(hash['memory_stat']) if hash['memory_stat']
  model = hash.key?('model') ? hash['model'] : SKIP
  # Parameter is an array, so we need to iterate through it
  network_resources = nil
  unless hash['network_resources'].nil?
    network_resources = []
    hash['network_resources'].each do |structure|
      network_resources << (ModuleStatItemNetworkResource.from_hash(structure) if structure)
    end
  end

  network_resources = SKIP unless hash.key?('network_resources')
  optics_cpld_version =
    hash.key?('optics_cpld_version') ? hash['optics_cpld_version'] : SKIP
  pending_version =
    hash.key?('pending_version') ? hash['pending_version'] : SKIP
  poe = ModuleStatItemPoe.from_hash(hash['poe']) if hash['poe']
  poe_version = hash.key?('poe_version') ? hash['poe_version'] : SKIP
  power_cpld_version =
    hash.key?('power_cpld_version') ? hash['power_cpld_version'] : SKIP
  # Parameter is an array, so we need to iterate through it
  psus = nil
  unless hash['psus'].nil?
    psus = []
    hash['psus'].each do |structure|
      psus << (ModuleStatItemPsusItem.from_hash(structure) if structure)
    end
  end

  psus = SKIP unless hash.key?('psus')
  re_fpga_version =
    hash.key?('re_fpga_version') ? hash['re_fpga_version'] : SKIP
  recovery_version =
    hash.key?('recovery_version') ? hash['recovery_version'] : SKIP
  serial = hash.key?('serial') ? hash['serial'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  # Parameter is an array, so we need to iterate through it
  temperatures = nil
  unless hash['temperatures'].nil?
    temperatures = []
    hash['temperatures'].each do |structure|
      temperatures << (ModuleStatItemTemperaturesItem.from_hash(structure) if structure)
    end
  end

  temperatures = SKIP unless hash.key?('temperatures')
  tmc_fpga_version =
    hash.key?('tmc_fpga_version') ? hash['tmc_fpga_version'] : SKIP
  uboot_version = hash.key?('uboot_version') ? hash['uboot_version'] : SKIP
  uptime = hash.key?('uptime') ? hash['uptime'] : SKIP
  # Parameter is an array, so we need to iterate through it
  vc_links = nil
  unless hash['vc_links'].nil?
    vc_links = []
    hash['vc_links'].each do |structure|
      vc_links << (ModuleStatItemVcLinksItem.from_hash(structure) if structure)
    end
  end

  vc_links = SKIP unless hash.key?('vc_links')
  vc_mode = hash.key?('vc_mode') ? hash['vc_mode'] : SKIP
  vc_role = hash.key?('vc_role') ? hash['vc_role'] : SKIP
  vc_state = hash.key?('vc_state') ? hash['vc_state'] : SKIP
  version = hash.key?('version') ? hash['version'] : SKIP

  # Create object from extracted values.
  StatsGatewayModuleStatItem.new(backup_version,
                                 bios_version,
                                 boot_partition,
                                 cpld_version,
                                 fans,
                                 fpga_version,
                                 last_seen,
                                 locating,
                                 mac,
                                 memory_stat,
                                 model,
                                 network_resources,
                                 optics_cpld_version,
                                 pending_version,
                                 poe,
                                 poe_version,
                                 power_cpld_version,
                                 psus,
                                 re_fpga_version,
                                 recovery_version,
                                 serial,
                                 status,
                                 temperatures,
                                 tmc_fpga_version,
                                 uboot_version,
                                 uptime,
                                 vc_links,
                                 vc_mode,
                                 vc_role,
                                 vc_state,
                                 version)
end

.namesObject

A mapping from model property names to API property names.



137
138
139
140
141
142
143
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
# File 'lib/mist_api/models/stats_gateway_module_stat_item.rb', line 137

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['backup_version'] = 'backup_version'
  @_hash['bios_version'] = 'bios_version'
  @_hash['boot_partition'] = 'boot_partition'
  @_hash['cpld_version'] = 'cpld_version'
  @_hash['fans'] = 'fans'
  @_hash['fpga_version'] = 'fpga_version'
  @_hash['last_seen'] = 'last_seen'
  @_hash['locating'] = 'locating'
  @_hash['mac'] = 'mac'
  @_hash['memory_stat'] = 'memory_stat'
  @_hash['model'] = 'model'
  @_hash['network_resources'] = 'network_resources'
  @_hash['optics_cpld_version'] = 'optics_cpld_version'
  @_hash['pending_version'] = 'pending_version'
  @_hash['poe'] = 'poe'
  @_hash['poe_version'] = 'poe_version'
  @_hash['power_cpld_version'] = 'power_cpld_version'
  @_hash['psus'] = 'psus'
  @_hash['re_fpga_version'] = 're_fpga_version'
  @_hash['recovery_version'] = 'recovery_version'
  @_hash['serial'] = 'serial'
  @_hash['status'] = 'status'
  @_hash['temperatures'] = 'temperatures'
  @_hash['tmc_fpga_version'] = 'tmc_fpga_version'
  @_hash['uboot_version'] = 'uboot_version'
  @_hash['uptime'] = 'uptime'
  @_hash['vc_links'] = 'vc_links'
  @_hash['vc_mode'] = 'vc_mode'
  @_hash['vc_role'] = 'vc_role'
  @_hash['vc_state'] = 'vc_state'
  @_hash['version'] = 'version'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  %w[
    backup_version
    bios_version
    cpld_version
    fpga_version
    last_seen
    model
    optics_cpld_version
    pending_version
    poe_version
    power_cpld_version
    re_fpga_version
    recovery_version
    serial
    status
    tmc_fpga_version
    uboot_version
    uptime
    vc_mode
    vc_role
    vc_state
    version
  ]
end

.optionalsObject

An array for optional fields



174
175
176
177
178
179
180
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
# File 'lib/mist_api/models/stats_gateway_module_stat_item.rb', line 174

def self.optionals
  %w[
    backup_version
    bios_version
    boot_partition
    cpld_version
    fans
    fpga_version
    last_seen
    locating
    mac
    memory_stat
    model
    network_resources
    optics_cpld_version
    pending_version
    poe
    poe_version
    power_cpld_version
    psus
    re_fpga_version
    recovery_version
    serial
    status
    temperatures
    tmc_fpga_version
    uboot_version
    uptime
    vc_links
    vc_mode
    vc_role
    vc_state
    version
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'lib/mist_api/models/stats_gateway_module_stat_item.rb', line 423

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} backup_version: #{@backup_version.inspect}, bios_version:"\
  " #{@bios_version.inspect}, boot_partition: #{@boot_partition.inspect}, cpld_version:"\
  " #{@cpld_version.inspect}, fans: #{@fans.inspect}, fpga_version: #{@fpga_version.inspect},"\
  " last_seen: #{@last_seen.inspect}, locating: #{@locating.inspect}, mac: #{@mac.inspect},"\
  " memory_stat: #{@memory_stat.inspect}, model: #{@model.inspect}, network_resources:"\
  " #{@network_resources.inspect}, optics_cpld_version: #{@optics_cpld_version.inspect},"\
  " pending_version: #{@pending_version.inspect}, poe: #{@poe.inspect}, poe_version:"\
  " #{@poe_version.inspect}, power_cpld_version: #{@power_cpld_version.inspect}, psus:"\
  " #{@psus.inspect}, re_fpga_version: #{@re_fpga_version.inspect}, recovery_version:"\
  " #{@recovery_version.inspect}, serial: #{@serial.inspect}, status: #{@status.inspect},"\
  " temperatures: #{@temperatures.inspect}, tmc_fpga_version: #{@tmc_fpga_version.inspect},"\
  " uboot_version: #{@uboot_version.inspect}, uptime: #{@uptime.inspect}, vc_links:"\
  " #{@vc_links.inspect}, vc_mode: #{@vc_mode.inspect}, vc_role: #{@vc_role.inspect},"\
  " vc_state: #{@vc_state.inspect}, version: #{@version.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/mist_api/models/stats_gateway_module_stat_item.rb', line 407

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} backup_version: #{@backup_version}, bios_version: #{@bios_version},"\
  " boot_partition: #{@boot_partition}, cpld_version: #{@cpld_version}, fans: #{@fans},"\
  " fpga_version: #{@fpga_version}, last_seen: #{@last_seen}, locating: #{@locating}, mac:"\
  " #{@mac}, memory_stat: #{@memory_stat}, model: #{@model}, network_resources:"\
  " #{@network_resources}, optics_cpld_version: #{@optics_cpld_version}, pending_version:"\
  " #{@pending_version}, poe: #{@poe}, poe_version: #{@poe_version}, power_cpld_version:"\
  " #{@power_cpld_version}, psus: #{@psus}, re_fpga_version: #{@re_fpga_version},"\
  " recovery_version: #{@recovery_version}, serial: #{@serial}, status: #{@status},"\
  " temperatures: #{@temperatures}, tmc_fpga_version: #{@tmc_fpga_version}, uboot_version:"\
  " #{@uboot_version}, uptime: #{@uptime}, vc_links: #{@vc_links}, vc_mode: #{@vc_mode},"\
  " vc_role: #{@vc_role}, vc_state: #{@vc_state}, version: #{@version}>"
end