class Hawkular::Alerts::Alert
Representation of one alert. The name of the members are literally what they are in the JSON sent from the server and not 'rubyfied'. So 'alertId' and not 'alert_id' Check www.hawkular.org/docs/rest/rest-alerts.html#Alert for details
Attributes
lifecycle[RW]
Public Class Methods
new(alert_hash)
click to toggle source
Calls superclass method
# File lib/hawkular/alerts/alerts_api.rb 586 def initialize(alert_hash) 587 super(alert_hash) 588 @lifecycle = alert_hash['lifecycle'] 589 end
Public Instance Methods
ack_by()
click to toggle source
# File lib/hawkular/alerts/alerts_api.rb 591 def ack_by 592 status_by('ACKNOWLEDGED') 593 end
Also aliased as: ackBy
resolved_by()
click to toggle source
# File lib/hawkular/alerts/alerts_api.rb 595 def resolved_by 596 status_by('RESOLVED') 597 end
Also aliased as: resolvedBy
status_by(status)
click to toggle source
# File lib/hawkular/alerts/alerts_api.rb 599 def status_by(status) 600 a = @lifecycle.nil? ? [] : @lifecycle.select { |l| l['status'].eql? status } 601 a.empty? ? nil : a.last['user'] 602 end