class Sysdig::GetAlerts

Public Instance Methods

mock(from: nil, to: nil) click to toggle source
# File lib/sysdig/get_alerts.rb, line 20
def mock(from: nil, to: nil)
  alerts = service.data[:alerts].values

  service.response(
    :body => { "alerts" => alerts },
  )
end
real(from: nil, to: nil) click to toggle source
# File lib/sysdig/get_alerts.rb, line 2
def real(from: nil, to: nil)
  params = {}

  if from
    params.merge!(from.to_i * 1_000_000)
  end

  if to
    params.merge!(to.to_i * 1_000_000)
  end

  service.request(
    :method => :get,
    :path   => "/api/alerts",
    :params => params,
  )
end