Class: MistApi::RrmEvent

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

Overview

RrmEvent 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(ap = nil, band = nil, bandwidth = nil, channel = nil, event = nil, power = nil, pre_bandwidth = nil, pre_channel = nil, pre_power = nil, pre_usage = nil, timestamp = nil, usage = nil) ⇒ RrmEvent

Returns a new instance of RrmEvent.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/mist_api/models/rrm_event.rb', line 93

def initialize(ap = nil, band = nil, bandwidth = nil, channel = nil,
               event = nil, power = nil, pre_bandwidth = nil,
               pre_channel = nil, pre_power = nil, pre_usage = nil,
               timestamp = nil, usage = nil)
  @ap = ap
  @band = band
  @bandwidth = bandwidth
  @channel = channel
  @event = event
  @power = power
  @pre_bandwidth = pre_bandwidth
  @pre_channel = pre_channel
  @pre_power = pre_power
  @pre_usage = pre_usage
  @timestamp = timestamp
  @usage = usage
end

Instance Attribute Details

#apString

AP MAC

Returns:

  • (String)


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

def ap
  @ap
end

#bandDot11BandEnum

enum: ‘24`, `5`, `5-dedicated`, `5-selectable`, `6`, `6-dedicated`, `6-selectable`

Returns:



19
20
21
# File 'lib/mist_api/models/rrm_event.rb', line 19

def band
  @band
end

#bandwidthDot11BandwidthEnum

channel width for the band.enum: ‘0`(disabled, response only), `20`, `40`, `80` (only applicable for band_5 and band_6), `160` (only for band_6)

Returns:



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

def bandwidth
  @bandwidth
end

#channelInteger

Channel for the band from rrm

Returns:

  • (Integer)


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

def channel
  @channel
end

#eventRrmEventTypeEnum

enum: ‘interference-ap-co-channel`, `interference-ap-non-wifi`, `neighbor-ap-down`, `neighbor-ap-recovered`, `radar-detected`, `rrm-radar`, `scheduled-site_rrm`, `triggered-site_rrm`

Returns:



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

def event
  @event
end

#powerInteger

Tx power of the radio

Returns:

  • (Integer)


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

def power
  @power
end

#pre_bandwidthRrmEventPreBandwidthEnum

(previously) channel width for the band , 0 means no previously available. enum: ‘0`, `20`, `40`, `80`, `160`



43
44
45
# File 'lib/mist_api/models/rrm_event.rb', line 43

def pre_bandwidth
  @pre_bandwidth
end

#pre_channelInteger

(previously) channel for the band, 0 means no previously available

Returns:

  • (Integer)


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

def pre_channel
  @pre_channel
end

#pre_powerFloat

(previously) tx power of the radio, 0 means no previously available

Returns:

  • (Float)


51
52
53
# File 'lib/mist_api/models/rrm_event.rb', line 51

def pre_power
  @pre_power
end

#pre_usageString

(previously) tx power of the radio, 0 means no previously available

Returns:

  • (String)


55
56
57
# File 'lib/mist_api/models/rrm_event.rb', line 55

def pre_usage
  @pre_usage
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


59
60
61
# File 'lib/mist_api/models/rrm_event.rb', line 59

def timestamp
  @timestamp
end

#usageString

Epoch (seconds)

Returns:

  • (String)


63
64
65
# File 'lib/mist_api/models/rrm_event.rb', line 63

def usage
  @usage
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/mist_api/models/rrm_event.rb', line 112

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ap = hash.key?('ap') ? hash['ap'] : nil
  band = hash.key?('band') ? hash['band'] : nil
  bandwidth = hash.key?('bandwidth') ? hash['bandwidth'] : nil
  channel = hash.key?('channel') ? hash['channel'] : nil
  event = hash.key?('event') ? hash['event'] : nil
  power = hash.key?('power') ? hash['power'] : nil
  pre_bandwidth = hash.key?('pre_bandwidth') ? hash['pre_bandwidth'] : nil
  pre_channel = hash.key?('pre_channel') ? hash['pre_channel'] : nil
  pre_power = hash.key?('pre_power') ? hash['pre_power'] : nil
  pre_usage = hash.key?('pre_usage') ? hash['pre_usage'] : nil
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : nil
  usage = hash.key?('usage') ? hash['usage'] : nil

  # Create object from extracted values.
  RrmEvent.new(ap,
               band,
               bandwidth,
               channel,
               event,
               power,
               pre_bandwidth,
               pre_channel,
               pre_power,
               pre_usage,
               timestamp,
               usage)
end

.namesObject

A mapping from model property names to API property names.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/mist_api/models/rrm_event.rb', line 66

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ap'] = 'ap'
  @_hash['band'] = 'band'
  @_hash['bandwidth'] = 'bandwidth'
  @_hash['channel'] = 'channel'
  @_hash['event'] = 'event'
  @_hash['power'] = 'power'
  @_hash['pre_bandwidth'] = 'pre_bandwidth'
  @_hash['pre_channel'] = 'pre_channel'
  @_hash['pre_power'] = 'pre_power'
  @_hash['pre_usage'] = 'pre_usage'
  @_hash['timestamp'] = 'timestamp'
  @_hash['usage'] = 'usage'
  @_hash
end

.nullablesObject

An array for nullable fields



89
90
91
# File 'lib/mist_api/models/rrm_event.rb', line 89

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



154
155
156
157
158
159
160
161
# File 'lib/mist_api/models/rrm_event.rb', line 154

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap.inspect}, band: #{@band.inspect}, bandwidth:"\
  " #{@bandwidth.inspect}, channel: #{@channel.inspect}, event: #{@event.inspect}, power:"\
  " #{@power.inspect}, pre_bandwidth: #{@pre_bandwidth.inspect}, pre_channel:"\
  " #{@pre_channel.inspect}, pre_power: #{@pre_power.inspect}, pre_usage:"\
  " #{@pre_usage.inspect}, timestamp: #{@timestamp.inspect}, usage: #{@usage.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



145
146
147
148
149
150
151
# File 'lib/mist_api/models/rrm_event.rb', line 145

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap}, band: #{@band}, bandwidth: #{@bandwidth}, channel: #{@channel},"\
  " event: #{@event}, power: #{@power}, pre_bandwidth: #{@pre_bandwidth}, pre_channel:"\
  " #{@pre_channel}, pre_power: #{@pre_power}, pre_usage: #{@pre_usage}, timestamp:"\
  " #{@timestamp}, usage: #{@usage}>"
end