The /fact-paths endpoint retrieves the set of all known fact paths for all known nodes, and is intended with the introduction of structured facts as the successor to the fact-names endpoint. The endpoint may be useful for building autocompletion in GUIs or for other applications that require a basic top-level view of fact paths. The fact-paths endpoint is not available for API versions 2 and 3.

Note: The v4 API is experimental and may change without notice. For stability, we recommend that you use the v3 API instead.

GET /fact-paths

This will return all fact paths matching the given query.

URL Parameters

  • query: Optional. A JSON array containing the query in prefix notation (["<OPERATOR>", "<FIELD>", "<VALUE>"]). See the sections below for the supported operators and fields. For general info about queries, see the page on query structure.

If a query parameter is not provided, all results will be returned.

Query Operators

See the Operators page.

Query Fields

  • path (path): the path associated with a fact node
  • type (string): the type of the value a the fact node

Response Format

Successful responses will be in application/json. Errors will be returned as non-JSON string.

The result will be a JSON array with one entry per certname. Each entry is of the form:

{
  "path": <fact-node path>
  "type": <fact-node type>
}

Examples

Using curl from localhost:

Get all fact paths that match the regex array query for paths related to partition sda3:

curl -X GET http://localhost:8080/v4/fact-paths --data-urlencode 'query=["~>", "path", ["partitions", "sda3.*", ".*"]]'

[ {
  "path" : [ "partitions", "sda3", "mount" ],
  "type" : "string"
}, {
  "path" : [ "partitions", "sda3", "size" ],
  "type" : "string"
}, {
  "path" : [ "partitions", "sda3", "uuid" ],
  "type" : "string"
} ]

Get all fact paths of integer type:

curl -X GET http://localhost:8080/v4/fact-paths --data-urlencode 'query=["=", "type", "integer"]'

[ {
  "path" : [ "blockdevice_sda_size" ],
  "type" : "integer"
}, {
  "path" : [ "uptime_days" ],
  "type" : "integer"
}, {
  "path" : [ "blockdevice_sdb_size" ],
  "type" : "integer"
}, {
  "path" : [ "uptime_seconds" ],
  "type" : "integer"
}, {
  "path" : [ "uptime_hours" ],
  "type" : "integer"
} ]

Paging

This query endpoint supports paged results via the common PuppetDB paging URL parameters. For more information, please see the documentation on paging.

Back to top
The page rank or the 1 our of 5 rating a user has given the page.
The email address of the user submitting feedback.
The URL of the page being ranked/rated.