Actions
Feature #882
closedadd api call to reports page to get the index section
Description
Need api call to get back a list of reports via json so that it returns the same thing http://foreman/reports currently does.
Will need report summary, timestamp, hosts, report id, report status.
Updated by Corey Osman over 13 years ago
This does not work correctly. The code below (in the patch) only returns success and never returns a summary status with failed or modified.
You can reproduce this by using the following url
1. http://puppet/reports?search=failed%3E0&format=json
2. Use the browser search to find the summary. The summary result should be "failed" instead of "success"
def summarystatus case self when error? "Failed" when changes? "Modified" else "Success" end end
The following code ensures the correct status will be returned.
def summarystatus if self.error? return "Failed" elsif self.changes? return "Modified" else return "Success" end end
Updated by Ohad Levy over 13 years ago
- Category set to API
- Status changed from New to Closed
Actions