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

Function validate_monitor

server/manage_api.py:74–79  ·  view source on GitHub ↗
(monitor, index=None)

Source from the content-addressed store, hash-verified

72
73
74def validate_monitor(monitor, index=None):
75 if not isinstance(monitor, dict):
76 raise ApiError(400, "monitor must be an object", {"index": index})
77 normalized = normalize_required_strings(monitor, ["name", "host", "type"], "monitor", index=index)
78 normalized["interval"] = normalize_int(normalized.get("interval"), "interval", index=index, default=600, min_value=1)
79 return normalized
80
81
82def validate_sslcert(sslcert, index=None):

Callers

nothing calls this directly

Calls 3

ApiErrorClass · 0.85
normalize_intFunction · 0.85

Tested by

no test coverage detected