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](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#AlarmsOverview).
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](docs.cloud.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm).
For information about endpoints and signing API requests, see [About the API](docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm). For information about available SDKs and tools, see [SDKS and Other Tools](docs.cloud.oracle.com/iaas/Content/API/Concepts/sdks.htm).
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](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) 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 to which the notifications for this alarm will be delivered.
-
#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](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the alarm.
-
#is_enabled ⇒ BOOLEAN
[Required] Whether the alarm is enabled.
-
#lifecycle_state ⇒ String
[Required] The current lifecycle state of the alarm.
-
#metric_compartment_id ⇒ String
[Required] The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) 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.
-
#query ⇒ String
[Required] The Monitoring Query Language (MQL) expression to evaluate for the alarm.
-
#severity ⇒ String
[Required] The perceived severity of the alarm with regard to the affected system.
-
#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
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 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 197 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. = 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'] end |
Instance Attribute Details
#compartment_id ⇒ String
[Required] The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the alarm.
46 47 48 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 46 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: ‘{"CostCenter": "42"}`
127 128 129 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 127 def @defined_tags end |
#destinations ⇒ Array<String>
[Required] A list of destinations to which the notifications for this alarm will be delivered. Each destination is represented by an [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) related to the supported destination service. For example, a destination using the Notifications service is represented by a topic OCID. Supported destination services: Notifications Service. Limit: One destination per supported destination service.
103 104 105 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 103 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. Avoid entering confidential information.
This name is sent as the title for notifications related to this alarm.
Example: ‘High CPU Utilization`
41 42 43 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 41 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: ‘"Finance"`
121 122 123 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 121 def @freeform_tags end |
#id ⇒ String
[Required] The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the alarm.
31 32 33 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 31 def id @id end |
#is_enabled ⇒ BOOLEAN
[Required] Whether the alarm is enabled.
Example: ‘true`
115 116 117 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 115 def is_enabled @is_enabled end |
#lifecycle_state ⇒ String
[Required] The current lifecycle state of the alarm.
Example: ‘DELETED`
134 135 136 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 134 def lifecycle_state @lifecycle_state end |
#metric_compartment_id ⇒ String
[Required] The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the metric being evaluated by the alarm.
52 53 54 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 52 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`
59 60 61 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 59 def namespace @namespace 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: ‘1m`-`60m` (also `1h`). You can optionally specify dimensions and grouping functions. Supported grouping functions: `grouping()`, `groupBy()`. For details about Monitoring Query Language (MQL), see [Monitoring Query Language (MQL) Reference](docs.cloud.oracle.com/iaas/Content/Monitoring/Reference/mql.htm). For available dimensions, review the metric definition for the supported service. See [Supported Services](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices).
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()
-----
88 89 90 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 88 def query @query end |
#severity ⇒ String
[Required] The perceived severity of the alarm with regard to the affected system.
Example: ‘CRITICAL`
95 96 97 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 95 def severity @severity end |
#suppression ⇒ OCI::Monitoring::Models::Suppression
The configuration details for suppressing an alarm.
108 109 110 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 108 def suppression @suppression end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 137 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', 'freeform_tags': :'freeformTags', 'defined_tags': :'definedTags', 'lifecycle_state': :'lifecycleState' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 158 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', 'freeform_tags': :'Hash<String, String>', 'defined_tags': :'Hash<String, Hash<String, Object>>', 'lifecycle_state': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 278 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 && == other. && == other. && lifecycle_state == other.lifecycle_state end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 320 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
300 301 302 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 300 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
309 310 311 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 309 def hash [id, display_name, compartment_id, metric_compartment_id, namespace, query, severity, destinations, suppression, is_enabled, , , lifecycle_state].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
353 354 355 356 357 358 359 360 361 362 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 353 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
347 348 349 |
# File 'lib/oci/monitoring/models/alarm_summary.rb', line 347 def to_s to_hash.to_s end |