Skip to content

Instantly share code, notes, and snippets.

@hameedullah
Forked from marshyski/puppetdb-curl.sh
Created January 22, 2017 20:03
Show Gist options
  • Save hameedullah/8d21ad789d82907680fb8bcd45937e32 to your computer and use it in GitHub Desktop.
Save hameedullah/8d21ad789d82907680fb8bcd45937e32 to your computer and use it in GitHub Desktop.
Puppet DB Curl Examples
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["node", "active"], true]'
curl -sf 'http://localhost:8080/v3/facts'
curl -sf 'http://localhost:8080/v3/nodes'
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["fact", "kernel"], "Linux"]'
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["fa, "operatingsystem"], "windows"]'
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["fact", "kerneldate"], "25Feb2015"]'
curl -sf 'http://localhost:8080/v3/nodes/master.inf.puppetlabs.demo/facts'
curl -sf 'http://localhost:8080/v3/nodes/master.inf.puppetlabs.demo/facts/kerneldate'
curl -sf 'http://localhost:8080/v3/facts' | grep -A1 -B1 kerneldate | grep -v '\--'
curl -sf -X GET 'http://localhost:8080/v3/resources/User'
curl -sf -X GET 'http://localhost:8080/v3/fact-names'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment