NB: The following examples where done on Puppet Enterprise 3.0. Should be similar for OS versions, except for some file locations.
The easiest way to snoop around in de actual PuppetDB postgres database is using the command prompt. You have to be the peadmin user though. Couldn't get it working just under root.
[root@master bin]# sudo su - pe-postgres -s /bin/bash
-bash-4.1$ /opt/puppet/bin/psql
psql (9.2.4)
Type "help" for help.
pe-postgres=# \c pe-puppetdb
You are now connected to database "pe-puppetdb" as user "pe-postgres".
pe-puppetdb=#
Using the REST interface is the way to go, but for some testing purposes I needed to check and/or manipulate some data. Just use the psql
console for this:
a. List all tables:
pe-puppetdb=# \d
List of relations
Schema | Name | Type | Owner
--------+-------------------------+-------+-------------
public | catalog_resources | table | pe-puppetdb
public | catalogs | table | pe-puppetdb
public | certname_catalogs | table | pe-puppetdb
public | certname_facts | table | pe-puppetdb
public | certname_facts_metadata | table | pe-puppetdb
public | certnames | table | pe-puppetdb
public | edges | table | pe-puppetdb
public | reports | table | pe-puppetdb
public | resource_events | table | pe-puppetdb
public | resource_params | table | pe-puppetdb
public | schema_migrations | table | pe-puppetdb
b. Get all nodes:
pe-puppetdb=# select * from certnames;
name | deactivated
------------+-------------
agent |
dummy174 |
dummy76 |
agent2 |
dummy25 |
...
b.