Class: OCI::Monitoring::Models::Alarm
- Inherits:
-
Object
- Object
- OCI::Monitoring::Models::Alarm
- Defined in:
- lib/oci/monitoring/models/alarm.rb
Overview
The properties that define an 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
- MESSAGE_FORMAT_ENUM =
[ MESSAGE_FORMAT_RAW = 'RAW'.freeze, MESSAGE_FORMAT_PRETTY_JSON = 'PRETTY_JSON'.freeze, MESSAGE_FORMAT_ONS_OPTIMIZED = 'ONS_OPTIMIZED'.freeze, MESSAGE_FORMAT_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- LIFECYCLE_STATE_ENUM =
[ LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze, LIFECYCLE_STATE_DELETING = 'DELETING'.freeze, LIFECYCLE_STATE_DELETED = 'DELETED'.freeze, LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#alarm_summary ⇒ String
Customizable alarm summary (
alarmSummary
alarm message parameter). -
#body ⇒ String
The human-readable content of the delivered alarm notification.
-
#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.
-
#evaluation_slack_duration ⇒ String
Customizable slack period to wait for metric ingestion before evaluating 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
When set to
true
, splits alarm notifications per metric stream. -
#lifecycle_state ⇒ String
[Required] The current lifecycle state of the alarm.
-
#message_format ⇒ String
The format to use for alarm notifications.
-
#metric_compartment_id ⇒ String
[Required] The OCID of the compartment containing the metric being evaluated by the alarm.
-
#metric_compartment_id_in_subtree ⇒ BOOLEAN
When true, the alarm evaluates metrics from all compartments and subcompartments.
-
#namespace ⇒ String
[Required] The source service or application emitting the metric that is evaluated by the alarm.
-
#notification_title ⇒ String
Customizable notification title (
title
alarm message parameter). -
#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.
-
#pending_duration ⇒ String
The period of time that the condition defined in the alarm must persist before the alarm state changes from "OK" to "FIRING".
-
#query ⇒ String
[Required] The Monitoring Query Language (MQL) expression to evaluate for the alarm.
-
#repeat_notification_duration ⇒ String
The frequency for re-submitting alarm notifications, if the alarm keeps firing without interruption.
-
#resolution ⇒ String
The time between calculated aggregation windows for the alarm.
-
#resource_group ⇒ String
Resource group to match for metric data retrieved by 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.
-
#time_created ⇒ DateTime
[Required] The date and time the alarm was created.
-
#time_updated ⇒ DateTime
[Required] The date and time the alarm was last updated.
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 = {}) ⇒ Alarm
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 = {}) ⇒ Alarm
Initializes the object
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 |
# File 'lib/oci/monitoring/models/alarm.rb', line 417 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.metric_compartment_id_in_subtree = attributes[:'metricCompartmentIdInSubtree'] unless attributes[:'metricCompartmentIdInSubtree'].nil? raise 'You cannot provide both :metricCompartmentIdInSubtree and :metric_compartment_id_in_subtree' if attributes.key?(:'metricCompartmentIdInSubtree') && attributes.key?(:'metric_compartment_id_in_subtree') self.metric_compartment_id_in_subtree = attributes[:'metric_compartment_id_in_subtree'] unless attributes[:'metric_compartment_id_in_subtree'].nil? self.namespace = attributes[:'namespace'] if attributes[:'namespace'] self.resource_group = attributes[:'resourceGroup'] if attributes[:'resourceGroup'] raise 'You cannot provide both :resourceGroup and :resource_group' if attributes.key?(:'resourceGroup') && attributes.key?(:'resource_group') self.resource_group = attributes[:'resource_group'] if attributes[:'resource_group'] self.query = attributes[:'query'] if attributes[:'query'] self.resolution = attributes[:'resolution'] if attributes[:'resolution'] self.pending_duration = attributes[:'pendingDuration'] if attributes[:'pendingDuration'] raise 'You cannot provide both :pendingDuration and :pending_duration' if attributes.key?(:'pendingDuration') && attributes.key?(:'pending_duration') self.pending_duration = attributes[:'pending_duration'] if attributes[:'pending_duration'] self.severity = attributes[:'severity'] if attributes[:'severity'] self.body = attributes[:'body'] if attributes[:'body'] self.is_notifications_per_metric_dimension_enabled = attributes[:'isNotificationsPerMetricDimensionEnabled'] unless attributes[:'isNotificationsPerMetricDimensionEnabled'].nil? self.is_notifications_per_metric_dimension_enabled = false if is_notifications_per_metric_dimension_enabled.nil? && !attributes.key?(:'isNotificationsPerMetricDimensionEnabled') # rubocop:disable Style/StringLiterals 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.is_notifications_per_metric_dimension_enabled = false if is_notifications_per_metric_dimension_enabled.nil? && !attributes.key?(:'isNotificationsPerMetricDimensionEnabled') && !attributes.key?(:'is_notifications_per_metric_dimension_enabled') # rubocop:disable Style/StringLiterals self. = attributes[:'messageFormat'] if attributes[:'messageFormat'] self. = "RAW" if .nil? && !attributes.key?(:'messageFormat') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :messageFormat and :message_format' if attributes.key?(:'messageFormat') && attributes.key?(:'message_format') self. = attributes[:'message_format'] if attributes[:'message_format'] self. = "RAW" if .nil? && !attributes.key?(:'messageFormat') && !attributes.key?(:'message_format') # rubocop:disable Style/StringLiterals self.destinations = attributes[:'destinations'] if attributes[:'destinations'] self.repeat_notification_duration = attributes[:'repeatNotificationDuration'] if attributes[:'repeatNotificationDuration'] raise 'You cannot provide both :repeatNotificationDuration and :repeat_notification_duration' if attributes.key?(:'repeatNotificationDuration') && attributes.key?(:'repeat_notification_duration') self.repeat_notification_duration = attributes[:'repeat_notification_duration'] if attributes[:'repeat_notification_duration'] 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. = 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.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'] self.notification_title = attributes[:'notificationTitle'] if attributes[:'notificationTitle'] raise 'You cannot provide both :notificationTitle and :notification_title' if attributes.key?(:'notificationTitle') && attributes.key?(:'notification_title') self.notification_title = attributes[:'notification_title'] if attributes[:'notification_title'] self.evaluation_slack_duration = attributes[:'evaluationSlackDuration'] if attributes[:'evaluationSlackDuration'] raise 'You cannot provide both :evaluationSlackDuration and :evaluation_slack_duration' if attributes.key?(:'evaluationSlackDuration') && attributes.key?(:'evaluation_slack_duration') self.evaluation_slack_duration = attributes[:'evaluation_slack_duration'] if attributes[:'evaluation_slack_duration'] 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.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.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated'] raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created') self.time_created = attributes[:'time_created'] if attributes[:'time_created'] self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated'] raise 'You cannot provide both :timeUpdated and :time_updated' if attributes.key?(:'timeUpdated') && attributes.key?(:'time_updated') self.time_updated = attributes[:'time_updated'] if attributes[:'time_updated'] end |
Instance Attribute Details
#alarm_summary ⇒ String
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.
285 286 287 |
# File 'lib/oci/monitoring/models/alarm.rb', line 285 def alarm_summary @alarm_summary end |
#body ⇒ String
The human-readable content of the delivered alarm notification. Optionally include dynamic variables. Oracle recommends providing guidance to operators for resolving the alarm condition. Consider adding links to standard runbook practices. Avoid entering confidential information.
Example: High CPU usage alert. Follow runbook instructions for resolution.
180 181 182 |
# File 'lib/oci/monitoring/models/alarm.rb', line 180 def body @body end |
#compartment_id ⇒ String
[Required] The OCID of the compartment containing the alarm.
63 64 65 |
# File 'lib/oci/monitoring/models/alarm.rb', line 63 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\"}}
238 239 240 |
# File 'lib/oci/monitoring/models/alarm.rb', line 238 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.
203 204 205 |
# File 'lib/oci/monitoring/models/alarm.rb', line 203 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
58 59 60 |
# File 'lib/oci/monitoring/models/alarm.rb', line 58 def display_name @display_name end |
#evaluation_slack_duration ⇒ String
Customizable slack period to wait for metric ingestion before evaluating the alarm. Specify a string in ISO 8601 format (PT10M
for ten minutes or PT1H
for one hour). Minimum: PT3M. Maximum: PT2H. Default: PT3M. For more information about the slack period, see About the Internal Reset Period.
275 276 277 |
# File 'lib/oci/monitoring/models/alarm.rb', line 275 def evaluation_slack_duration @evaluation_slack_duration 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\"}
232 233 234 |
# File 'lib/oci/monitoring/models/alarm.rb', line 232 def @freeform_tags end |
#id ⇒ String
[Required] The OCID of the alarm.
49 50 51 |
# File 'lib/oci/monitoring/models/alarm.rb', line 49 def id @id end |
#is_enabled ⇒ BOOLEAN
[Required] Whether the alarm is enabled.
Example: true
226 227 228 |
# File 'lib/oci/monitoring/models/alarm.rb', line 226 def is_enabled @is_enabled end |
#is_notifications_per_metric_dimension_enabled ⇒ BOOLEAN
When set to true
, splits alarm notifications per metric stream. When set to false
, groups alarm notifications across metric streams.
186 187 188 |
# File 'lib/oci/monitoring/models/alarm.rb', line 186 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
292 293 294 |
# File 'lib/oci/monitoring/models/alarm.rb', line 292 def lifecycle_state @lifecycle_state end |
#message_format ⇒ String
The format to use for alarm notifications. The formats are: * RAW
- Raw JSON blob. Default value. When the destinations
attribute specifies Streaming
, all alarm notifications use this format. * PRETTY_JSON
: JSON with new lines and indents. Available when the destinations
attribute specifies Notifications
only. * ONS_OPTIMIZED
: Simplified, user-friendly layout. Available when the destinations
attribute specifies Notifications
only. Applies to Email subscription types only.
194 195 196 |
# File 'lib/oci/monitoring/models/alarm.rb', line 194 def @message_format end |
#metric_compartment_id ⇒ String
[Required] The OCID of the compartment containing the metric being evaluated by the alarm.
69 70 71 |
# File 'lib/oci/monitoring/models/alarm.rb', line 69 def metric_compartment_id @metric_compartment_id end |
#metric_compartment_id_in_subtree ⇒ BOOLEAN
When true, the alarm evaluates metrics from all compartments and subcompartments. The parameter can only be set to true when metricCompartmentId is the tenancy OCID (the tenancy is the root compartment). A true value requires the user to have tenancy-level permissions. If this requirement is not met, then the call is rejected. When false, the alarm evaluates metrics from only the compartment specified in metricCompartmentId. Default is false.
Example: true
80 81 82 |
# File 'lib/oci/monitoring/models/alarm.rb', line 80 def metric_compartment_id_in_subtree @metric_compartment_id_in_subtree end |
#namespace ⇒ String
[Required] The source service or application emitting the metric that is evaluated by the alarm.
Example: oci_computeagent
87 88 89 |
# File 'lib/oci/monitoring/models/alarm.rb', line 87 def namespace @namespace end |
#notification_title ⇒ String
Customizable notification title (title
alarm message parameter). Optionally include dynamic variables. The notification title appears as the subject line in a formatted email message and as the title in a Slack message.
266 267 268 |
# File 'lib/oci/monitoring/models/alarm.rb', line 266 def notification_title @notification_title 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.
259 260 261 |
# File 'lib/oci/monitoring/models/alarm.rb', line 259 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
).
247 248 249 |
# File 'lib/oci/monitoring/models/alarm.rb', line 247 def overrides @overrides end |
#pending_duration ⇒ String
The period of time that the condition defined in the alarm must persist before the alarm state changes from "OK" to "FIRING". For example, a value of 5 minutes means that the alarm must persist in breaching the condition for five minutes before the alarm updates its state to "FIRING".
The duration is specified as a string in ISO 8601 format (PT10M
for ten minutes or PT1H
for one hour). Minimum: PT1M. Maximum: PT1H. Default: PT1M.
Under the default value of PT1M, the first evaluation that breaches the alarm updates the state to "FIRING".
The alarm updates its status to "OK" when the breaching condition has been clear for the most recent minute.
Example: PT5M
162 163 164 |
# File 'lib/oci/monitoring/models/alarm.rb', line 162 def pending_duration @pending_duration 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. You can optionally specify dimensions and grouping functions. Also, you can customize the absence detection period. 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()
—– Example of absence alarm with custom absence detection period of 20 hours:
CpuUtilization[1m]{availabilityDomain=\"cumS:PHX-AD-1\"}.absent(20h)
138 139 140 |
# File 'lib/oci/monitoring/models/alarm.rb', line 138 def query @query end |
#repeat_notification_duration ⇒ String
The frequency for re-submitting alarm notifications, if the alarm keeps firing without interruption. Format defined by ISO 8601. For example, PT4H
indicates four hours. Minimum: PT1M. Maximum: P30D.
Default value: null (notifications are not re-submitted).
Example: PT2H
214 215 216 |
# File 'lib/oci/monitoring/models/alarm.rb', line 214 def repeat_notification_duration @repeat_notification_duration end |
#resolution ⇒ String
The time between calculated aggregation windows for the alarm. Supported value: 1m
143 144 145 |
# File 'lib/oci/monitoring/models/alarm.rb', line 143 def resolution @resolution end |
#resource_group ⇒ String
Resource group to match for metric data retrieved by the alarm. A resource group is a custom string that you can match when retrieving custom metrics. Only one resource group can be applied per metric. A valid resourceGroup value starts with an alphabetical character and includes only alphanumeric characters, periods (.), underscores (_), hyphens (-), and dollar signs ($).
Example: frontend-fleet
95 96 97 |
# File 'lib/oci/monitoring/models/alarm.rb', line 95 def resource_group @resource_group end |
#rule_name ⇒ String
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.
253 254 255 |
# File 'lib/oci/monitoring/models/alarm.rb', line 253 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
169 170 171 |
# File 'lib/oci/monitoring/models/alarm.rb', line 169 def severity @severity end |
#suppression ⇒ OCI::Monitoring::Models::Suppression
The configuration details for suppressing an alarm.
219 220 221 |
# File 'lib/oci/monitoring/models/alarm.rb', line 219 def suppression @suppression end |
#time_created ⇒ DateTime
[Required] The date and time the alarm was created. Format defined by RFC3339.
Example: 2023-02-01T01:02:29.600Z
299 300 301 |
# File 'lib/oci/monitoring/models/alarm.rb', line 299 def time_created @time_created end |
#time_updated ⇒ DateTime
[Required] The date and time the alarm was last updated. Format defined by RFC3339.
Example: 2023-02-03T01:02:29.600Z
306 307 308 |
# File 'lib/oci/monitoring/models/alarm.rb', line 306 def time_updated @time_updated end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/oci/monitoring/models/alarm.rb', line 309 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'display_name': :'displayName', 'compartment_id': :'compartmentId', 'metric_compartment_id': :'metricCompartmentId', 'metric_compartment_id_in_subtree': :'metricCompartmentIdInSubtree', 'namespace': :'namespace', 'resource_group': :'resourceGroup', 'query': :'query', 'resolution': :'resolution', 'pending_duration': :'pendingDuration', 'severity': :'severity', 'body': :'body', 'is_notifications_per_metric_dimension_enabled': :'isNotificationsPerMetricDimensionEnabled', 'message_format': :'messageFormat', 'destinations': :'destinations', 'repeat_notification_duration': :'repeatNotificationDuration', 'suppression': :'suppression', 'is_enabled': :'isEnabled', 'freeform_tags': :'freeformTags', 'defined_tags': :'definedTags', 'overrides': :'overrides', 'rule_name': :'ruleName', 'notification_version': :'notificationVersion', 'notification_title': :'notificationTitle', 'evaluation_slack_duration': :'evaluationSlackDuration', 'alarm_summary': :'alarmSummary', 'lifecycle_state': :'lifecycleState', 'time_created': :'timeCreated', 'time_updated': :'timeUpdated' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/oci/monitoring/models/alarm.rb', line 346 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'display_name': :'String', 'compartment_id': :'String', 'metric_compartment_id': :'String', 'metric_compartment_id_in_subtree': :'BOOLEAN', 'namespace': :'String', 'resource_group': :'String', 'query': :'String', 'resolution': :'String', 'pending_duration': :'String', 'severity': :'String', 'body': :'String', 'is_notifications_per_metric_dimension_enabled': :'BOOLEAN', 'message_format': :'String', 'destinations': :'Array<String>', 'repeat_notification_duration': :'String', 'suppression': :'OCI::Monitoring::Models::Suppression', 'is_enabled': :'BOOLEAN', 'freeform_tags': :'Hash<String, String>', 'defined_tags': :'Hash<String, Hash<String, Object>>', 'overrides': :'Array<OCI::Monitoring::Models::AlarmOverride>', 'rule_name': :'String', 'notification_version': :'String', 'notification_title': :'String', 'evaluation_slack_duration': :'String', 'alarm_summary': :'String', 'lifecycle_state': :'String', 'time_created': :'DateTime', 'time_updated': :'DateTime' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 |
# File 'lib/oci/monitoring/models/alarm.rb', line 612 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 && metric_compartment_id_in_subtree == other.metric_compartment_id_in_subtree && namespace == other.namespace && resource_group == other.resource_group && query == other.query && resolution == other.resolution && pending_duration == other.pending_duration && severity == other.severity && body == other.body && is_notifications_per_metric_dimension_enabled == other.is_notifications_per_metric_dimension_enabled && == other. && destinations == other.destinations && repeat_notification_duration == other.repeat_notification_duration && suppression == other.suppression && is_enabled == other.is_enabled && == other. && == other. && overrides == other.overrides && rule_name == other.rule_name && notification_version == other.notification_version && notification_title == other.notification_title && evaluation_slack_duration == other.evaluation_slack_duration && alarm_summary == other.alarm_summary && lifecycle_state == other.lifecycle_state && time_created == other.time_created && time_updated == other.time_updated end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 |
# File 'lib/oci/monitoring/models/alarm.rb', line 670 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
650 651 652 |
# File 'lib/oci/monitoring/models/alarm.rb', line 650 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
659 660 661 |
# File 'lib/oci/monitoring/models/alarm.rb', line 659 def hash [id, display_name, compartment_id, metric_compartment_id, metric_compartment_id_in_subtree, namespace, resource_group, query, resolution, pending_duration, severity, body, is_notifications_per_metric_dimension_enabled, , destinations, repeat_notification_duration, suppression, is_enabled, , , overrides, rule_name, notification_version, notification_title, evaluation_slack_duration, alarm_summary, lifecycle_state, time_created, time_updated].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
703 704 705 706 707 708 709 710 711 712 |
# File 'lib/oci/monitoring/models/alarm.rb', line 703 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
697 698 699 |
# File 'lib/oci/monitoring/models/alarm.rb', line 697 def to_s to_hash.to_s end |