core/hmdl.schema.json

300 lines
6.1 KiB
JSON
Raw Normal View History

2022-11-29 23:53:14 +01:00
{
"$defs": {
"active": {
"type": "boolean"
},
"schedule": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"enum": [
"minutely",
"hourly",
"daily"
]
}
},
"required": [
"kind"
]
},
"notifications": {
"type": "array",
"item": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"const": "console"
},
"parameters": {
"type": "object",
"additionalProperties": false,
"properties": {
},
"required": [
]
}
},
"required": [
"kind",
"parameters"
]
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"const": "email"
},
"parameters": {
"type": "object",
"additionalProperties": false,
"properties": {
"access": {
"type": "object",
"additionalProperties": false,
"properties": {
"host": {
"type": "string"
},
"port": {
"type": "integer"
},
"username": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": [
"host",
"port",
"username",
"password"
]
},
"sender": {
"type": "string"
},
"receivers": {
"type": "array",
"item": {
"type": "string"
}
},
"tags": {
"description": "list of strings, which will be placed in the e-mail subject",
"type": "array",
"item": {
"type": "string"
},
"default": []
}
},
"required": [
"access",
"sender",
"receivers"
]
}
},
"required": [
"kind",
"parameters"
]
}
]
},
"default": [
{
"kind": "console",
"parameters": {
}
}
]
}
},
"type": "object",
"additionalProperties": false,
"properties": {
"defaults": {
"description": "default values for checks",
"type": "object",
"additionalProperties": false,
"properties": {
"active": {
"$ref": "#/$defs/active"
},
"schedule": {
"$ref": "#/$defs/schedule"
},
"notifications": {
"$ref": "#/$defs/notifications"
}
},
"required": [
]
},
"checks": {
"type": "object",
"additionalProperties": {
"allOf": [
{
"description": "should represent a specific check",
"type": "object",
"additionalProperties": false,
"properties": {
"title": {
"type": "string"
},
"active": {
"$ref": "#/$defs/active"
},
"schedule": {
"$ref": "#/$defs/schedule"
},
"notifications": {
"$ref": "#/$defs/notifications"
}
},
"required": [
]
},
{
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"const": "script"
},
"parameters": {
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"type": "string"
},
"arguments": {
"type": "array",
"item": {
"type": "string"
}
}
},
"required": [
"path"
]
}
},
"required": [
"kind",
"parameters"
]
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"const": "http_request"
},
"parameters": {
"type": "object",
"additionalProperties": false,
"properties": {
"request": {
"type": "object",
"additionalProperties": false,
"properties": {
"target": {
"description": "URL",
"type": "string"
},
"method": {
"type": "string",
"enum": [
"GET",
"POST"
],
"default": "GET"
}
},
"required": [
"target"
]
},
"response": {
"type": "object",
"additionalProperties": false,
"properties": {
"status_code": {
"description": "checks whether the response status code is this",
"type": ["null", "integer"],
"default": 200
},
"headers": {
"description": "conjunctively checks header key-value pairs",
"type": "object",
"additionalProperties": {
"description": "header value",
"type": "string"
},
"properties": {
},
"required": [
],
"default": {}
},
"body_part": {
"description": "checks whether the response body contains this string",
"type": "string"
}
},
"required": [
]
},
"as_warning": {
"description": "whether a violation of this check shall be exposed as warning instead of critical; default: false",
"type": "boolean",
"default": false
}
},
"required": [
"request"
]
}
},
"required": [
"kind",
"parameters"
]
}
]
}
]
},
"properties": {
},
"required": [
]
}
},
"required": [
"defaults",
"groups"
]
}