Werk #16521: bi_rule: schema update to match the api docs

Component REST API
Title bi_rule: schema update to match the api docs
Date Feb 19, 2024
Level Trivial Change
Class Bug Fix
Compatibility Incompatible - Manual interaction might be required
Checkmk versions & editions
2.4.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.3.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

The Open API schema previously did not reflect the response or the request schema format that was required to create or show BI rules. This werk addresses this issue.

Previously, when creating or getting a BI rule, via the REST-API, the schema for host_label_groups or service_label_groups looked similar to the following:

    "host_label_groups": [
        [
            "and",
            [
                ["and", "mystery/switch:yes"],
                ["or", "mystery/switch:no"],
            ],
        ],
    ]

This did not match the schema documented in the Open API docs. To fix this, we have now changed the format to the following

    "host_label_groups": [
        {
            "operator": "and",
            "label_group": [
                {"operator": "and", "label": "mystery/switch:yes"},
                {"operator": "or", "label": "mystery/switch:no"},
            ],
        },
    ]

This also aligns with other endpoints that use our new host_label_groups or service_label_groups, for example the rules endpoints.

As this is a breaking change, user scripts should be adjusted accordingly.

To the list of all Werks