I'm not 100% if its not possible with the latest version of puppet, but its possible using foreman, something like:
curl -s -u admin:password
https://foreman/hosts/<certname>/reports/last -k -H 'Accept:application/json' |prettify_json.rb
{
"report": {
"id": 396001,
"summary": "Modified",
"status": {
"applied": 1,
"skipped": 0,
"failed_restarts": 0,
"restarted": 0,
"failed": 0
},
"host": "certname",
"logs": [
{
"log": {
"sources": {
"source": "/Stage[main]/Ntp::Service/Service[ntpd]/ensure"
},
"messages": {
"message": "ensure changed 'stopped' to 'running'"
}
}
},
{
"log": {
"sources": {
"source": "Puppet"
},
"messages": {
"message": "Finished catalog run in 1.81 seconds"
}
}
}
],
"reported_at": "2012-05-28T11:07:02Z",
"metrics": {
"time": {
"schedule": 0.001669,
"config_retrieval": 1.55911207199097,
"package": 0.006316,
"exec": 0.329731,
"total": 2.95773607199097,
"cron": 0.000795,
"service": 0.56894,
"mailalias": 0.000378,
"filebucket": 0.000226,
"group": 0.001368,
"yumrepo": 0.005424,
"file": 0.479179,
"user": 0.004598
},
"changes": {
"total": 1
},
"events": {
"success": 1,
"total": 1
},
"resources": {
"changed": 1,
"out_of_sync": 1,
"total": 75
}
}
}
}