PolicyRule

PolicyRule
PolicyRule

A compute policy rule that defines the criteria against which the policy will be evaluated for a VM. A PolicyRule can contain either a workloadPolicyRule or a list of nested PolicyRules combined with a boolean operator. The nested rules in the 'rules' field are evaluated using the boolean operation specified in the 'operator' field. The workloadPolicyRule is always AND'd together with the results of the nested rules.

JSON Example
{
    "operator": "string",
    "rules": [
        "PolicyRule Object"
    ],
    "workloadPolicyRule": {
        "guestOsRule": {
            "operator": "string",
            "value": "string"
        },
        "guestOsFamilyRule": {
            "operator": "string",
            "value": "string"
        },
        "labelSelectorRules": [
            {
                "operator": "string",
                "ruleKey": "string",
                "values": [
                    "string"
                ]
            }
        ]
    }
}
string
operator
Optional

The boolean operation used to evaluate the elements from the rules field. This field does not apply to the workloadPolicyRule field. The workloadPolicyRule is always AND'd together with the results of the rules field. If unset, defaults to AND.

array of PolicyRule
rules
Optional
Constraints: minItems: 0 maxItems: 128

A list of additional PolicyRules that are evaluated using the boolean operation specified in the operator field. If unset, no additional matching is performed.

workloadPolicyRule
Optional

A workload policy rule that defines the criteria for matching workloads. The workload policy rule is a composite rule that is used to match workloads based on the guest OS, guest OS family, and label selectors. All provided rules must match for the workload to be matched.