Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Slides and code samples from PuppetConf 2012
branch: master

Merge pull request #1 from thomasbiddle/api_patches

Adding option to change protocol. Adding option to not use storedconfigs...
latest commit 5be304eb20
Dave Dash davedash authored
Failed to load latest commit information.
api-examples Initial commit.
LICENSE Initial commit. Adding option to change protocol. Adding option to not use storedconf… Initial commit.
presentation.pdf Initial commit. Initial commit.

Puppet API and Related Code Examples

The script is an example of a REST API for Puppet Dashboard and Puppet storeconfigs data. This script is a self-contained application written using Python's Flask microframework.

This script was designed specifically for Pinterest's infrastructure, so it might not directly be relevant for your environment. We wanted to publish some sample code to show how our REST API works, and we hope this is at least a starting point for those of you that choose to create your own API.

Copyright (c) 2011-2012 Pinterest, Inc. See LICENSE for details.


  1. You must be using Puppet Dashboard 1.2 or higher, preferably version 1.2.10 or above.
  2. Your puppetmaster must be configured to use storeconfigs (storeconfigs=true in your puppetmaster's /etc/puppet/puppet.conf).
  3. This scripts requires Python 2.7 the Python libraries PyMySQL and Flask.

Usage: python <port> to run a single-threaded web server process on the given port. Defaults to port 9000.

We recommend running this in conjunction with Supervisor, a watchdog daemon for Python applications. Here's an example Supervisor config stanza to run 8 processes on ports 9000-9007:

command=python 90%(process_num)02d
Something went wrong with that request. Please try again.