Class: MistApi::Alarm
- Defined in:
- lib/mist_api/models/alarm.rb
Overview
Additional information per alarm type
Instance Attribute Summary collapse
-
#ack_admin_id ⇒ UUID | String
UUID of the admin who acked the alarm.
-
#ack_admin_name ⇒ String
Name & Email ID of the admin who acked the alarm.
-
#acked ⇒ TrueClass | FalseClass
Whether the alarm is acked or not.
-
#acked_time ⇒ Integer
Epoch (seconds) when the alarm was acked.
-
#aps ⇒ Array[String]
additional information: List of MACs of the APs.
-
#bssids ⇒ Array[String]
List of BSSIDs.
-
#count ⇒ Integer
Number of incident within an alarm window.
-
#gateways ⇒ Array[String]
additional information: List of MACs of the gateways.
-
#group ⇒ String
Group of the alarm.
-
#hostnames ⇒ Array[String]
additional information: List of Hostnames of the devices (AP/Switch/Gateway).
-
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#last_seen ⇒ Float
Epoch (seconds) of the last incident/alarm within an alarm window.
-
#note ⇒ String
Text describing the alarm.
-
#org_id ⇒ UUID | String
Text describing the alarm.
-
#resolved_time ⇒ Integer
Epoch (seconds) of the resolved_time for the alarm.
-
#severity ⇒ String
Severity of the alarm.
-
#site_id ⇒ UUID | String
Severity of the alarm.
-
#ssids ⇒ Array[String]
List of SSIDs.
-
#status ⇒ AlarmStatusEnum
enum: ‘open`, `resolved`.
-
#switches ⇒ Array[String]
additional information: List of MACs of the switches.
-
#timestamp ⇒ Float
Epoch (seconds).
-
#type ⇒ String
Key-name of the alarm 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(count = nil, group = nil, id = nil, last_seen = nil, severity = nil, timestamp = nil, type = nil, ack_admin_id = SKIP, ack_admin_name = SKIP, acked = SKIP, acked_time = SKIP, aps = SKIP, bssids = SKIP, gateways = SKIP, hostnames = SKIP, note = SKIP, org_id = SKIP, resolved_time = SKIP, site_id = SKIP, ssids = SKIP, status = SKIP, switches = SKIP) ⇒ Alarm
constructor
A new instance of Alarm.
-
#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(count = nil, group = nil, id = nil, last_seen = nil, severity = nil, timestamp = nil, type = nil, ack_admin_id = SKIP, ack_admin_name = SKIP, acked = SKIP, acked_time = SKIP, aps = SKIP, bssids = SKIP, gateways = SKIP, hostnames = SKIP, note = SKIP, org_id = SKIP, resolved_time = SKIP, site_id = SKIP, ssids = SKIP, status = SKIP, switches = SKIP) ⇒ Alarm
Returns a new instance of Alarm.
155 156 157 158 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 |
# File 'lib/mist_api/models/alarm.rb', line 155 def initialize(count = nil, group = nil, id = nil, last_seen = nil, severity = nil, = nil, type = nil, ack_admin_id = SKIP, ack_admin_name = SKIP, acked = SKIP, acked_time = SKIP, aps = SKIP, bssids = SKIP, gateways = SKIP, hostnames = SKIP, note = SKIP, org_id = SKIP, resolved_time = SKIP, site_id = SKIP, ssids = SKIP, status = SKIP, switches = SKIP) @ack_admin_id = ack_admin_id unless ack_admin_id == SKIP @ack_admin_name = ack_admin_name unless ack_admin_name == SKIP @acked = acked unless acked == SKIP @acked_time = acked_time unless acked_time == SKIP @aps = aps unless aps == SKIP @bssids = bssids unless bssids == SKIP @count = count @gateways = gateways unless gateways == SKIP @group = group @hostnames = hostnames unless hostnames == SKIP @id = id @last_seen = last_seen @note = note unless note == SKIP @org_id = org_id unless org_id == SKIP @resolved_time = resolved_time unless resolved_time == SKIP @severity = severity @site_id = site_id unless site_id == SKIP @ssids = ssids unless ssids == SKIP @status = status unless status == SKIP @switches = switches unless switches == SKIP @timestamp = @type = type end |
Instance Attribute Details
#ack_admin_id ⇒ UUID | String
UUID of the admin who acked the alarm
14 15 16 |
# File 'lib/mist_api/models/alarm.rb', line 14 def ack_admin_id @ack_admin_id end |
#ack_admin_name ⇒ String
Name & Email ID of the admin who acked the alarm
18 19 20 |
# File 'lib/mist_api/models/alarm.rb', line 18 def ack_admin_name @ack_admin_name end |
#acked ⇒ TrueClass | FalseClass
Whether the alarm is acked or not
22 23 24 |
# File 'lib/mist_api/models/alarm.rb', line 22 def acked @acked end |
#acked_time ⇒ Integer
Epoch (seconds) when the alarm was acked
26 27 28 |
# File 'lib/mist_api/models/alarm.rb', line 26 def acked_time @acked_time end |
#aps ⇒ Array[String]
additional information: List of MACs of the APs
30 31 32 |
# File 'lib/mist_api/models/alarm.rb', line 30 def aps @aps end |
#bssids ⇒ Array[String]
List of BSSIDs
34 35 36 |
# File 'lib/mist_api/models/alarm.rb', line 34 def bssids @bssids end |
#count ⇒ Integer
Number of incident within an alarm window
38 39 40 |
# File 'lib/mist_api/models/alarm.rb', line 38 def count @count end |
#gateways ⇒ Array[String]
additional information: List of MACs of the gateways
42 43 44 |
# File 'lib/mist_api/models/alarm.rb', line 42 def gateways @gateways end |
#group ⇒ String
Group of the alarm
46 47 48 |
# File 'lib/mist_api/models/alarm.rb', line 46 def group @group end |
#hostnames ⇒ Array[String]
additional information: List of Hostnames of the devices (AP/Switch/Gateway)
51 52 53 |
# File 'lib/mist_api/models/alarm.rb', line 51 def hostnames @hostnames end |
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
55 56 57 |
# File 'lib/mist_api/models/alarm.rb', line 55 def id @id end |
#last_seen ⇒ Float
Epoch (seconds) of the last incident/alarm within an alarm window
59 60 61 |
# File 'lib/mist_api/models/alarm.rb', line 59 def last_seen @last_seen end |
#note ⇒ String
Text describing the alarm
63 64 65 |
# File 'lib/mist_api/models/alarm.rb', line 63 def note @note end |
#org_id ⇒ UUID | String
Text describing the alarm
67 68 69 |
# File 'lib/mist_api/models/alarm.rb', line 67 def org_id @org_id end |
#resolved_time ⇒ Integer
Epoch (seconds) of the resolved_time for the alarm
71 72 73 |
# File 'lib/mist_api/models/alarm.rb', line 71 def resolved_time @resolved_time end |
#severity ⇒ String
Severity of the alarm
75 76 77 |
# File 'lib/mist_api/models/alarm.rb', line 75 def severity @severity end |
#site_id ⇒ UUID | String
Severity of the alarm
79 80 81 |
# File 'lib/mist_api/models/alarm.rb', line 79 def site_id @site_id end |
#ssids ⇒ Array[String]
List of SSIDs
83 84 85 |
# File 'lib/mist_api/models/alarm.rb', line 83 def ssids @ssids end |
#status ⇒ AlarmStatusEnum
enum: ‘open`, `resolved`
87 88 89 |
# File 'lib/mist_api/models/alarm.rb', line 87 def status @status end |
#switches ⇒ Array[String]
additional information: List of MACs of the switches
91 92 93 |
# File 'lib/mist_api/models/alarm.rb', line 91 def switches @switches end |
#timestamp ⇒ Float
Epoch (seconds)
95 96 97 |
# File 'lib/mist_api/models/alarm.rb', line 95 def @timestamp end |
#type ⇒ String
Key-name of the alarm type
99 100 101 |
# File 'lib/mist_api/models/alarm.rb', line 99 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
187 188 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/alarm.rb', line 187 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. count = hash.key?('count') ? hash['count'] : nil group = hash.key?('group') ? hash['group'] : nil id = hash.key?('id') ? hash['id'] : nil last_seen = hash.key?('last_seen') ? hash['last_seen'] : nil severity = hash.key?('severity') ? hash['severity'] : nil = hash.key?('timestamp') ? hash['timestamp'] : nil type = hash.key?('type') ? hash['type'] : nil ack_admin_id = hash.key?('ack_admin_id') ? hash['ack_admin_id'] : SKIP ack_admin_name = hash.key?('ack_admin_name') ? hash['ack_admin_name'] : SKIP acked = hash.key?('acked') ? hash['acked'] : SKIP acked_time = hash.key?('acked_time') ? hash['acked_time'] : SKIP aps = hash.key?('aps') ? hash['aps'] : SKIP bssids = hash.key?('bssids') ? hash['bssids'] : SKIP gateways = hash.key?('gateways') ? hash['gateways'] : SKIP hostnames = hash.key?('hostnames') ? hash['hostnames'] : SKIP note = hash.key?('note') ? hash['note'] : SKIP org_id = hash.key?('org_id') ? hash['org_id'] : SKIP resolved_time = hash.key?('resolved_time') ? hash['resolved_time'] : SKIP site_id = hash.key?('site_id') ? hash['site_id'] : SKIP ssids = hash.key?('ssids') ? hash['ssids'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP switches = hash.key?('switches') ? hash['switches'] : SKIP # Create object from extracted values. Alarm.new(count, group, id, last_seen, severity, , type, ack_admin_id, ack_admin_name, acked, acked_time, aps, bssids, gateways, hostnames, note, org_id, resolved_time, site_id, ssids, status, switches) end |
.names ⇒ Object
A mapping from model property names to API property names.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/mist_api/models/alarm.rb', line 102 def self.names @_hash = {} if @_hash.nil? @_hash['ack_admin_id'] = 'ack_admin_id' @_hash['ack_admin_name'] = 'ack_admin_name' @_hash['acked'] = 'acked' @_hash['acked_time'] = 'acked_time' @_hash['aps'] = 'aps' @_hash['bssids'] = 'bssids' @_hash['count'] = 'count' @_hash['gateways'] = 'gateways' @_hash['group'] = 'group' @_hash['hostnames'] = 'hostnames' @_hash['id'] = 'id' @_hash['last_seen'] = 'last_seen' @_hash['note'] = 'note' @_hash['org_id'] = 'org_id' @_hash['resolved_time'] = 'resolved_time' @_hash['severity'] = 'severity' @_hash['site_id'] = 'site_id' @_hash['ssids'] = 'ssids' @_hash['status'] = 'status' @_hash['switches'] = 'switches' @_hash['timestamp'] = 'timestamp' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
151 152 153 |
# File 'lib/mist_api/models/alarm.rb', line 151 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/mist_api/models/alarm.rb', line 130 def self.optionals %w[ ack_admin_id ack_admin_name acked acked_time aps bssids gateways hostnames note org_id resolved_time site_id ssids status switches ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/mist_api/models/alarm.rb', line 252 def inspect class_name = self.class.name.split('::').last "<#{class_name} ack_admin_id: #{@ack_admin_id.inspect}, ack_admin_name:"\ " #{@ack_admin_name.inspect}, acked: #{@acked.inspect}, acked_time: #{@acked_time.inspect},"\ " aps: #{@aps.inspect}, bssids: #{@bssids.inspect}, count: #{@count.inspect}, gateways:"\ " #{@gateways.inspect}, group: #{@group.inspect}, hostnames: #{@hostnames.inspect}, id:"\ " #{@id.inspect}, last_seen: #{@last_seen.inspect}, note: #{@note.inspect}, org_id:"\ " #{@org_id.inspect}, resolved_time: #{@resolved_time.inspect}, severity:"\ " #{@severity.inspect}, site_id: #{@site_id.inspect}, ssids: #{@ssids.inspect}, status:"\ " #{@status.inspect}, switches: #{@switches.inspect}, timestamp: #{@timestamp.inspect},"\ " type: #{@type.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
241 242 243 244 245 246 247 248 249 |
# File 'lib/mist_api/models/alarm.rb', line 241 def to_s class_name = self.class.name.split('::').last "<#{class_name} ack_admin_id: #{@ack_admin_id}, ack_admin_name: #{@ack_admin_name}, acked:"\ " #{@acked}, acked_time: #{@acked_time}, aps: #{@aps}, bssids: #{@bssids}, count: #{@count},"\ " gateways: #{@gateways}, group: #{@group}, hostnames: #{@hostnames}, id: #{@id}, last_seen:"\ " #{@last_seen}, note: #{@note}, org_id: #{@org_id}, resolved_time: #{@resolved_time},"\ " severity: #{@severity}, site_id: #{@site_id}, ssids: #{@ssids}, status: #{@status},"\ " switches: #{@switches}, timestamp: #{@timestamp}, type: #{@type}>" end |