Class: MistApi::StatsSwitch
- Defined in:
- lib/mist_api/models/stats_switch.rb
Overview
Switch statistics
Instance Attribute Summary collapse
-
#ap_redundancy ⇒ StatsSwitchApRedundancy
TODO: Write general description for this method.
-
#arp_table_stats ⇒ ArpTableStats
TODO: Write general description for this method.
-
#auto_upgrade_stat ⇒ StatsApAutoUpgrade
TODO: Write general description for this method.
-
#cert_expiry ⇒ Integer
TODO: Write general description for this method.
-
#clients ⇒ Array[StatsSwitchClientItem]
TODO: Write general description for this method.
-
#clients_stats ⇒ StatsSwitchClientsStats
TODO: Write general description for this method.
-
#config_status ⇒ String
TODO: Write general description for this method.
-
#config_timestamp ⇒ Integer
TODO: Write general description for this method.
-
#config_version ⇒ Integer
TODO: Write general description for this method.
-
#cpu_stat ⇒ CpuStat
TODO: Write general description for this method.
-
#created_time ⇒ Float
When the object has been created, in epoch.
-
#deviceprofile_id ⇒ UUID | String
When the object has been created, in epoch.
-
#dhcpd_stat ⇒ Hash[String, DhcpdStatLan]
Property key is the network name.
-
#evpntopo_id ⇒ UUID | String
Property key is the network name.
-
#ext_ip ⇒ String
Property key is the network name.
-
#fw_versions_outofsync ⇒ TrueClass | FalseClass
Property key is the network name.
-
#fwupdate ⇒ FwupdateStat
Property key is the network name.
-
#has_pcap ⇒ TrueClass | FalseClass
Whether the switch supports packet capture.
-
#hostname ⇒ String
Hostname reported by the device.
-
#hw_rev ⇒ String
Device hardware revision number.
-
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#if_stat ⇒ Hash[String, IfStatProperty]
Property key is the interface name.
-
#ip ⇒ String
Property key is the interface name.
-
#ip_stat ⇒ IpStat
Property key is the interface name.
-
#last_seen ⇒ Float
Last seen timestamp.
-
#last_trouble ⇒ LastTrouble
Last trouble code of switch.
-
#mac ⇒ String
Last trouble code of switch.
-
#mac_table_stats ⇒ MacTableStats
Last trouble code of switch.
-
#map_id ⇒ UUID | String
Last trouble code of switch.
-
#memory_stat ⇒ MemoryStat
Memory usage stat (for virtual chassis, memory usage of master RE).
-
#model ⇒ String
Memory usage stat (for virtual chassis, memory usage of master RE).
-
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch.
-
#module_stat ⇒ Array[StatsSwitchModuleStatItem]
When the object has been modified for the last time, in epoch.
-
#name ⇒ String
Device name if configured.
-
#org_id ⇒ UUID | String
Device name if configured.
-
#ports ⇒ Array[StatsSwitchPort]
Device name if configured.
-
#route_summary_stats ⇒ RouteSummaryStats
Device name if configured.
-
#serial ⇒ String
Device name if configured.
-
#service_stat ⇒ Hash[String, ServiceStatProperty]
Device name if configured.
-
#site_id ⇒ UUID | String
Device name if configured.
-
#status ⇒ String
Device name if configured.
-
#tag_id ⇒ Integer
Device name if configured.
-
#tag_uuid ⇒ UUID | String
Device name if configured.
-
#type ⇒ String
readonly
Device Type.
-
#uptime ⇒ Float
Device Type.
-
#vc_mac ⇒ String
Device Type.
-
#vc_setup_info ⇒ StatsSwitchVcSetupInfo
Device Type.
-
#version ⇒ String
Device Type.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(ap_redundancy = SKIP, arp_table_stats = SKIP, auto_upgrade_stat = SKIP, cert_expiry = SKIP, clients = SKIP, clients_stats = SKIP, config_status = SKIP, config_timestamp = SKIP, config_version = SKIP, cpu_stat = SKIP, created_time = SKIP, deviceprofile_id = SKIP, dhcpd_stat = SKIP, evpntopo_id = SKIP, ext_ip = SKIP, fw_versions_outofsync = SKIP, fwupdate = SKIP, has_pcap = SKIP, hostname = SKIP, hw_rev = SKIP, id = SKIP, if_stat = SKIP, ip = SKIP, ip_stat = SKIP, last_seen = SKIP, last_trouble = SKIP, mac = SKIP, mac_table_stats = SKIP, map_id = SKIP, memory_stat = SKIP, model = SKIP, modified_time = SKIP, module_stat = SKIP, name = SKIP, org_id = SKIP, ports = SKIP, route_summary_stats = SKIP, serial = SKIP, service_stat = SKIP, site_id = SKIP, status = SKIP, tag_id = SKIP, tag_uuid = SKIP, uptime = SKIP, vc_mac = SKIP, vc_setup_info = SKIP, version = SKIP, additional_properties = nil) ⇒ StatsSwitch
constructor
A new instance of StatsSwitch.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(ap_redundancy = SKIP, arp_table_stats = SKIP, auto_upgrade_stat = SKIP, cert_expiry = SKIP, clients = SKIP, clients_stats = SKIP, config_status = SKIP, config_timestamp = SKIP, config_version = SKIP, cpu_stat = SKIP, created_time = SKIP, deviceprofile_id = SKIP, dhcpd_stat = SKIP, evpntopo_id = SKIP, ext_ip = SKIP, fw_versions_outofsync = SKIP, fwupdate = SKIP, has_pcap = SKIP, hostname = SKIP, hw_rev = SKIP, id = SKIP, if_stat = SKIP, ip = SKIP, ip_stat = SKIP, last_seen = SKIP, last_trouble = SKIP, mac = SKIP, mac_table_stats = SKIP, map_id = SKIP, memory_stat = SKIP, model = SKIP, modified_time = SKIP, module_stat = SKIP, name = SKIP, org_id = SKIP, ports = SKIP, route_summary_stats = SKIP, serial = SKIP, service_stat = SKIP, site_id = SKIP, status = SKIP, tag_id = SKIP, tag_uuid = SKIP, uptime = SKIP, vc_mac = SKIP, vc_setup_info = SKIP, version = SKIP, additional_properties = nil) ⇒ StatsSwitch
Returns a new instance of StatsSwitch.
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 |
# File 'lib/mist_api/models/stats_switch.rb', line 324 def initialize(ap_redundancy = SKIP, arp_table_stats = SKIP, auto_upgrade_stat = SKIP, cert_expiry = SKIP, clients = SKIP, clients_stats = SKIP, config_status = SKIP, = SKIP, config_version = SKIP, cpu_stat = SKIP, created_time = SKIP, deviceprofile_id = SKIP, dhcpd_stat = SKIP, evpntopo_id = SKIP, ext_ip = SKIP, fw_versions_outofsync = SKIP, fwupdate = SKIP, has_pcap = SKIP, hostname = SKIP, hw_rev = SKIP, id = SKIP, if_stat = SKIP, ip = SKIP, ip_stat = SKIP, last_seen = SKIP, last_trouble = SKIP, mac = SKIP, mac_table_stats = SKIP, map_id = SKIP, memory_stat = SKIP, model = SKIP, modified_time = SKIP, module_stat = SKIP, name = SKIP, org_id = SKIP, ports = SKIP, route_summary_stats = SKIP, serial = SKIP, service_stat = SKIP, site_id = SKIP, status = SKIP, tag_id = SKIP, tag_uuid = SKIP, uptime = SKIP, vc_mac = SKIP, vc_setup_info = SKIP, version = SKIP, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @ap_redundancy = ap_redundancy unless ap_redundancy == SKIP @arp_table_stats = arp_table_stats unless arp_table_stats == SKIP @auto_upgrade_stat = auto_upgrade_stat unless auto_upgrade_stat == SKIP @cert_expiry = cert_expiry unless cert_expiry == SKIP @clients = clients unless clients == SKIP @clients_stats = clients_stats unless clients_stats == SKIP @config_status = config_status unless config_status == SKIP @config_timestamp = unless == SKIP @config_version = config_version unless config_version == SKIP @cpu_stat = cpu_stat unless cpu_stat == SKIP @created_time = created_time unless created_time == SKIP @deviceprofile_id = deviceprofile_id unless deviceprofile_id == SKIP @dhcpd_stat = dhcpd_stat unless dhcpd_stat == SKIP @evpntopo_id = evpntopo_id unless evpntopo_id == SKIP @ext_ip = ext_ip unless ext_ip == SKIP @fw_versions_outofsync = fw_versions_outofsync unless fw_versions_outofsync == SKIP @fwupdate = fwupdate unless fwupdate == SKIP @has_pcap = has_pcap unless has_pcap == SKIP @hostname = hostname unless hostname == SKIP @hw_rev = hw_rev unless hw_rev == SKIP @id = id unless id == SKIP @if_stat = if_stat unless if_stat == SKIP @ip = ip unless ip == SKIP @ip_stat = ip_stat unless ip_stat == SKIP @last_seen = last_seen unless last_seen == SKIP @last_trouble = last_trouble unless last_trouble == SKIP @mac = mac unless mac == SKIP @mac_table_stats = mac_table_stats unless mac_table_stats == SKIP @map_id = map_id unless map_id == SKIP @memory_stat = memory_stat unless memory_stat == SKIP @model = model unless model == SKIP @modified_time = modified_time unless modified_time == SKIP @module_stat = module_stat unless module_stat == SKIP @name = name unless name == SKIP @org_id = org_id unless org_id == SKIP @ports = ports unless ports == SKIP @route_summary_stats = route_summary_stats unless route_summary_stats == SKIP @serial = serial unless serial == SKIP @service_stat = service_stat unless service_stat == SKIP @site_id = site_id unless site_id == SKIP @status = status unless status == SKIP @tag_id = tag_id unless tag_id == SKIP @tag_uuid = tag_uuid unless tag_uuid == SKIP @type = 'switch' @uptime = uptime unless uptime == SKIP @vc_mac = vc_mac unless vc_mac == SKIP @vc_setup_info = vc_setup_info unless vc_setup_info == SKIP @version = version unless version == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#ap_redundancy ⇒ StatsSwitchApRedundancy
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/stats_switch.rb', line 14 def ap_redundancy @ap_redundancy end |
#arp_table_stats ⇒ ArpTableStats
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/stats_switch.rb', line 18 def arp_table_stats @arp_table_stats end |
#auto_upgrade_stat ⇒ StatsApAutoUpgrade
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/stats_switch.rb', line 22 def auto_upgrade_stat @auto_upgrade_stat end |
#cert_expiry ⇒ Integer
TODO: Write general description for this method
26 27 28 |
# File 'lib/mist_api/models/stats_switch.rb', line 26 def cert_expiry @cert_expiry end |
#clients ⇒ Array[StatsSwitchClientItem]
TODO: Write general description for this method
30 31 32 |
# File 'lib/mist_api/models/stats_switch.rb', line 30 def clients @clients end |
#clients_stats ⇒ StatsSwitchClientsStats
TODO: Write general description for this method
34 35 36 |
# File 'lib/mist_api/models/stats_switch.rb', line 34 def clients_stats @clients_stats end |
#config_status ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/mist_api/models/stats_switch.rb', line 38 def config_status @config_status end |
#config_timestamp ⇒ Integer
TODO: Write general description for this method
42 43 44 |
# File 'lib/mist_api/models/stats_switch.rb', line 42 def @config_timestamp end |
#config_version ⇒ Integer
TODO: Write general description for this method
46 47 48 |
# File 'lib/mist_api/models/stats_switch.rb', line 46 def config_version @config_version end |
#cpu_stat ⇒ CpuStat
TODO: Write general description for this method
50 51 52 |
# File 'lib/mist_api/models/stats_switch.rb', line 50 def cpu_stat @cpu_stat end |
#created_time ⇒ Float
When the object has been created, in epoch
54 55 56 |
# File 'lib/mist_api/models/stats_switch.rb', line 54 def created_time @created_time end |
#deviceprofile_id ⇒ UUID | String
When the object has been created, in epoch
58 59 60 |
# File 'lib/mist_api/models/stats_switch.rb', line 58 def deviceprofile_id @deviceprofile_id end |
#dhcpd_stat ⇒ Hash[String, DhcpdStatLan]
Property key is the network name
62 63 64 |
# File 'lib/mist_api/models/stats_switch.rb', line 62 def dhcpd_stat @dhcpd_stat end |
#evpntopo_id ⇒ UUID | String
Property key is the network name
66 67 68 |
# File 'lib/mist_api/models/stats_switch.rb', line 66 def evpntopo_id @evpntopo_id end |
#ext_ip ⇒ String
Property key is the network name
70 71 72 |
# File 'lib/mist_api/models/stats_switch.rb', line 70 def ext_ip @ext_ip end |
#fw_versions_outofsync ⇒ TrueClass | FalseClass
Property key is the network name
74 75 76 |
# File 'lib/mist_api/models/stats_switch.rb', line 74 def fw_versions_outofsync @fw_versions_outofsync end |
#fwupdate ⇒ FwupdateStat
Property key is the network name
78 79 80 |
# File 'lib/mist_api/models/stats_switch.rb', line 78 def fwupdate @fwupdate end |
#has_pcap ⇒ TrueClass | FalseClass
Whether the switch supports packet capture
82 83 84 |
# File 'lib/mist_api/models/stats_switch.rb', line 82 def has_pcap @has_pcap end |
#hostname ⇒ String
Hostname reported by the device
86 87 88 |
# File 'lib/mist_api/models/stats_switch.rb', line 86 def hostname @hostname end |
#hw_rev ⇒ String
Device hardware revision number
90 91 92 |
# File 'lib/mist_api/models/stats_switch.rb', line 90 def hw_rev @hw_rev end |
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
94 95 96 |
# File 'lib/mist_api/models/stats_switch.rb', line 94 def id @id end |
#if_stat ⇒ Hash[String, IfStatProperty]
Property key is the interface name
98 99 100 |
# File 'lib/mist_api/models/stats_switch.rb', line 98 def if_stat @if_stat end |
#ip ⇒ String
Property key is the interface name
102 103 104 |
# File 'lib/mist_api/models/stats_switch.rb', line 102 def ip @ip end |
#ip_stat ⇒ IpStat
Property key is the interface name
106 107 108 |
# File 'lib/mist_api/models/stats_switch.rb', line 106 def ip_stat @ip_stat end |
#last_seen ⇒ Float
Last seen timestamp
110 111 112 |
# File 'lib/mist_api/models/stats_switch.rb', line 110 def last_seen @last_seen end |
#last_trouble ⇒ LastTrouble
Last trouble code of switch
114 115 116 |
# File 'lib/mist_api/models/stats_switch.rb', line 114 def last_trouble @last_trouble end |
#mac ⇒ String
Last trouble code of switch
118 119 120 |
# File 'lib/mist_api/models/stats_switch.rb', line 118 def mac @mac end |
#mac_table_stats ⇒ MacTableStats
Last trouble code of switch
122 123 124 |
# File 'lib/mist_api/models/stats_switch.rb', line 122 def mac_table_stats @mac_table_stats end |
#map_id ⇒ UUID | String
Last trouble code of switch
126 127 128 |
# File 'lib/mist_api/models/stats_switch.rb', line 126 def map_id @map_id end |
#memory_stat ⇒ MemoryStat
Memory usage stat (for virtual chassis, memory usage of master RE)
130 131 132 |
# File 'lib/mist_api/models/stats_switch.rb', line 130 def memory_stat @memory_stat end |
#model ⇒ String
Memory usage stat (for virtual chassis, memory usage of master RE)
134 135 136 |
# File 'lib/mist_api/models/stats_switch.rb', line 134 def model @model end |
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch
138 139 140 |
# File 'lib/mist_api/models/stats_switch.rb', line 138 def modified_time @modified_time end |
#module_stat ⇒ Array[StatsSwitchModuleStatItem]
When the object has been modified for the last time, in epoch
142 143 144 |
# File 'lib/mist_api/models/stats_switch.rb', line 142 def module_stat @module_stat end |
#name ⇒ String
Device name if configured
146 147 148 |
# File 'lib/mist_api/models/stats_switch.rb', line 146 def name @name end |
#org_id ⇒ UUID | String
Device name if configured
150 151 152 |
# File 'lib/mist_api/models/stats_switch.rb', line 150 def org_id @org_id end |
#ports ⇒ Array[StatsSwitchPort]
Device name if configured
154 155 156 |
# File 'lib/mist_api/models/stats_switch.rb', line 154 def ports @ports end |
#route_summary_stats ⇒ RouteSummaryStats
Device name if configured
158 159 160 |
# File 'lib/mist_api/models/stats_switch.rb', line 158 def route_summary_stats @route_summary_stats end |
#serial ⇒ String
Device name if configured
162 163 164 |
# File 'lib/mist_api/models/stats_switch.rb', line 162 def serial @serial end |
#service_stat ⇒ Hash[String, ServiceStatProperty]
Device name if configured
166 167 168 |
# File 'lib/mist_api/models/stats_switch.rb', line 166 def service_stat @service_stat end |
#site_id ⇒ UUID | String
Device name if configured
170 171 172 |
# File 'lib/mist_api/models/stats_switch.rb', line 170 def site_id @site_id end |
#status ⇒ String
Device name if configured
174 175 176 |
# File 'lib/mist_api/models/stats_switch.rb', line 174 def status @status end |
#tag_id ⇒ Integer
Device name if configured
178 179 180 |
# File 'lib/mist_api/models/stats_switch.rb', line 178 def tag_id @tag_id end |
#tag_uuid ⇒ UUID | String
Device name if configured
182 183 184 |
# File 'lib/mist_api/models/stats_switch.rb', line 182 def tag_uuid @tag_uuid end |
#type ⇒ String (readonly)
Device Type. enum: ‘switch`
186 187 188 |
# File 'lib/mist_api/models/stats_switch.rb', line 186 def type @type end |
#uptime ⇒ Float
Device Type. enum: ‘switch`
190 191 192 |
# File 'lib/mist_api/models/stats_switch.rb', line 190 def uptime @uptime end |
#vc_mac ⇒ String
Device Type. enum: ‘switch`
194 195 196 |
# File 'lib/mist_api/models/stats_switch.rb', line 194 def vc_mac @vc_mac end |
#vc_setup_info ⇒ StatsSwitchVcSetupInfo
Device Type. enum: ‘switch`
198 199 200 |
# File 'lib/mist_api/models/stats_switch.rb', line 198 def vc_setup_info @vc_setup_info end |
#version ⇒ String
Device Type. enum: ‘switch`
202 203 204 |
# File 'lib/mist_api/models/stats_switch.rb', line 202 def version @version end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 |
# File 'lib/mist_api/models/stats_switch.rb', line 397 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. ap_redundancy = StatsSwitchApRedundancy.from_hash(hash['ap_redundancy']) if hash['ap_redundancy'] arp_table_stats = ArpTableStats.from_hash(hash['arp_table_stats']) if hash['arp_table_stats'] auto_upgrade_stat = StatsApAutoUpgrade.from_hash(hash['auto_upgrade_stat']) if hash['auto_upgrade_stat'] cert_expiry = hash.key?('cert_expiry') ? hash['cert_expiry'] : SKIP # Parameter is an array, so we need to iterate through it clients = nil unless hash['clients'].nil? clients = [] hash['clients'].each do |structure| clients << (StatsSwitchClientItem.from_hash(structure) if structure) end end clients = SKIP unless hash.key?('clients') clients_stats = StatsSwitchClientsStats.from_hash(hash['clients_stats']) if hash['clients_stats'] config_status = hash.key?('config_status') ? hash['config_status'] : SKIP = hash.key?('config_timestamp') ? hash['config_timestamp'] : SKIP config_version = hash.key?('config_version') ? hash['config_version'] : SKIP cpu_stat = CpuStat.from_hash(hash['cpu_stat']) if hash['cpu_stat'] created_time = hash.key?('created_time') ? hash['created_time'] : SKIP deviceprofile_id = hash.key?('deviceprofile_id') ? hash['deviceprofile_id'] : SKIP dhcpd_stat = DhcpdStatLan.from_hash(hash['dhcpd_stat']) if hash['dhcpd_stat'] dhcpd_stat = SKIP unless hash.key?('dhcpd_stat') evpntopo_id = hash.key?('evpntopo_id') ? hash['evpntopo_id'] : SKIP ext_ip = hash.key?('ext_ip') ? hash['ext_ip'] : SKIP fw_versions_outofsync = hash.key?('fw_versions_outofsync') ? hash['fw_versions_outofsync'] : SKIP fwupdate = FwupdateStat.from_hash(hash['fwupdate']) if hash['fwupdate'] has_pcap = hash.key?('has_pcap') ? hash['has_pcap'] : SKIP hostname = hash.key?('hostname') ? hash['hostname'] : SKIP hw_rev = hash.key?('hw_rev') ? hash['hw_rev'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP if_stat = IfStatProperty.from_hash(hash['if_stat']) if hash['if_stat'] if_stat = SKIP unless hash.key?('if_stat') ip = hash.key?('ip') ? hash['ip'] : SKIP ip_stat = IpStat.from_hash(hash['ip_stat']) if hash['ip_stat'] last_seen = hash.key?('last_seen') ? hash['last_seen'] : SKIP last_trouble = LastTrouble.from_hash(hash['last_trouble']) if hash['last_trouble'] mac = hash.key?('mac') ? hash['mac'] : SKIP mac_table_stats = MacTableStats.from_hash(hash['mac_table_stats']) if hash['mac_table_stats'] map_id = hash.key?('map_id') ? hash['map_id'] : SKIP memory_stat = MemoryStat.from_hash(hash['memory_stat']) if hash['memory_stat'] model = hash.key?('model') ? hash['model'] : SKIP modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP # Parameter is an array, so we need to iterate through it module_stat = nil unless hash['module_stat'].nil? module_stat = [] hash['module_stat'].each do |structure| module_stat << (StatsSwitchModuleStatItem.from_hash(structure) if structure) end end module_stat = SKIP unless hash.key?('module_stat') name = hash.key?('name') ? hash['name'] : SKIP org_id = hash.key?('org_id') ? hash['org_id'] : SKIP # Parameter is an array, so we need to iterate through it ports = nil unless hash['ports'].nil? ports = [] hash['ports'].each do |structure| ports << (StatsSwitchPort.from_hash(structure) if structure) end end ports = SKIP unless hash.key?('ports') route_summary_stats = RouteSummaryStats.from_hash(hash['route_summary_stats']) if hash['route_summary_stats'] serial = hash.key?('serial') ? hash['serial'] : SKIP service_stat = ServiceStatProperty.from_hash(hash['service_stat']) if hash['service_stat'] service_stat = SKIP unless hash.key?('service_stat') site_id = hash.key?('site_id') ? hash['site_id'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP tag_id = hash.key?('tag_id') ? hash['tag_id'] : SKIP tag_uuid = hash.key?('tag_uuid') ? hash['tag_uuid'] : SKIP uptime = hash.key?('uptime') ? hash['uptime'] : SKIP vc_mac = hash.key?('vc_mac') ? hash['vc_mac'] : SKIP vc_setup_info = StatsSwitchVcSetupInfo.from_hash(hash['vc_setup_info']) if hash['vc_setup_info'] version = hash.key?('version') ? hash['version'] : SKIP # 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. StatsSwitch.new(ap_redundancy, arp_table_stats, auto_upgrade_stat, cert_expiry, clients, clients_stats, config_status, , config_version, cpu_stat, created_time, deviceprofile_id, dhcpd_stat, evpntopo_id, ext_ip, fw_versions_outofsync, fwupdate, has_pcap, hostname, hw_rev, id, if_stat, ip, ip_stat, last_seen, last_trouble, mac, mac_table_stats, map_id, memory_stat, model, modified_time, module_stat, name, org_id, ports, route_summary_stats, serial, service_stat, site_id, status, tag_id, tag_uuid, uptime, vc_mac, vc_setup_info, version, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
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 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/mist_api/models/stats_switch.rb', line 205 def self.names @_hash = {} if @_hash.nil? @_hash['ap_redundancy'] = 'ap_redundancy' @_hash['arp_table_stats'] = 'arp_table_stats' @_hash['auto_upgrade_stat'] = 'auto_upgrade_stat' @_hash['cert_expiry'] = 'cert_expiry' @_hash['clients'] = 'clients' @_hash['clients_stats'] = 'clients_stats' @_hash['config_status'] = 'config_status' @_hash['config_timestamp'] = 'config_timestamp' @_hash['config_version'] = 'config_version' @_hash['cpu_stat'] = 'cpu_stat' @_hash['created_time'] = 'created_time' @_hash['deviceprofile_id'] = 'deviceprofile_id' @_hash['dhcpd_stat'] = 'dhcpd_stat' @_hash['evpntopo_id'] = 'evpntopo_id' @_hash['ext_ip'] = 'ext_ip' @_hash['fw_versions_outofsync'] = 'fw_versions_outofsync' @_hash['fwupdate'] = 'fwupdate' @_hash['has_pcap'] = 'has_pcap' @_hash['hostname'] = 'hostname' @_hash['hw_rev'] = 'hw_rev' @_hash['id'] = 'id' @_hash['if_stat'] = 'if_stat' @_hash['ip'] = 'ip' @_hash['ip_stat'] = 'ip_stat' @_hash['last_seen'] = 'last_seen' @_hash['last_trouble'] = 'last_trouble' @_hash['mac'] = 'mac' @_hash['mac_table_stats'] = 'mac_table_stats' @_hash['map_id'] = 'map_id' @_hash['memory_stat'] = 'memory_stat' @_hash['model'] = 'model' @_hash['modified_time'] = 'modified_time' @_hash['module_stat'] = 'module_stat' @_hash['name'] = 'name' @_hash['org_id'] = 'org_id' @_hash['ports'] = 'ports' @_hash['route_summary_stats'] = 'route_summary_stats' @_hash['serial'] = 'serial' @_hash['service_stat'] = 'service_stat' @_hash['site_id'] = 'site_id' @_hash['status'] = 'status' @_hash['tag_id'] = 'tag_id' @_hash['tag_uuid'] = 'tag_uuid' @_hash['type'] = 'type' @_hash['uptime'] = 'uptime' @_hash['vc_mac'] = 'vc_mac' @_hash['vc_setup_info'] = 'vc_setup_info' @_hash['version'] = 'version' @_hash end |
.nullables ⇒ Object
An array for nullable fields
312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/mist_api/models/stats_switch.rb', line 312 def self.nullables %w[ deviceprofile_id evpntopo_id last_seen map_id uptime vc_mac version ] end |
.optionals ⇒ Object
An array for optional fields
259 260 261 262 263 264 265 266 267 268 269 270 271 272 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 |
# File 'lib/mist_api/models/stats_switch.rb', line 259 def self.optionals %w[ ap_redundancy arp_table_stats auto_upgrade_stat cert_expiry clients clients_stats config_status config_timestamp config_version cpu_stat created_time deviceprofile_id dhcpd_stat evpntopo_id ext_ip fw_versions_outofsync fwupdate has_pcap hostname hw_rev id if_stat ip ip_stat last_seen last_trouble mac mac_table_stats map_id memory_stat model modified_time module_stat name org_id ports route_summary_stats serial service_stat site_id status tag_id tag_uuid uptime vc_mac vc_setup_info version ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 |
# File 'lib/mist_api/models/stats_switch.rb', line 574 def inspect class_name = self.class.name.split('::').last "<#{class_name} ap_redundancy: #{@ap_redundancy.inspect}, arp_table_stats:"\ " #{@arp_table_stats.inspect}, auto_upgrade_stat: #{@auto_upgrade_stat.inspect},"\ " cert_expiry: #{@cert_expiry.inspect}, clients: #{@clients.inspect}, clients_stats:"\ " #{@clients_stats.inspect}, config_status: #{@config_status.inspect}, config_timestamp:"\ " #{@config_timestamp.inspect}, config_version: #{@config_version.inspect}, cpu_stat:"\ " #{@cpu_stat.inspect}, created_time: #{@created_time.inspect}, deviceprofile_id:"\ " #{@deviceprofile_id.inspect}, dhcpd_stat: #{@dhcpd_stat.inspect}, evpntopo_id:"\ " #{@evpntopo_id.inspect}, ext_ip: #{@ext_ip.inspect}, fw_versions_outofsync:"\ " #{@fw_versions_outofsync.inspect}, fwupdate: #{@fwupdate.inspect}, has_pcap:"\ " #{@has_pcap.inspect}, hostname: #{@hostname.inspect}, hw_rev: #{@hw_rev.inspect}, id:"\ " #{@id.inspect}, if_stat: #{@if_stat.inspect}, ip: #{@ip.inspect}, ip_stat:"\ " #{@ip_stat.inspect}, last_seen: #{@last_seen.inspect}, last_trouble:"\ " #{@last_trouble.inspect}, mac: #{@mac.inspect}, mac_table_stats:"\ " #{@mac_table_stats.inspect}, map_id: #{@map_id.inspect}, memory_stat:"\ " #{@memory_stat.inspect}, model: #{@model.inspect}, modified_time:"\ " #{@modified_time.inspect}, module_stat: #{@module_stat.inspect}, name: #{@name.inspect},"\ " org_id: #{@org_id.inspect}, ports: #{@ports.inspect}, route_summary_stats:"\ " #{@route_summary_stats.inspect}, serial: #{@serial.inspect}, service_stat:"\ " #{@service_stat.inspect}, site_id: #{@site_id.inspect}, status: #{@status.inspect},"\ " tag_id: #{@tag_id.inspect}, tag_uuid: #{@tag_uuid.inspect}, type: #{@type.inspect},"\ " uptime: #{@uptime.inspect}, vc_mac: #{@vc_mac.inspect}, vc_setup_info:"\ " #{@vc_setup_info.inspect}, version: #{@version.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 |
# File 'lib/mist_api/models/stats_switch.rb', line 552 def to_s class_name = self.class.name.split('::').last "<#{class_name} ap_redundancy: #{@ap_redundancy}, arp_table_stats: #{@arp_table_stats},"\ " auto_upgrade_stat: #{@auto_upgrade_stat}, cert_expiry: #{@cert_expiry}, clients:"\ " #{@clients}, clients_stats: #{@clients_stats}, config_status: #{@config_status},"\ " config_timestamp: #{@config_timestamp}, config_version: #{@config_version}, cpu_stat:"\ " #{@cpu_stat}, created_time: #{@created_time}, deviceprofile_id: #{@deviceprofile_id},"\ " dhcpd_stat: #{@dhcpd_stat}, evpntopo_id: #{@evpntopo_id}, ext_ip: #{@ext_ip},"\ " fw_versions_outofsync: #{@fw_versions_outofsync}, fwupdate: #{@fwupdate}, has_pcap:"\ " #{@has_pcap}, hostname: #{@hostname}, hw_rev: #{@hw_rev}, id: #{@id}, if_stat:"\ " #{@if_stat}, ip: #{@ip}, ip_stat: #{@ip_stat}, last_seen: #{@last_seen}, last_trouble:"\ " #{@last_trouble}, mac: #{@mac}, mac_table_stats: #{@mac_table_stats}, map_id: #{@map_id},"\ " memory_stat: #{@memory_stat}, model: #{@model}, modified_time: #{@modified_time},"\ " module_stat: #{@module_stat}, name: #{@name}, org_id: #{@org_id}, ports: #{@ports},"\ " route_summary_stats: #{@route_summary_stats}, serial: #{@serial}, service_stat:"\ " #{@service_stat}, site_id: #{@site_id}, status: #{@status}, tag_id: #{@tag_id}, tag_uuid:"\ " #{@tag_uuid}, type: #{@type}, uptime: #{@uptime}, vc_mac: #{@vc_mac}, vc_setup_info:"\ " #{@vc_setup_info}, version: #{@version}, additional_properties:"\ " #{@additional_properties}>" end |