Traceback (most recent call last):
File "./cmk_rest_api.py", line 90, in <module>
raise RuntimeError(pprint.pformat(send.json()))
RuntimeError: {'detail': "Value ['cert', {'cert_days': [29, 14]}] is not allowed here.",
'status': 400,
'title': "Problem in (sub-)field 'mode_sel'"}
When I try to make an HTTP service rule with the REST API, this error occurs in the “value_raw” section. The string I use in this section is copy-pasted from another rule I read from the API, so it shouldn’t be wrong. I think it’s a bug in the API.
Thanks @paulr282 for taking the time to post after resolving your own issue. I just ran into the same thing today and your post allowed me to solve the problem quickly.
Personally I think this should be considered a bug in the API. In my opinion, the input and output formats should be the same. With that said, maybe there are reasons that they need to be different in this specific case.
Note also that the Export this rule for API link in the web UI does provide the correct format that uses round brackets.