Werk #16722: Remove unneeded fields when creating a site conection

Component REST API
Title Remove unneeded fields when creating a site conection
Date Dec 27, 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.0p26 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

When creating a site with configuration replication disabled, many unneeded fields were mandatory. This change fixes that, and the user should update the configuration_connection attribute as follows to create or update a site without configuration replication:

  "configuration_connection" : {
     "enable_replication": false
  }

Prior to this change, the following is a typical payload for adding a remote site without configuration replication:

{
    "basic_settings": {
        "alias": "Remote site 1",
        "site_id": "site_id_1"
    },
    "status_connection": {...},
        "connect_timeout": 2,
        "persistent_connection": false,
        "url_prefix": "/remote_site_1/",
        "status_host": {"status_host_set": "disabled"},
        "disable_in_status_gui": false
    },
    "configuration_connection": {
        "enable_replication": false,
        "url_of_remote_site": "http://localhost/remote_site_1/check_mk/",
        "disable_remote_configuration": true,
        "ignore_tls_errors": false,
        "direct_login_to_web_gui_allowed": true,
        "user_sync": {
            "sync_with_ldap_connections": "all"
        },
        "replicate_event_console": true,
        "replicate_extensions": true,
        "message_broker_port": 5672
    }
}

After this change, the previous payload should be updated to this one:

{
    "basic_settings": {
        "alias": "Remote site 1",
        "site_id": "site_id_1"
    },
    "status_connection": {...},
        "connect_timeout": 2,
        "persistent_connection": false,
        "url_prefix": "/remote_site_1/",
        "status_host": {"status_host_set": "disabled"},
        "disable_in_status_gui": false
    },
    "configuration_connection": {
        "enable_replication": false,
    }
}

To the list of all Werks