Feature #882
closed
add api call to reports page to get the index section
Added by Corey Osman over 13 years ago.
Updated over 13 years ago.
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.
- Assignee set to Corey Osman
- Target version set to 0.3
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
- Category set to API
- Status changed from New to Closed
Also available in: Atom
PDF