class ESP::Report

Public Class Methods

create(arguments = {}) click to toggle source

Enqueue a report to be run for the given team. Returns a Report object with a status of 'queued' and an id

Periodically check the API

ESP::Report.find(<id>)

until status is 'complete'.

If not successful, returns a Report object with the errors object populated.

@param arguments [Hash] See API documentation for valid arguments @return [ESP::Report] @raise [ArgumentError] if +team_id: Integer+ is not supplied.

Calls superclass method
# File lib/esp/resources/report.rb, line 53
def self.create(arguments = {})
  fail ArgumentError, "You must supply a team id." unless arguments.with_indifferent_access[:team_id].present?
  super
rescue ActiveResource::ResourceNotFound => error
  new(arguments).tap { |r| r.load_remote_errors(error, true) }
end

Public Instance Methods

alerts(arguments = {}) click to toggle source

Returns a paginated collection of alerts for the report

@overload alerts() @overload alerts(arguments = {}) @param arguments [Hash] An optional hash of search criteria to filter the returned collection.

See {API documentation}[http://api-docs.evident.io?ruby#alert-attributes] for valid arguments.

@return [ActiveResource::PaginatedCollection<ESP::Alert>] @example

report = ESP::Report.find(345)
alerts = report.alerts(status_eq: 'fail', signature_risk_level_in: ['High'])
# File lib/esp/resources/report.rb, line 70
def alerts(arguments = {})
  ESP::Alert.where(arguments.merge(report_id: id))
end
destroy() click to toggle source

Not Implemented. You cannot destroy a Report.

@return [void]

# File lib/esp/resources/report.rb, line 37
def destroy
  fail ESP::NotImplementedError
end
stat() click to toggle source

Returns the stats for this report

@return [ActiveResource::PaginatedCollection<ESP::Stat>]

# File lib/esp/resources/report.rb, line 77
def stat
  ESP::Stat.for_report(id)
end
update() click to toggle source

Not Implemented. You cannot update a Report.

@return [void]

# File lib/esp/resources/report.rb, line 30
def update
  fail ESP::NotImplementedError
end