Class: OCI::Monitoring::Models::AlarmSummary
- Inherits:
-
Object
- Object
- OCI::Monitoring::Models::AlarmSummary
- Defined in:
- lib/oci/monitoring/models/alarm_summary.rb
Overview
A summary of properties for the specified alarm. 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
Instance Attribute Summary collapse
-
#compartment_id ⇒ String
[Required] The OCID of the compartment containing the alarm.
-
#defined_tags ⇒ Hash<String, Hash<String, Object>>
Usage of predefined tag keys.
-
#destinations ⇒ Array<String>
[Required] A list of destinations for alarm notifications.
-
#display_name ⇒ String
[Required] A user-friendly name for the alarm.
-
#freeform_tags ⇒ Hash<String, String>
Simple key-value pair that is applied without any predefined name, type or scope.
-
#id ⇒ String
[Required] The OCID of the alarm.
-
#is_enabled ⇒ BOOLEAN
[Required] Whether the alarm is enabled.
-
#is_notifications_per_metric_dimension_enabled ⇒ BOOLEAN
Whether the alarm sends a separate message for each metric stream.
-
#lifecycle_state ⇒ String
[Required] The current lifecycle state of the alarm.
-
#metric_compartment_id ⇒ String
[Required] The OCID of the compartment containing the metric being evaluated by the alarm.
-
#namespace ⇒ String
[Required] The source service or application emitting the metric that is evaluated by the alarm.
-
#notification_version ⇒ String
The version of the alarm notification to be delivered.
-
#overrides ⇒ Array<OCI::Monitoring::Models::AlarmOverride>
A set of overrides that control evaluations of the alarm.
-
#query ⇒ String
[Required] The Monitoring Query Language (MQL) expression to evaluate for the alarm.
-
#rule_name ⇒ String
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.
-
#suppression ⇒ OCI::Monitoring::Models::Suppression
The configuration details for suppressing an alarm.
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 = {}) ⇒ AlarmSummary
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 = {}) ⇒ AlarmSummary
Initializes the object
245 246 247 248 249 250 251 252 253 254 255 256 257 258 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 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 245 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.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId'] raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id') self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id'] self.metric_compartment_id = attributes[:'metricCompartmentId'] if attributes[:'metricCompartmentId'] raise 'You cannot provide both :metricCompartmentId and :metric_compartment_id' if attributes.key?(:'metricCompartmentId') && attributes.key?(:'metric_compartment_id') self.metric_compartment_id = attributes[:'metric_compartment_id'] if attributes[:'metric_compartment_id'] self.namespace = attributes[:'namespace'] if attributes[:'namespace'] self.query = attributes[:'query'] if attributes[:'query'] self.severity = attributes[:'severity'] if attributes[:'severity'] self.destinations = attributes[:'destinations'] if attributes[:'destinations'] self.suppression = attributes[:'suppression'] if attributes[:'suppression'] self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil? raise 'You cannot provide both :isEnabled and :is_enabled' if attributes.key?(:'isEnabled') && attributes.key?(:'is_enabled') self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil? self.is_notifications_per_metric_dimension_enabled = attributes[:'isNotificationsPerMetricDimensionEnabled'] unless attributes[:'isNotificationsPerMetricDimensionEnabled'].nil? raise 'You cannot provide both :isNotificationsPerMetricDimensionEnabled and :is_notifications_per_metric_dimension_enabled' if attributes.key?(:'isNotificationsPerMetricDimensionEnabled') && attributes.key?(:'is_notifications_per_metric_dimension_enabled') self.is_notifications_per_metric_dimension_enabled = attributes[:'is_notifications_per_metric_dimension_enabled'] unless attributes[:'is_notifications_per_metric_dimension_enabled'].nil? self. = attributes[:'freeformTags'] if attributes[:'freeformTags'] raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags') self. = attributes[:'freeform_tags'] if attributes[:'freeform_tags'] self. = attributes[:'definedTags'] if attributes[:'definedTags'] raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags') self. = attributes[:'defined_tags'] if attributes[:'defined_tags'] self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState'] raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state') self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state'] self.overrides = attributes[:'overrides'] if attributes[:'overrides'] 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.notification_version = attributes[:'notificationVersion'] if attributes[:'notificationVersion'] raise 'You cannot provide both :notificationVersion and :notification_version' if attributes.key?(:'notificationVersion') && attributes.key?(:'notification_version') self.notification_version = attributes[:'notification_version'] if attributes[:'notification_version'] end |
Instance Attribute Details
#compartment_id ⇒ String
[Required] The OCID of the compartment containing the alarm.
49 50 51 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 49 def compartment_id @compartment_id end |
#defined_tags ⇒ Hash<String, Hash<String, Object>>
Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: {\"Operations\": {\"CostCenter\": \"42\"}}
141 142 143 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 141 def @defined_tags end |
#destinations ⇒ Array<String>
[Required] A list of destinations for alarm notifications. Each destination is represented by the OCID of a related resource, such as a NotificationTopic. Supported destination services: Notifications, Streaming. Limit: One destination per supported destination service.
110 111 112 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 110 def destinations @destinations end |
#display_name ⇒ String
[Required] A user-friendly name for the alarm. It does not have to be unique, and it's changeable.
This value determines the title of each alarm notification.
Example: High CPU Utilization
44 45 46 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 44 def display_name @display_name end |
#freeform_tags ⇒ Hash<String, String>
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {\"Department\": \"Finance\"}
135 136 137 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 135 def @freeform_tags end |
#id ⇒ String
[Required] The OCID of the alarm.
35 36 37 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 35 def id @id end |
#is_enabled ⇒ BOOLEAN
[Required] Whether the alarm is enabled.
Example: true
122 123 124 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 122 def is_enabled @is_enabled end |
#is_notifications_per_metric_dimension_enabled ⇒ BOOLEAN
Whether the alarm sends a separate message for each metric stream. See Creating an Alarm That Splits Messages by Metric Stream. Example: true
129 130 131 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 129 def is_notifications_per_metric_dimension_enabled @is_notifications_per_metric_dimension_enabled end |
#lifecycle_state ⇒ String
[Required] The current lifecycle state of the alarm.
Example: DELETED
148 149 150 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 148 def lifecycle_state @lifecycle_state end |
#metric_compartment_id ⇒ String
[Required] The OCID of the compartment containing the metric being evaluated by the alarm.
55 56 57 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 55 def metric_compartment_id @metric_compartment_id end |
#namespace ⇒ String
[Required] The source service or application emitting the metric that is evaluated by the alarm.
Example: oci_computeagent
62 63 64 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 62 def namespace @namespace end |
#notification_version ⇒ String
The version of the alarm notification to be delivered. Allowed value: 1.X
The value must start with a number (up to four digits), followed by a period and an uppercase X.
170 171 172 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 170 def notification_version @notification_version end |
#overrides ⇒ Array<OCI::Monitoring::Models::AlarmOverride>
A set of overrides that control evaluations of the alarm.
Each override can specify values for query, severity, body, and pending duration. When an alarm contains overrides, the Monitoring service evaluates each override in order, beginning with the first override in the array (index position 0
), and then evaluates the alarm's base values (ruleName
value of BASE
).
157 158 159 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 157 def overrides @overrides end |
#query ⇒ String
[Required] The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms feature of the Monitoring service interprets results for each returned time series as Boolean values, where zero represents false and a non-zero value represents true. A true value means that the trigger rule condition has been met. The query must specify a metric, statistic, interval, and trigger rule (threshold or absence). Supported values for interval depend on the specified time range. More interval values are supported for smaller time ranges. Supported grouping functions: grouping()
, groupBy()
. For information about writing MQL expressions, see Editing the MQL Expression for a Query. For details about MQL, see Monitoring Query Language (MQL) Reference. For available dimensions, review the metric definition for the supported service. See Supported Services.
Example of threshold alarm:
CpuUtilization[1m]{availabilityDomain=\"cumS:PHX-AD-1\"}.groupBy(availabilityDomain).percentile(0.9) > 85
Example of absence alarm:
CpuUtilization[1m]{availabilityDomain=\"cumS:PHX-AD-1\"}.absent()
94 95 96 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 94 def query @query end |
#rule_name ⇒ String
Identifier of the alarm's base values for alarm evaluation, for use when the alarm contains overrides. A valid ruleName value starts with an alphabetic character and includes only alphanumeric characters, underscores and square brackets. Minimum number of characters: 3. Default value is BASE
. For information about alarm overrides, see alarm_override.
164 165 166 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 164 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
101 102 103 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 101 def severity @severity end |
#suppression ⇒ OCI::Monitoring::Models::Suppression
The configuration details for suppressing an alarm.
115 116 117 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 115 def suppression @suppression end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 173 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'display_name': :'displayName', 'compartment_id': :'compartmentId', 'metric_compartment_id': :'metricCompartmentId', 'namespace': :'namespace', 'query': :'query', 'severity': :'severity', 'destinations': :'destinations', 'suppression': :'suppression', 'is_enabled': :'isEnabled', 'is_notifications_per_metric_dimension_enabled': :'isNotificationsPerMetricDimensionEnabled', 'freeform_tags': :'freeformTags', 'defined_tags': :'definedTags', 'lifecycle_state': :'lifecycleState', 'overrides': :'overrides', 'rule_name': :'ruleName', 'notification_version': :'notificationVersion' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 198 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'display_name': :'String', 'compartment_id': :'String', 'metric_compartment_id': :'String', 'namespace': :'String', 'query': :'String', 'severity': :'String', 'destinations': :'Array<String>', 'suppression': :'OCI::Monitoring::Models::Suppression', 'is_enabled': :'BOOLEAN', 'is_notifications_per_metric_dimension_enabled': :'BOOLEAN', 'freeform_tags': :'Hash<String, String>', 'defined_tags': :'Hash<String, Hash<String, Object>>', 'lifecycle_state': :'String', 'overrides': :'Array<OCI::Monitoring::Models::AlarmOverride>', 'rule_name': :'String', 'notification_version': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 346 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && display_name == other.display_name && compartment_id == other.compartment_id && metric_compartment_id == other.metric_compartment_id && namespace == other.namespace && query == other.query && severity == other.severity && destinations == other.destinations && suppression == other.suppression && is_enabled == other.is_enabled && is_notifications_per_metric_dimension_enabled == other.is_notifications_per_metric_dimension_enabled && == other. && == other. && lifecycle_state == other.lifecycle_state && overrides == other.overrides && rule_name == other.rule_name && notification_version == other.notification_version end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 392 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
372 373 374 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 372 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
381 382 383 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 381 def hash [id, display_name, compartment_id, metric_compartment_id, namespace, query, severity, destinations, suppression, is_enabled, is_notifications_per_metric_dimension_enabled, , , lifecycle_state, overrides, rule_name, notification_version].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
425 426 427 428 429 430 431 432 433 434 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 425 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
419 420 421 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 419 def to_s to_hash.to_s end |