Skip to content

Commit 4a34109

Browse files
committed
1 parent 7db3ec8 commit 4a34109

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

root/app/auto_uptime_kuma/uptime_kuma_service.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,15 @@ def get_monitor(self, container_name):
116116
return monitor
117117
return None
118118

119+
def validate_monitor_data(self, monitor_data):
120+
required_keys = ["type", "name", "url"]
121+
for key in required_keys:
122+
if key not in monitor_data:
123+
raise ValueError(f"Missing required monitor field: {key}")
124+
125+
if not isinstance(monitor_data.get("notificationIDList", []), list):
126+
raise ValueError("notificationIDList must be a list")
127+
119128
def monitor_exists(self, container_name):
120129
return self.get_monitor(container_name) is not None
121130

0 commit comments

Comments
 (0)