From c6d6bdc6f0b0653c249b3327ca67593e3feba99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fra=C3=9F?= Date: Mon, 12 Dec 2022 12:31:51 +0100 Subject: [PATCH] [doc] schema --- doc/hmdl.schema.json | 133 ++++++++++++------------------------------- 1 file changed, 37 insertions(+), 96 deletions(-) diff --git a/doc/hmdl.schema.json b/doc/hmdl.schema.json index 9f0aa70..0799977 100644 --- a/doc/hmdl.schema.json +++ b/doc/hmdl.schema.json @@ -8,6 +8,7 @@ "additionalProperties": false, "properties": { "active": { + "description": "whether the check shall be executed", "type": "boolean", "default": true }, @@ -27,13 +28,14 @@ "additionalProperties": false, "properties": { "regular_interval": { - "description": "in seconds or as text", "anyOf": [ { + "description": "in seconds", "type": "integer", "exclusiveMinimum": 0 }, { + "description": "as text", "type": "string", "enum": [ "minute", @@ -46,13 +48,14 @@ "default": 3600 }, "attentive_interval": { - "description": "in seconds or as text", "anyOf": [ { + "description": "in seconds", "type": "integer", "exclusiveMinimum": 0 }, { + "description": "as text", "type": "string", "enum": [ "minute", @@ -94,35 +97,6 @@ "parameters" ] }, - { - "title": "check kind 'file_touch'", - "type": "object", - "unevaluatedProperties": false, - "properties": { - "kind": { - "type": "string", - "enum": [ - "file_touch" - ] - }, - "parameters": { - "type": "object", - "additionalProperties": false, - "properties": { - "path": { - "type": "string" - } - }, - "required": [ - "path" - ] - } - }, - "required": [ - "kind", - "parameters" - ] - }, { "title": "check kind 'email'", "type": "object", @@ -247,6 +221,7 @@ "type": "string" }, "active": { + "description": "whether the check shall be executed", "type": "boolean", "default": true }, @@ -266,13 +241,14 @@ "additionalProperties": false, "properties": { "regular_interval": { - "description": "in seconds or as text", "anyOf": [ { + "description": "in seconds", "type": "integer", "exclusiveMinimum": 0 }, { + "description": "as text", "type": "string", "enum": [ "minute", @@ -285,13 +261,14 @@ "default": 3600 }, "attentive_interval": { - "description": "in seconds or as text", "anyOf": [ { + "description": "in seconds", "type": "integer", "exclusiveMinimum": 0 }, { + "description": "as text", "type": "string", "enum": [ "minute", @@ -333,35 +310,6 @@ "parameters" ] }, - { - "title": "check kind 'file_touch'", - "type": "object", - "unevaluatedProperties": false, - "properties": { - "kind": { - "type": "string", - "enum": [ - "file_touch" - ] - }, - "parameters": { - "type": "object", - "additionalProperties": false, - "properties": { - "path": { - "type": "string" - } - }, - "required": [ - "path" - ] - } - }, - "required": [ - "kind", - "parameters" - ] - }, { "title": "check kind 'email'", "type": "object", @@ -510,14 +458,14 @@ ] }, { - "title": "notification channel 'file_timestamp'", + "title": "notification channel 'file_state'", "type": "object", "unevaluatedProperties": false, "properties": { "kind": { "type": "string", "enum": [ - "file_timestamp" + "file_state" ] }, "parameters": { @@ -527,37 +475,30 @@ "path": { "type": "string" }, - "warning_age": { + "strict": { + "description": "whether a violation of this check shall be leveled as critical instead of concerning", + "type": "boolean", + "default": true + }, + "exist": { + "description": "whether the file is supposed to exist or not", + "type": "boolean", + "default": true + }, + "age_threshold": { + "description": "in seconds; ignored if 'exist' is set to false", + "type": [ + "null", + "integer" + ], + "exclusiveMinimum": 0, + "default": null + }, + "size_threshold": { + "description": "in bytes; ignored if 'exist' is set to false", "type": "integer", "exclusiveMinimum": 0, - "default": 3600 - }, - "critical_age": { - "type": "integer", - "exclusiveMinimum": 0, - "default": 86400 - }, - "condition_on_missing": { - "description": "which condition to report if file is missing", - "type": "string", - "enum": [ - "unknown", - "ok", - "warning", - "critical" - ], - "default": "warning" - }, - "condition_on_implausible": { - "description": "which condition to report if the age is negative, i.e. the file is apparently from the future", - "type": "string", - "enum": [ - "unknown", - "ok", - "warning", - "critical" - ], - "default": "warning" + "default": null } }, "required": [ @@ -636,10 +577,10 @@ }, "required": [] }, - "as_warning": { - "description": "whether a violation of this check shall be exposed as warning instead of critical; default: false", + "strict": { + "description": "whether a violation of this check shall be leveled as critical instead of concerning", "type": "boolean", - "default": false + "default": true } }, "required": [