Werk #15677: downtimes: response with correct error message when host does not exist

Component REST API
Title downtimes: response with correct error message when host does not exist
Date Apr 14, 2023
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
2.3.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.2.0b5 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

This werk introduces a fix to the endpont

  • /domain-types/downtime/collections/host

Previously when you provided a host that didn't exist the response would be

{
  "title": "Bad Request",
  "status": 400,
  "detail": "These fields have problems: host_name",
  "fields": {
    "host_name": [
      "Host 'example.com' exists, but is not monitored. Activate the configuration?"
    ]
  }
}

we now reply with

{
  "title": "Bad Request",
  "status": 400,
  "detail": "These fields have problems: host_name",
  "fields": {
    "host_name": [
      "Host not found: 'example.com'"
    ]
  }
}

To the list of all Werks