Hello,
We wanted to created a query, which would check the hostgroup fact of machines that apply a certain type of resource declared in a certain manifest file. We wanted to use the 'select-resources' subquery as follows:
curl -G -H "Accept: application/json" localhost:8080/v3/facts --data-urlencode 'query=["and",["=","name","hostgroup"], ["in","certname",["extract","certname", ["select-resources", ["and",["=", "type", "Class"],["=","file","/path/to/mymanifest.pp"]]]]]]'
This returns an error: "file is not a queryable object for resources".
According to the documentation, 'select-resources' takes any arguments valid for /v3/resources endpoint.
If we try the arguments of 'select-resources' directly to the resources endpoint, we get valid results:
curl -G -H "Accept: application/json" localhost:8080/v3/resources --data-urlencode 'query=["and",["=", "type", "Class"],["=","file","/path/to/mymanifest.pp"]]'
lists all 'Class' type resources (and properties) declared in mymanifest.pp.
If we try and query the "title" property, instead of the "file" property it works fine. Did we miss something?