Werk #16210: folder_config: Prevent unintentional deletion of a non-empty folder
Component | REST API | ||||||
Title | folder_config: Prevent unintentional deletion of a non-empty folder | ||||||
Date | Jan 11, 2024 | ||||||
Level | Trivial Change | ||||||
Class | Bug Fix | ||||||
Compatibility | Incompatible - Manual interaction might be required | ||||||
Checkmk versions & editions |
|
Prior to this Werk, the REST API could delete non-empty folders without any further check. With this Werk, the endpoint now accepts the delete_method query parameter. The possible values are: - recursive: Deletes the folder and all the elements it contains. - abort_on_nonempty: Deletes the folder only if it is not empty
If no delete_method is provided, recursive is asumed and the behaviour is the same as before this Werk.
The enpoint will return a 409 status code when trying to delete a folder that contains hosts, rules, subfolders or is referenced by another object.
Use example:
curl -X 'DELETE' 'http://example.com/my_site/check_mk/api/1.0/objects/folder_config/my_folder?delete_metod=abort_on_nonempty' -H 'accept: */*