Branch: refs/heads/2.2.0
Home:
https://github.com/Checkmk/checkmk
Commit: 3756bafe0ecc927b8388bfc15173bac2fc8b4128
https://github.com/Checkmk/checkmk/commit/3756bafe0ecc927b8388bfc15173bac2f…
Author: Leonardo Petrora <leonardo.petrora(a)checkmk.com>
Date: 2023-08-17 (Thu, 17 Aug 2023)
Changed paths:
A .werks/16051
M cmk/gui/livestatus_utils/commands/comment.py
M cmk/gui/plugins/openapi/endpoints/comment/__init__.py
M cmk/gui/plugins/openapi/endpoints/comment/request_schemas.py
M cmk/gui/plugins/openapi/endpoints/comment/response_schemas.py
M tests/testlib/rest_api_client.py
M tests/unit/cmk/gui/plugins/openapi/test_service_and_host_comments.py
Log Message:
-----------
16051 FIX comments: add site property to the comments endpoints
This werk introduces several changes to the comments endpoints.
1. Comment IDs are integers beginning from 1, both for the main site & for
remote sites. This means that the same comment ID can exist on more than
one site at the same time. This caused problems when calling the DELETE
endpoint as we weren't sure which ID the client wanted to delete.
To get around this problem, we have introduced a mandatory "site_id" field
which the client has to specify when they want to delete a comment.
2. Like point 1, calling GET comment with only a comment ID could also cause
the same problem. Therefore we have also introduced the mandatory "site_id"
query parameter field here too.
3. Now that the site_id field is mandatory in both the DELETE and GET comment
endpoints, we now return the site_id field as a comment attribute in both the
show comment and show comments endpoints.
4. This last change introduces a new optional query parameter on the show
all comments endpoint. The client can now specify the site_id as a filter,
so that they can list all comments for a specific site.
Change-Id: I92c60a713b53f70593f0e0a1bfb1d0cd670d5d15