Evaluate a rule against all devices
POST/api/v1/rules/evaluate
Tests a rule against every device using its latest discovery data. Supply either a saved ruleId or an inline rule JSON. For saved policy rules the response additionally contains the releases the policy is attached to.
Request
- application/json
Body
required
ID of an existing rule to evaluate. Supply either this or rule.
Inline rule JSON (rule-engine format). Supply either this or ruleId.
Responses
- 200
Devices matching the rule, plus release context for policies
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
Array [
]
matchingDevices
object[]
required
Devices whose latest discovery data matched the rule
Unique device identifier
Human-readable device name
Operating system of the device
IP address of the device
MAC address of the device
Serial number of the device
Platform name the device belongs to
Device type names assigned to the device
Names of the groups the device belongs to
ID of the discovery message used to build the evaluation context for this device
Total number of devices evaluated
Number of devices that matched the rule
attachedReleases
object[]
Releases the policy is attached to (only present for saved policy rules)
Catalog ID of the release
Version string of the release
Project ID the release belongs to
Project name the release belongs to
{
"matchingDevices": [
{
"deviceId": "string",
"deviceName": "string",
"os": "string",
"ip": "string",
"mac": "string",
"serialNumber": "string",
"platformName": "string",
"deviceTypeNames": [
"string"
],
"groupNames": [
"string"
],
"discoveryMessageId": "string"
}
],
"totalDevicesEvaluated": 0,
"matchingCount": 0,
"attachedReleases": [
{
"catalogId": "string",
"version": "string",
"projectId": "string",
"projectName": "string"
}
]
}