Werk #17580: activate_changes: add activation status to rest-api response
| Component | REST API | ||||
| Title | activate_changes: add activation status to rest-api response | ||||
| Date | Mar 4, 2025 | ||||
| Level | Trivial Change | ||||
| Class | New Feature | ||||
| Compatibility | Compatible - no manual interaction needed | ||||
| Checkmk versions & editions | 
 | 
We have introduced a new field 'status_per_site' to the response in two of our activation_run endpoints. This new field will hold a sequence of status objects, one for each site. This status object will include the phase, state, status_text, status_details, the site the activation was peformed on, the start time and the end time.
The endpoints affected are:
/domain-types/activation_run/collections/running /objects/activation_run/{activation_id}
Before:
{
    "links": [
        {
            "domainType": "link",
            "rel": "self",
            "href": "http://localhost/heute/check_mk/api/1.0/objects/activation_run/7fb1a830-66f4-4f9b-8afd-b69b8b0e0a41",
            "method": "GET",
            "type": "application/json"
        }
    ],
    "domainType": "activation_run",
    "id": "7fb1a830-66f4-4f9b-8afd-b69b8b0e0a41",
    "title": "Activation status: Complete.",
    "members": {},
    "extensions": {
        "sites": [
            "heute",
            "heute_remote_1",
            "heute_remote_2"
        ],
        "is_running": false,
        "force_foreign_changes": false,
        "time_started": "2025-03-06T15:29:11.593567+00:00",
        "changes": [
            {
                "id": "919869d4-2e6d-4053-a81b-e13db11eefe7",
                "user_id": "cmkadmin",
                "action_name": "edit-sites",
                "text": "Modified site connection heute",
                "time": "2025-03-06T15:28:17.326572+00:00"
            },
            {
                "id": "b9eca566-92ae-403a-8f79-b6e39edc8be1",
                "user_id": "cmkadmin",
                "action_name": "edit-sites",
                "text": "Modified site connection heute_remote_1",
                "time": "2025-03-06T15:28:22.478477+00:00"
            },
            {
                "id": "a1ea0f5e-91c5-4f09-93a7-7b35de186926",
                "user_id": "cmkadmin",
                "action_name": "edit-sites",
                "text": "Modified site connection heute_remote_2",
                "time": "2025-03-06T15:28:28.085627+00:00"
            }
        ]
    }
}
After:
{
    "links": [
        {
            "domainType": "link",
            "rel": "self",
            "href": "http://localhost/heute/check_mk/api/1.0/objects/activation_run/7fb1a830-66f4-4f9b-8afd-b69b8b0e0a41",
            "method": "GET",
            "type": "application/json"
        }
    ],
    "domainType": "activation_run",
    "id": "7fb1a830-66f4-4f9b-8afd-b69b8b0e0a41",
    "title": "Activation status: Complete.",
    "members": {},
    "extensions": {
        "sites": [
            "heute",
            "heute_remote_1",
            "heute_remote_2"
        ],
        "is_running": false,
        "force_foreign_changes": false,
        "time_started": "2025-03-06T15:29:11.593567+00:00",
        "changes": [
            {
                "id": "919869d4-2e6d-4053-a81b-e13db11eefe7",
                "user_id": "cmkadmin",
                "action_name": "edit-sites",
                "text": "Modified site connection heute",
                "time": "2025-03-06T15:28:17.326572+00:00"
            },
            {
                "id": "b9eca566-92ae-403a-8f79-b6e39edc8be1",
                "user_id": "cmkadmin",
                "action_name": "edit-sites",
                "text": "Modified site connection heute_remote_1",
                "time": "2025-03-06T15:28:22.478477+00:00"
            },
            {
                "id": "a1ea0f5e-91c5-4f09-93a7-7b35de186926",
                "user_id": "cmkadmin",
                "action_name": "edit-sites",
                "text": "Modified site connection heute_remote_2",
                "time": "2025-03-06T15:28:28.085627+00:00"
            }
        ],
        "status_per_site": [
            {
                "site": "heute",
                "phase": "done",
                "state": "success",
                "status_text": "Success",
                "status_details": "Started at: 16:29:11. Finished at: 16:29:11.",
                "start_time": "2025-03-06T15:29:11.801165+00:00",
                "end_time": "2025-03-06T15:29:11.846029+00:00"
            },
            {
                "site": "heute_remote_1",
                "phase": "done",
                "state": "success",
                "status_text": "Success",
                "status_details": "Started at: 16:29:11. Finished at: 16:29:13.",
                "start_time": "2025-03-06T15:29:11.801165+00:00",
                "end_time": "2025-03-06T15:29:13.288525+00:00"
            },
            {
                "site": "heute_remote_2",
                "phase": "done",
                "state": "success",
                "status_text": "Success",
                "status_details": "Started at: 16:29:11. Finished at: 16:29:13.",
                "start_time": "2025-03-06T15:29:11.801165+00:00",
                "end_time": "2025-03-06T15:29:13.288406+00:00"
            }
        ]
    }
}