Method: ESP::Stat.for_report

Defined in:
lib/esp/resources/stat.rb

.for_report(report_id = nil, options = {}) ⇒ ActiveResource::PaginatedCollection<ESP::Stat>

Returns all the stats of all the alerts for a report identified by the report_id parameter. Said report contains all statistics for this alert triggered from signatures contained in all regions for the selected hour.

Parameters

Parameters:

  • report_id (Integer, Numeric) (defaults to: nil)

    Required ID of the report to retrieve stats for.

  • options (Hash) (defaults to: {})

    Optional hash of options.

    Valid Options

    include | The list of associated objects to return on the initial request.

    valid Includable Associations

    See API documentation for valid arguments

Returns:

Raises:

  • (ArgumentError)

    if no report_id is supplied.



74
75
76
77
78
# File 'lib/esp/resources/stat.rb', line 74

def self.for_report(report_id = nil, options = {}) # rubocop:disable Style/OptionHash
  fail ArgumentError, "You must supply a report id." unless report_id.present?
  # call find_one directly since find is overriden/not implemented
  find_one(from: "#{prefix}reports/#{report_id}/stats.json", params: options)
end