O'Reilly logo

Extending Puppet by 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

The PuppetDB API

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

  • Read: These activities are done for queries on the available REST-like endpoints
  • Write: These commands update catalog, facts, and reports and deactivate nodes

APIs are versioned (v1, v2, v3, and so on), and the most recent ones add functionalities and try to keep backward compatibility.

Querying PuppetDB (Read)

The URL for queries is structured as follows:

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

The available endpoints for queries are metrics, fact-names, facts, nodes, resources, reports, events, event-counts, aggregate-event-counts, and server-time.

Query strings are URL-encoded JSON arrays in prefix notation, which makes them look a bit unusual. ...

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