Bug #4805
closed
Try using a "attribute = value" style of searching instead of relying on free text search. The same search rules as in the UI (which has a useful auto-complete) apply here, so "name = CentOS" will return all CentOS operating systems.
The "attribute=value" is still passed within the "search" parameter, sorry that wasn't clear. For example:
https://foreman_server/api/v2/operatingsystems?search=fullname=CentOS 6.3
Have a look at the GUI for a better idea, you'll be able to search for something and reuse the same search string against the API.
The parse issue has been fixed in #4201 for Foreman 1.5.0.
Ok, so searching like this:
https://foreman_server/api/v2/operatingsystems?search=fullname=CentOS 6.3
Gives back:
{
"error": {
"message": "Field 'fullname' not recognized for searching!",
"class": "ScopedSearch::QueryNotSupported"
}
}
But I see your point and the parsing issue solved is all that I need.
Thank you for your help! You may now close this issue.
- Status changed from New to Resolved
Oh sorry, I copied your example without reading and checking it. It looks like we don't have a field at the moment for the "fullname", since that area (the concatenated name) is a bit complex and messy. It may be better to search for a specific name, major and minor. Anyway, glad that helped a bit, closing.
Also available in: Atom
PDF