(watchdog, index=None)
| 90 | |
| 91 | |
| 92 | def validate_watchdog(watchdog, index=None): |
| 93 | if not isinstance(watchdog, dict): |
| 94 | raise ApiError(400, "watchdog must be an object", {"index": index}) |
| 95 | normalized = normalize_required_strings(watchdog, ["name", "rule"], "watchdog", index=index) |
| 96 | normalized["interval"] = normalize_int(normalized.get("interval"), "interval", index=index, default=600, min_value=1) |
| 97 | normalize_optional_string(normalized, "callback") |
| 98 | return normalized |
| 99 | |
| 100 | |
| 101 | COLLECTIONS = { |
nothing calls this directly
no test coverage detected