So /hosts/FQDN/reports/last
gives me this:
{"report":
{"host":"FQDN",
"id":409,
"logs":[
{"log":{"messages":
{"message":"Finished catalog run in 3.25 seconds"},
"sources":{"source":"//FQDN/Puppet"}}},
{"log":{"messages":{"message":"Could not intern from pson: source '\"#<Puppet::Node:0x7f' not in PSON!"},
"sources":{"source":"//FQDN/Puppet"}}},
{"log":{"messages":{"message":"Unable to fetch my node definition, but the agent run will continue:"},
"sources":{"source":"//FQDN/Puppet"}}}],
"summary":"Success",
"status":{"skipped":6,
"failed_restarts":0,
"applied":0,
"pending":0,
"restarted":0,
"failed":0},
"reported_at":"2012-10-08T07:21:14Z",
"metrics":{"events":
{"total":0,
"success":0,
"failure":0},
"resources":
{"skipped":6,
"total":23,
"changed":0,
"out_of_sync":0,
"scheduled":0,
"failed_to_restart":0,
"restarted":0,
"failed":0},
"changes":{"total":0},
"time":{"total":4.13812288578796,
"config_retrieval":1.55275988578796,
"exec":0.409399,
"filebucket":0.000166,
"service":1.815179,
"file":0.355286,
"package":0.005333}}}}
Which is perhaps OK for the hosts that are already built. But it does not tell me whether the host is set to be built. If I click on build, all reports are deleted, and I don't even get the info above.
Here's what I wanted to do, may be that would serve as a use case: I want to schedule a periodic host rebuild task:
- Create an empty VM object in VMware
- Register in Foreman
- PXE boot
- Wait for the node to finish building
- Do something else with the built VM
So steps 1-3 are easy to implement, but I got stuck at checking when the build is completely finished. There are ways of doing that, but just having a simple API call that would tell me various states (Building, Active, No changes, etc) would be very helpful... :)