From 020846ebc83d10789f58051760d9827e40113262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fra=C3=9F?= Date: Mon, 5 Dec 2022 08:16:41 +0100 Subject: [PATCH] [sty] logic:conf --- source/logic/conf.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/source/logic/conf.py b/source/logic/conf.py index 942a69a..0b16ddd 100644 --- a/source/logic/conf.py +++ b/source/logic/conf.py @@ -1,7 +1,8 @@ def conf_schema_active(): return { + "description": "whether the check shall be executed", "type": "boolean", - "default": True + "default": True, } @@ -10,7 +11,7 @@ def conf_schema_threshold(): "description": "how often a condition has to occur in order to be reported", "type": "integer", "minimum": 1, - "default": 3 + "default": 3, } @@ -18,19 +19,20 @@ def conf_schema_annoy(): return { "description": "whether notifications shall be kept sending after the threshold has been surpassed", "type": "boolean", - "default": False + "default": False, } def conf_schema_interval(default): return { - "description": "in seconds or as text", "anyOf": [ { + "description": "in seconds", "type": "integer", - "exclusiveMinimum": 0 + "exclusiveMinimum": 0, }, { + "description": "as text", "type": "string", "enum": [ "minute", @@ -53,7 +55,7 @@ def conf_schema_schedule(): "attentive_interval": conf_schema_interval(60 * 2), }, "required": [ - ] + ], } @@ -77,7 +79,7 @@ def conf_schema_notifications(notification_channel_implementations): "required": [ "kind", "parameters" - ] + ], }, notification_channel_implementations.items() ) @@ -88,8 +90,8 @@ def conf_schema_notifications(notification_channel_implementations): "kind": "console", "parameters": { } - } - ] + }, + ], } @@ -110,7 +112,7 @@ def conf_schema_root(check_kind_implementations, notification_channel_implementa "notifications": conf_schema_notifications(notification_channel_implementations), }, "required": [ - ] + ], }, "checks": { "type": "array", @@ -135,7 +137,7 @@ def conf_schema_root(check_kind_implementations, notification_channel_implementa }, "required": [ "name", - ] + ], }, { "anyOf": list( @@ -153,7 +155,7 @@ def conf_schema_root(check_kind_implementations, notification_channel_implementa }, "required": [ "kind", - "parameters" + "parameters", ] }, check_kind_implementations.items()