Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-341

Select-resources for file and line on facts end-point are unsupported

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PDB 1.5.0, PDB 1.6.0-rc2
    • Fix Version/s: PDB 1.6.2
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      3
    • Sprint:
      20140122 to 20140129, 20140129 to 20140205

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              ken Ken Barber
              Reporter:
              ak0ska Akos Hencz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support