PuppetDB exposes a dashboard, showing various operational metrics, as well as an API for accessing all the collected resource data. You can find the port for the dashboard using docker ps.
The docker port command can also be useful.
$ docker port compose_puppetdb_1
8080/tcp -> 0.0.0.0:32826
8081/tcp -> 0.0.0.0:32825
With that port in hand, and the ip address of the machine running docker, you can query the PuppetDB API.
$ curl -s -X GET http://192.168.99.100:32826/pdb/query/v4 --data-urlencode 'query=nodes {}' | jq
Here I'm issuing a PQL query for all nodes. I'm parsing it through jq for nicer formatting.
This will give you an output something similar to this:
{
"deactivated": null,
"latest_report_hash": "f8332ac22e0abf6a51571fae6b57b2a881f207fe",
"facts_environment": "production",
"cached_catalog_status": "not_used",
"report_environment": "production",
"catalog_environment": "production",
"facts_timestamp": "2016-05-27T12:47:04.495Z",
"latest_report_noop": false,
"expired": null,
"report_timestamp": "2016-05-27T12:47:04.144Z",
"certname": "a9efc038b3ca",
"catalog_timestamp": "2016-05-27T12:47:05.038Z",
"latest_report_status": "changed"
},
{
"deactivated": null,
"latest_report_hash": "d273124e1e74708272228ac4465f6f1923100db7",
"facts_environment": "production",
"cached_catalog_status": "not_used",
"report_environment": "production",
"catalog_environment": "production",
"facts_timestamp": "2016-05-27T12:47:37.543Z",
"latest_report_noop": false,
"expired": null,
"report_timestamp": "2016-05-27T12:47:36.959Z",
"certname": "5a4cbf61e790",
"catalog_timestamp": "2016-05-27T12:47:38.050Z",
"latest_report_status": "changed"
}
]