rules endpoint to translate a node group rule
condition into PuppetDB query syntax.
Translate a node group rule condition into PuppetDB query syntax.
When Forming node classifier API requests to this endpoint, the body must be a
JSON object describing a rule condition. The rule condition must be structured like
rule key for a node group object. To get examples of
rule keys, use the GET /v1/groups/<id>/rules endpoint.
You can append the optional
format parameter to the
end of the URI path to change the response format. The default value is
nodes. If you specify
the response returns classifier rules in a compatible dot notation format, instead of the PuppetDB
If you did not specify the
format in your request, or if you
format=nodes, then the response is a PuppetDB query string. You can use this query string
with nodes endpoint in PuppetDB to get a list of
nodes matching the rule condition.
If there is an error, Node classifier API errors provide error
information in the
Rules that use structured or trusted facts cannot be converted into PuppetDB queries, because PuppetDB does not yet support structured or trusted facts. If the rule can't be translated into a PuppetDB query, the server returns a 422 Unprocessable Entity untranslatable-rule response with a message describing why the rule can't be translated and a copy of your supplied rule.
- malformed-request: The rule is not valid JSON. The error response body contains a copy of your supplied rule.
schema-violation: The rule is valid JSON but the rule grammar
is incorrect. Refer to Forming node classifier API requests
for information about rule grammar. The
detailskey in the error response body describes the submitted rule object, the schema the object was expected to conform to, and how the submitted object failed to conform to the schema.