Skip to main content

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

Body

required

    ruleId string

    ID of an existing rule to evaluate. Supply either this or rule.

    rule object

    Inline rule JSON (rule-engine format). Supply either this or ruleId.

Responses

Devices matching the rule, plus release context for policies

Schema

    matchingDevices

    object[]

    required

    Devices whose latest discovery data matched the rule

  • Array [

  • deviceId stringrequired

    Unique device identifier

    deviceName string

    Human-readable device name

    os string

    Operating system of the device

    ip string

    IP address of the device

    mac string

    MAC address of the device

    serialNumber string

    Serial number of the device

    platformName string

    Platform name the device belongs to

    deviceTypeNames string[]

    Device type names assigned to the device

    groupNames string[]

    Names of the groups the device belongs to

    discoveryMessageId string

    ID of the discovery message used to build the evaluation context for this device

  • ]

  • totalDevicesEvaluated numberrequired

    Total number of devices evaluated

    matchingCount numberrequired

    Number of devices that matched the rule

    attachedReleases

    object[]

    Releases the policy is attached to (only present for saved policy rules)

  • Array [

  • catalogId string

    Catalog ID of the release

    version string

    Version string of the release

    projectId string

    Project ID the release belongs to

    projectName string

    Project name the release belongs to

  • ]

Loading...