Ask Your Question
0

API for getting node's status

asked 2015-05-25 06:29:32 -0500

Boris gravatar image

I would like to use REST API for getting status of nodes.

Here is the API documentation http://docs.puppetlabs.com/puppet/4.1/reference/httpapi/httpnode.html

How can I know what is the status of a node? Is it completed updating its state or not? Is there a way I can get an event when it's completed?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-05-25 10:49:04 -0500

csharpsteen gravatar image

The Node endpoint of the Puppet Master REST API returns static data that is used to compile catalogs for a given node name. The endpoint does not return any real-time information about nodes.

If you are storing Node information in PuppetDB, node status can be retrieved using the /nodes endpoint of that service:

http://docs.puppetlabs.com/puppetdb/2.3/api/query/v4/nodes.html

This endpoint will provide: the last timestamp a node successfully contacted the master and retrieved facts, the last timestamp the master successfully compiled a catalog for the node, and the last timestamp that the node submitted a report to the master after applying a catalog. The /reports endpoint can be used to determine the success or failure of a particular run.

For real-time information on the status of a node, you will need to use an orchestration framework. MCollective has a puppet-agent plugin that can return the status of the Puppet agent on nodes:

https://github.com/puppetlabs/mcollective-puppet-agent/tree/1.10.0#requesting-agent-status

The mco puppet status command will return information such as which nodes have the puppet service running and whether the puppet service is idling or applying a catalog.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-05-25 06:29:32 -0500

Seen: 360 times

Last updated: May 25 '15