Class: ESP::Report
- Inherits:
-
Resource
- Object
- ActiveResource::Base
- Resource
- ESP::Report
- Defined in:
- lib/esp/resources/report.rb,
lib/esp/resources/reports/export/integration.rb
Defined Under Namespace
Modules: Export
Class Method Summary collapse
-
.all ⇒ ActiveResource::PaginatedCollection<ESP::Report>
Return a paginated Report list.
-
.create(arguments = {}) ⇒ ESP::Report
Enqueue a report to be run for the given team.
-
.find(id) ⇒ ESP::Report
Find a Report by id.
-
.where(clauses = {}) ⇒ ActiveResource::PaginatedCollection<ESP::Report>
Return a paginated Report list filtered by search parameters.
Instance Method Summary collapse
-
#alerts(arguments = {}) ⇒ ActiveResource::PaginatedCollection<ESP::Alert>
Returns a paginated collection of alerts for the report.
-
#destroy ⇒ void
Not Implemented.
-
#external_account ⇒ ESP::ExternalAccount
The external_account the report belongs to.
-
#organization ⇒ ESP::Organization
The organization the report belongs to.
-
#stat ⇒ ActiveResource::PaginatedCollection<ESP::Stat>
Returns the stats for this report.
-
#sub_organization ⇒ ESP::SubOrganization
The sub_organization the report belongs to.
-
#team ⇒ ESP::Team
The team the report belongs to.
-
#update ⇒ void
Not Implemented.
Methods included from Dirty
#changed_attributes, #original_attributes, #original_attributes=
Methods included from LoadWithOriginalAttributes
Class Method Details
.all ⇒ ActiveResource::PaginatedCollection<ESP::Report>
Return a paginated Report list
|
# File 'lib/esp/resources/report.rb', line 109
|
.create(arguments = {}) ⇒ ESP::Report
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.
53 54 55 56 57 58 |
# 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 |
.find(id) ⇒ ESP::Report .find(id, options = {}) ⇒ ESP::Report
Find a Report by id
call-seq -> super.find(id, options = {})
|
# File 'lib/esp/resources/report.rb', line 90
|
.where(clauses = {}) ⇒ ActiveResource::PaginatedCollection<ESP::Report>
Return a paginated Report list filtered by search parameters
call-seq -> super.where(clauses = {})
|
# File 'lib/esp/resources/report.rb', line 81
|
Instance Method Details
#alerts ⇒ ActiveResource::PaginatedCollection<ESP::Alert> #alerts(arguments = {}) ⇒ ActiveResource::PaginatedCollection<ESP::Alert>
Returns a paginated collection of alerts for the report
70 71 72 |
# File 'lib/esp/resources/report.rb', line 70 def alerts(arguments = {}) ESP::Alert.where(arguments.merge(report_id: id)) end |
#destroy ⇒ void
This method returns an undefined value.
Not Implemented. You cannot destroy a Report.
37 38 39 |
# File 'lib/esp/resources/report.rb', line 37 def destroy fail ESP::NotImplementedError end |
#external_account ⇒ ESP::ExternalAccount
The external_account the report belongs to.
25 |
# File 'lib/esp/resources/report.rb', line 25 belongs_to :external_account, class_name: 'ESP::ExternalAccount' |
#organization ⇒ ESP::Organization
The organization the report belongs to.
10 |
# File 'lib/esp/resources/report.rb', line 10 belongs_to :organization, class_name: 'ESP::Organization' |
#stat ⇒ ActiveResource::PaginatedCollection<ESP::Stat>
Returns the stats for this report
77 78 79 |
# File 'lib/esp/resources/report.rb', line 77 def stat ESP::Stat.for_report(id) end |
#sub_organization ⇒ ESP::SubOrganization
The sub_organization the report belongs to.
15 |
# File 'lib/esp/resources/report.rb', line 15 belongs_to :sub_organization, class_name: 'ESP::SubOrganization' |
#team ⇒ ESP::Team
The team the report belongs to.
20 |
# File 'lib/esp/resources/report.rb', line 20 belongs_to :team, class_name: 'ESP::Team' |
#update ⇒ void
This method returns an undefined value.
Not Implemented. You cannot update a Report.
30 31 32 |
# File 'lib/esp/resources/report.rb', line 30 def update fail ESP::NotImplementedError end |