O'Reilly logo

Extending Puppet - Second Edition by Jaime Soriano Pastor, Alessandro Franceschi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PuppetDB API

PuppetDB uses a Command/Query Responsibility Separation (CQRS) pattern:

  • Read activities are done for queries on the available REST, such as endpoints
  • Write commands to update catalog, facts, and reports, and deactivate nodes

APIs are versioned (v1, v2, v3...). The most recent ones add functionalities and try to keep backwards compatibility.

Querying PuppetDB (read)

The URL for queries is structured like this:

http[s]://<server>:<port>/pdb/query/<version>/<endpoint>?query=<query>

Available endpoints for queries are: nodes, environments, factsets, facts, fact-names, fact-paths, fact-contents, catalogs, edges, resources, reports, events, event-counts, aggregate-event-counts, metrics, server-time, and version.

Query strings are URL-encoded JSON ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required