Method: Unifi::Client::Main#list_events

Defined in:
lib/unifi/client/main.rb

#list_events(options = {}) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/unifi/client/main.rb', line 32

def list_events(options = {})
  body = { _sort: '-time', }
  body[:within] = options[:historyhours] || 720
  body[:_start] = options[:start] || 0
  body[:_limit] = options[:limit] || 3000
  response = self.class.get("/s/#{@site}/stat/event", { body: body.to_json })
  response.parsed_response
end