Class: OCI::Monitoring::Models::AlarmStatusSummary

Inherits:
Object
  • Object
show all
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](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
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AlarmStatusSummary

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 113

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.timestamp_triggered = attributes[:'timestampTriggered'] if attributes[:'timestampTriggered']

  raise 'You cannot provide both :timestampTriggered and :timestamp_triggered' if attributes.key?(:'timestampTriggered') && attributes.key?(:'timestamp_triggered')

  self.timestamp_triggered = attributes[:'timestamp_triggered'] if attributes[:'timestamp_triggered']

  self.status = attributes[:'status'] if attributes[:'status']

  self.suppression = attributes[:'suppression'] if attributes[:'suppression']
end

Instance Attribute Details

#display_nameString

[Required] The configured name of the alarm.

Example: ‘High CPU Utilization`

Returns:

  • (String)


45
46
47
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 45

def display_name
  @display_name
end

#idString

Returns:

  • (String)


38
39
40
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 38

def id
  @id
end

#severityString

[Required] The configured severity of the alarm.

Example: ‘CRITICAL`

Returns:

  • (String)


52
53
54
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 52

def severity
  @severity
end

#statusString

[Required] The status of this alarm.

Example: ‘FIRING`

Returns:

  • (String)


66
67
68
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 66

def status
  @status
end

#suppressionOCI::Monitoring::Models::Suppression

The configuration details for suppressing an alarm.



71
72
73
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 71

def suppression
  @suppression
end

#timestamp_triggeredDateTime

[Required] Timestamp for the transition of the alarm state. For example, the time when the alarm transitioned from OK to Firing.

Example: ‘2019-02-01T01:02:29.600Z`

Returns:

  • (DateTime)


59
60
61
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 59

def timestamp_triggered
  @timestamp_triggered
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 74

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'display_name': :'displayName',
    'severity': :'severity',
    'timestamp_triggered': :'timestampTriggered',
    'status': :'status',
    'suppression': :'suppression'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 88

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'display_name': :'String',
    'severity': :'String',
    'timestamp_triggered': :'DateTime',
    'status': :'String',
    'suppression': :'OCI::Monitoring::Models::Suppression'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



173
174
175
176
177
178
179
180
181
182
183
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 173

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    id == other.id &&
    display_name == other.display_name &&
    severity == other.severity &&
    timestamp_triggered == other.timestamp_triggered &&
    status == other.status &&
    suppression == other.suppression
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 208

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


188
189
190
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 188

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



197
198
199
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 197

def hash
  [id, display_name, severity, timestamp_triggered, status, suppression].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



241
242
243
244
245
246
247
248
249
250
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 241

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



235
236
237
# File 'lib/oci/monitoring/models/alarm_status_summary.rb', line 235

def to_s
  to_hash.to_s
end