Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.
This repository was archived by the owner on May 5, 2025. It is now read-only.

query declared classes of a specific node #86

Description

@unki

Previously I was using query_resource() to retrieve all declared classes on a specific node. This was done by:

query_resources("certname=somehost", "Class")

Since I updated to PuppetDB 3.2 and switched to puppetdbquery 2.1.1 the above query does not fail, but retrieves nothing.

I'm not sure how I shall rework that query. I tried already:

query_resource("certname=somehost", "type[class]")
query_resource("certname=somehost", "type[class]{name~'.*'}")

They succeed but also returned no result. Querying PuppetDB directly I would use this query string to retrieve all classes:

curl -X GET http://localhost:8080/pdb/query/v4/resources --data-urlencode 'query=["and", ["=","certname","somehost"], ["=","type","Class"]]'

But I have no clue how I get it work with puppetdbquery.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions