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.

Revisions

  1. Tim Ski revised this gist May 10, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions puppetdb-curl.sh
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,8 @@ 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'
  2. Tim Ski revised this gist Mar 26, 2015. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion puppetdb-curl.sh
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,9 @@ 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=["=", ["fact", "kerneldate"], "25Feb2015”]'
    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'

  3. Tim Ski created this gist Mar 26, 2015.
    17 changes: 17 additions & 0 deletions puppetdb-curl.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    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=["=", ["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 -X GET 'http://localhost:8080/v3/resources/User'

    curl -sf -X GET 'http://localhost:8080/v3/fact-names'