Added a query_resource function for Puppet.