Werk #17508: REST-API: change DCD request and response types

Component REST API
Title REST-API: change DCD request and response types
Date Feb 23, 2025
Level Trivial Change
Class Bug Fix
Compatibility Incompatible - Manual interaction might be required
Checkmk versions & editions
2.5.0b1
Not yet released
Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.4.0b1 Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.3.0p28 Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

This werk changes the connector configuration for create and get DCD endpoints.

For the create request:

  1. the connector specific configuration is now nested under the connector key
  2. the validation for restrict_source_hosts and matching_hosts was changed to only allow valid regular expressions

Before:

{
    "title": "my-title",
    "site": "my-site",
    "dcd_id": "connection_1",
    "connector_type": "piggyback",
    // other connector keys, like interval, creation_rules etc.
}

After:

{
    "title": "my-title",
    "site": "my-site",
    "dcd_id": "connection_1",
    "connector": {
      "connector_type": "piggyback",
      // other connector keys, like interval, creation_rules etc.
    }
}

For the responses of both create and get endpoints, the schema was adjusted to reflect the create endpoint. It is also now correctly documented.

Before:

{
    // other keys omitted, as they didn't change
    "extensions": {
        "title": "my-title",
        "comment": "...",
        "docu_url": "...",
        "disabled": false,
        "site": "my-site",
        "connector": [
            "piggyback",
            {
                "source_filters": [
                    "some.+regex"
                ],
                "interval": 60.0,
                "creation_rules": [
                    {
                        "create_folder_path": "sub/folder",
                        "host_attributes": [
                            [
                                "tag_address_family",
                                "no-ip"
                            ]
                        ],
                        "delete_hosts": true,
                        "host_filters": [
                            "another.+regex"
                        ]
                    }
                ],
                "discover_on_creation": true,
                "no_deletion_time_after_init": 600.0,
                "max_cache_age": 3600.0,
                "validity_period": 60.0
            }
        ]
    }
}

After:

{
    // other keys omitted, as they didn't change
    "extensions": {
        "title": "my-title",
        "comment": "...",
        "documentation_url": "...", // renamed from docu_url
        "disabled": false,
        "site": "my-site",
        "connector": { // now an object, not an array
            "connector_type": "piggyback",
            "restrict_source_hosts": [ // renamed from source_filters
                "some.+regex"
            ],
            "interval": 60, // now an integer, not a float
            "creation_rules": [
                {
                    "folder_path": "/sub/folder", // renamed from create_folder_path
                    "host_attributes": { // now an object, not an array
                        "tag_address_family": "no-ip"
                    },
                    "delete_hosts": true,
                    "matching_hosts": [ // renamed from host_filters
                        "another.+regex"
                    ]
                }
            ],
            "discover_on_creation": true,
            "no_deletion_time_after_init": 600, // now an integer, not a float
            "max_cache_age": 3600, // now an integer, not a float
            "validity_period": 60 // now an integer, not a float
        }
    }
}

To the list of all Werks