GET /inventory

Retrieve a list of all nodes connected to the Puppet Communications Protocol (PCP) broker.

Request format

When Forming orchestrator API requests to this endpoint, the request is a basic call, such as:

GET https://orchestrator.example.com:8143/orchestrator/v1/inventory

The GET /inventory endpoint does not support any parameters; however, as with other orchestrator API endpoints, you must provide authentication.

Response format

A successful response is a JSON object containing an array of nodes. The response uses the following keys to provide information about each node's PCP broker connection:

Key Definition
name The node's name.
connected The status of the connection between the node and the PCP broker, either true (connected) or false (disconnected).
broker The PCP broker the node is connected to. If connected is false, this key is empty or omitted.
timestamp The time when the node connected to the PCP broker. If connected is false, this key is empty or omitted.

For example, this response provides details about three nodes, one of which is currently disconnected:

{
  "items" : [
    {
      "name" : "node1.example.com",
      "connected" : true,
      "broker" : "pcp://broker1.example.com/server",
      "timestamp": "2016-010-22T13:36:41.449Z"
    },
    {
      "name" : "node2.example.com",
      "connected" : true,
      "broker" : "pcp://broker2.example.com/server",
      "timestamp" : "2016-010-22T13:39:16.377Z"
    },
    {
      "name" : "node3.example.com",
      "connected" : false
    }
  ]
}

Error responses

This endpoint's error responses follow the usual format for Orchestrator API error responses. The endpoint returns a 500 response if the PCP broker can't be reached.