Class: OCI::Monitoring::Models::AlarmStatusSummary
- Inherits:
-
Object
- Object
- OCI::Monitoring::Models::AlarmStatusSummary
- Defined in:
- lib/oci/monitoring/models/alarm_status_summary.rb
Overview
A summary of properties for the specified alarm and its current evaluation status. For information about alarms, see Alarms Overview.
To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies.
For information about endpoints and signing API requests, see About the API. For information about available SDKs and tools, see SDKS and Other Tools.
Constant Summary collapse
- SEVERITY_ENUM =
[ SEVERITY_CRITICAL = 'CRITICAL'.freeze, SEVERITY_ERROR = 'ERROR'.freeze, SEVERITY_WARNING = 'WARNING'.freeze, SEVERITY_INFO = 'INFO'.freeze, SEVERITY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- STATUS_ENUM =
[ STATUS_FIRING = 'FIRING'.freeze, STATUS_OK = 'OK'.freeze, STATUS_SUSPENDED = 'SUSPENDED'.freeze, STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#alarm_summary ⇒ String
[Required] Customizable alarm summary (
alarmSummary
alarm message parameter). -
#display_name ⇒ String
[Required] The configured name of the alarm.
-
#id ⇒ String
[Required] The OCID of the alarm.
-
#rule_name ⇒ String
[Required] Identifier of the alarm's base values for alarm evaluation, for use when the alarm contains overrides.
-
#severity ⇒ String
[Required] The perceived type of response required when the alarm is in the "FIRING" state.
-
#status ⇒ String
[Required] The status of this alarm.
-
#suppression ⇒ OCI::Monitoring::Models::Suppression
The configuration details for suppressing an alarm.
-
#timestamp_triggered ⇒ DateTime
[Required] Timestamp for the transition of the alarm state.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ AlarmStatusSummary
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ AlarmStatusSummary
Initializes the object
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 172 173 174 175 176 177 178 179 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 142 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.id = attributes[:'id'] if attributes[:'id'] self.display_name = attributes[:'displayName'] if attributes[:'displayName'] raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name') self.display_name = attributes[:'display_name'] if attributes[:'display_name'] self.severity = attributes[:'severity'] if attributes[:'severity'] self.rule_name = attributes[:'ruleName'] if attributes[:'ruleName'] raise 'You cannot provide both :ruleName and :rule_name' if attributes.key?(:'ruleName') && attributes.key?(:'rule_name') self.rule_name = attributes[:'rule_name'] if attributes[:'rule_name'] self. = attributes[:'timestampTriggered'] if attributes[:'timestampTriggered'] raise 'You cannot provide both :timestampTriggered and :timestamp_triggered' if attributes.key?(:'timestampTriggered') && attributes.key?(:'timestamp_triggered') self. = attributes[:'timestamp_triggered'] if attributes[:'timestamp_triggered'] self.alarm_summary = attributes[:'alarmSummary'] if attributes[:'alarmSummary'] raise 'You cannot provide both :alarmSummary and :alarm_summary' if attributes.key?(:'alarmSummary') && attributes.key?(:'alarm_summary') self.alarm_summary = attributes[:'alarm_summary'] if attributes[:'alarm_summary'] self.status = attributes[:'status'] if attributes[:'status'] self.suppression = attributes[:'suppression'] if attributes[:'suppression'] end |
Instance Attribute Details
#alarm_summary ⇒ String
[Required] Customizable alarm summary (alarmSummary
alarm message parameter). Optionally include dynamic variables. The alarm summary appears within the body of the alarm message and in responses to list_alarms_status get_alarm_history and retrieve_dimension_states.
80 81 82 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 80 def alarm_summary @alarm_summary end |
#display_name ⇒ String
[Required] The configured name of the alarm.
Example: High CPU Utilization
49 50 51 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 49 def display_name @display_name end |
#id ⇒ String
[Required] The OCID of the alarm.
42 43 44 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 42 def id @id end |
#rule_name ⇒ String
[Required] Identifier of the alarm's base values for alarm evaluation, for use when the alarm contains overrides. Default value is BASE
. For information about alarm overrides, see alarm_override.
62 63 64 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 62 def rule_name @rule_name end |
#severity ⇒ String
[Required] The perceived type of response required when the alarm is in the "FIRING" state.
Example: CRITICAL
56 57 58 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 56 def severity @severity end |
#status ⇒ String
[Required] The status of this alarm. Status is collective, across all metric streams in the alarm. To list alarm status for each metric stream, use retrieve_dimension_states.
Example: FIRING
89 90 91 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 89 def status @status end |
#suppression ⇒ OCI::Monitoring::Models::Suppression
The configuration details for suppressing an alarm.
94 95 96 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 94 def suppression @suppression end |
#timestamp_triggered ⇒ DateTime
[Required] Timestamp for the transition of the alarm state. For example, the time when the alarm transitioned from OK to Firing. Note: A three-minute lag for this value accounts for any late-arriving metrics.
Example: 2023-02-01T01:02:29.600Z
70 71 72 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 70 def @timestamp_triggered end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 97 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'display_name': :'displayName', 'severity': :'severity', 'rule_name': :'ruleName', 'timestamp_triggered': :'timestampTriggered', 'alarm_summary': :'alarmSummary', 'status': :'status', 'suppression': :'suppression' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 113 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'display_name': :'String', 'severity': :'String', 'rule_name': :'String', 'timestamp_triggered': :'DateTime', 'alarm_summary': :'String', 'status': :'String', 'suppression': :'OCI::Monitoring::Models::Suppression' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 214 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && display_name == other.display_name && severity == other.severity && rule_name == other.rule_name && == other. && alarm_summary == other.alarm_summary && status == other.status && suppression == other.suppression end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 251 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
231 232 233 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 231 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
240 241 242 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 240 def hash [id, display_name, severity, rule_name, , alarm_summary, status, suppression].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
284 285 286 287 288 289 290 291 292 293 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 284 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
278 279 280 |
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 278 def to_s to_hash.to_s end |