i try to configure a downtime via API. example code below. does not show in webinterface. doesnt matter if duration flag is set or not.
Checkmk Enterprise Edition 2.1.0p24
import requests
import json
url = "https://monitoring.domain.local/regionen/check_mk/api/1.0/domain-types/downtime/collections/host"
payload = json.dumps({
"start_time": "2024-04-21T17:32:28Z",
"end_time": "2024-04-21T18:32:28Z",
"comment": "TEST",
"downtime_type": "host",
"host_name": "hostnameA"
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer api_user pass'
}
response = requests.request("POST", url, headers=headers, data=payload, verify=False)
print(response.status_code)
print(response.text)
http code: 204 (documentation says this is successfull)