Werk #22134: Service discovery: reject invalid target phases in the REST API
| Component | REST API | ||
| Title | Service discovery: reject invalid target phases in the REST API | ||
| Date | Sep 15, 2026 | ||
| Level | Trivial Change | ||
| Class | Bug Fix | ||
| Compatibility | Compatible - no manual interaction needed | ||
| Checkmk versions & editions |
|
The REST API endpoint that updates the discovery phase of a single service
accepted seventeen values for the target_phase field, but only four of them
name a phase a service can actually be moved to: monitored, undecided,
ignored and removed.
Sending any of the other thirteen values removed the service from monitoring and
still answered with 204 No Content, giving no sign that the requested phase did
not exist.
The endpoint now answers such a request with 400 Bad Request and leaves the
service unchanged. Only the four phases listed above are accepted.
For compatibility the thirteen values are still listed in version 1 of the REST API, so a request that uses one now receives a clear error naming the accepted phases. The next major version of the REST API offers only the four valid phases in this field.