PuppetDB 1 » Spec » Querying Facts
Querying facts occurs via an HTTP request to the
/facts REST endpoint.
Query format
Facts are queried by making a request to a URL in the following form:
The HTTP request must conform to the following format:
- The URL requested is
/facts/<node> - A
GETis used. - There is an
Acceptheader containingapplication/json.
The supplied <node> path component indicates the certname for which
facts should be retrieved.
Response format
{"name": "<node>",
"facts": {
"<fact name>": "<fact value>",
"<fact name>": "<fact value>",
...
}
}
If no facts are known for the supplied node, an HTTP 404 is returned.
Example
curl -H "Accept: application/json" 'http://localhost:8080/facts/<node>'
Where <node> is the name of the node from which you wish to retrieve facts.