Class: Sysdig::AlertNotifications

Inherits:
Collection
  • Object
show all
Defined in:
lib/sysdig/alert_notifications.rb

Instance Method Summary collapse

Instance Method Details

#all(options = {}) ⇒ Object



5
6
7
8
9
10
# File 'lib/sysdig/alert_notifications.rb', line 5

def all(options={})
  to   = options[:to]   || Time.now
  from = options[:from] || Time.at(Time.now.to_i - 86400) # 1 day

  load(service.get_alert_notifications(from, to).body.fetch("notifications"))
end

#get(identity) ⇒ Object



12
13
14
15
16
# File 'lib/sysdig/alert_notifications.rb', line 12

def get(identity)
  new(
    service.get_alert_notification(identity).body.fetch("notification")
  )
end