Class: OpenObserve::Alert

Inherits:
Record
  • Object
show all
Defined in:
lib/openobserve/alert.rb

Overview

An alert definition. OpenObserve serves alert CRUD from its v2 API; the wrapper hides that split.

Instance Attribute Summary

Attributes inherited from Record

#raw

Instance Method Summary collapse

Methods inherited from Record

#==, #[], from, #hash, #initialize, #to_h

Constructor Details

This class inherits a constructor from OpenObserve::Record

Instance Method Details

#idString?

The identifier the member routes take.

Spelled alert_id by the listing and id by a fetched alert, so inheriting Record#id returned nil for every listed alert: OpenObserve::Alerts#get and OpenObserve::Alerts#update were then handed no id and reached the collection route instead, answering 404 — which reads as a missing alert rather than a missing key.

Returns:

  • (String, nil)


14
15
16
# File 'lib/openobserve/alert.rb', line 14

def id
  self['id'] || self['alert_id']
end