MCPcopy Create free account
hub / github.com/cppla/ServerStatus / validate_watchdog

Function validate_watchdog

server/manage_api.py:92–98  ·  view source on GitHub ↗
(watchdog, index=None)

Source from the content-addressed store, hash-verified

90
91
92def 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
101COLLECTIONS = {

Callers

nothing calls this directly

Calls 4

ApiErrorClass · 0.85
normalize_intFunction · 0.85

Tested by

no test coverage detected