Class: MistApi::SimpleAlert
- Defined in:
- lib/mist_api/models/simple_alert.rb
Overview
Set of heuristic rules will be enabled when marvis subscription is not available. It triggers when, in a Z minute window, there are more than Y distinct client encountering over X failures
Instance Attribute Summary collapse
-
#arp_failure ⇒ SimpleAlertArpFailure
TODO: Write general description for this method.
-
#dhcp_failure ⇒ SimpleAlertDhcpFailure
TODO: Write general description for this method.
-
#dns_failure ⇒ SimpleAlertDnsFailure
TODO: Write general description for this method.
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(arp_failure = SKIP, dhcp_failure = SKIP, dns_failure = SKIP) ⇒ SimpleAlert
constructor
A new instance of SimpleAlert.
-
#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(arp_failure = SKIP, dhcp_failure = SKIP, dns_failure = SKIP) ⇒ SimpleAlert
Returns a new instance of SimpleAlert.
49 50 51 52 53 |
# File 'lib/mist_api/models/simple_alert.rb', line 49 def initialize(arp_failure = SKIP, dhcp_failure = SKIP, dns_failure = SKIP) @arp_failure = arp_failure unless arp_failure == SKIP @dhcp_failure = dhcp_failure unless dhcp_failure == SKIP @dns_failure = dns_failure unless dns_failure == SKIP end |
Instance Attribute Details
#arp_failure ⇒ SimpleAlertArpFailure
TODO: Write general description for this method
16 17 18 |
# File 'lib/mist_api/models/simple_alert.rb', line 16 def arp_failure @arp_failure end |
#dhcp_failure ⇒ SimpleAlertDhcpFailure
TODO: Write general description for this method
20 21 22 |
# File 'lib/mist_api/models/simple_alert.rb', line 20 def dhcp_failure @dhcp_failure end |
#dns_failure ⇒ SimpleAlertDnsFailure
TODO: Write general description for this method
24 25 26 |
# File 'lib/mist_api/models/simple_alert.rb', line 24 def dns_failure @dns_failure end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/mist_api/models/simple_alert.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. arp_failure = SimpleAlertArpFailure.from_hash(hash['arp_failure']) if hash['arp_failure'] dhcp_failure = SimpleAlertDhcpFailure.from_hash(hash['dhcp_failure']) if hash['dhcp_failure'] dns_failure = SimpleAlertDnsFailure.from_hash(hash['dns_failure']) if hash['dns_failure'] # Create object from extracted values. SimpleAlert.new(arp_failure, dhcp_failure, dns_failure) end |
.names ⇒ Object
A mapping from model property names to API property names.
27 28 29 30 31 32 33 |
# File 'lib/mist_api/models/simple_alert.rb', line 27 def self.names @_hash = {} if @_hash.nil? @_hash['arp_failure'] = 'arp_failure' @_hash['dhcp_failure'] = 'dhcp_failure' @_hash['dns_failure'] = 'dns_failure' @_hash end |
.nullables ⇒ Object
An array for nullable fields
45 46 47 |
# File 'lib/mist_api/models/simple_alert.rb', line 45 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
36 37 38 39 40 41 42 |
# File 'lib/mist_api/models/simple_alert.rb', line 36 def self.optionals %w[ arp_failure dhcp_failure dns_failure ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
79 80 81 82 83 |
# File 'lib/mist_api/models/simple_alert.rb', line 79 def inspect class_name = self.class.name.split('::').last "<#{class_name} arp_failure: #{@arp_failure.inspect}, dhcp_failure:"\ " #{@dhcp_failure.inspect}, dns_failure: #{@dns_failure.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
72 73 74 75 76 |
# File 'lib/mist_api/models/simple_alert.rb', line 72 def to_s class_name = self.class.name.split('::').last "<#{class_name} arp_failure: #{@arp_failure}, dhcp_failure: #{@dhcp_failure}, dns_failure:"\ " #{@dns_failure}>" end |