Want to filter api/fact_values so I only see a certain subset of facts

Problem:

The request from GET /api/fact_values contains way too many facts that I have no need for (ie. ip4_interfaces, pythonpath, etc).

Expected outcome:

I’m not sure if this exists, but I would like a way to filter the API to only return back the facts that I want/specify (ie. num_cpus, memorysize, os, etc).

For example, if I call the API with something like ‘…api/fact_values/?search=num_cpus&os&memorysize’ (or something along these lines), then I want the output to only contains these facts.

Currently, this works if I only want a SINGLE fact. For example, ‘…api/fact_values/?search=num_cpus’ returns only the facts regarding ‘num_cpus’. However, I cannot find a way to include more than one field/fact.

Foreman and Proxy versions:

1.20.1

You can use the ^(in) operator for searching multiple values, e.g.:
search = name ^ (num_cpus, os, memorysize)

You can find more information about the query syntax in the Foreman :: Manual or at https://github.com/wvanbergen/scoped_search/wiki/Query-language

1 Like