From 7fa32ee305ce34e5d358a888ab0672f0747f85a8 Mon Sep 17 00:00:00 2001 From: ebner Date: Thu, 19 Mar 2026 14:41:02 +0100 Subject: [PATCH] add new filter example --- docs/engineering-guide/puppet/api.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/engineering-guide/puppet/api.md b/docs/engineering-guide/puppet/api.md index cd11d948..3b156ba4 100644 --- a/docs/engineering-guide/puppet/api.md +++ b/docs/engineering-guide/puppet/api.md @@ -20,6 +20,13 @@ With jq you can filter the output to get only the information you are interested curl -G https://puppet.psi.ch/pdb_api/inventory | jq '.[].certname' ``` +List all machines with a specific package such as `yfs-client` installed: + +```bash +curl -G https://puppet.psi.ch/pdb_api/inventory | jq -r '.[] | select(.facts.installed_packages[][0] | startswith("yfs-client")) | .certname ' +``` + + More details about what is possible with the API can be found here: https://help.puppet.com/pdb/8/topics/query.htm