diff options
Diffstat (limited to 'src/home/config/validators/_validators.py')
-rw-r--r-- | src/home/config/validators/_validators.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/home/config/validators/_validators.py b/src/home/config/validators/_validators.py new file mode 100644 index 0000000..cddc1b0 --- /dev/null +++ b/src/home/config/validators/_validators.py @@ -0,0 +1,32 @@ +from ._util import validate + +__all__ = [ + 'linux_boards_validator' +] + + +def linux_boards_validator(data) -> None: + validate({ + 'type': 'dict', + 'valuesrules': { + 'type': 'dict', + 'schema': { + 'mdns': {'type': 'string', 'required': True}, + 'board': {'type': 'string', 'required': True}, + 'network': {'type': 'list', 'required': True, 'empty': False}, + 'ram': {'type': 'integer', 'required': True}, + 'ext_hdd': { + 'type': 'list', + 'schema': { + 'type': 'dict', + 'schema': { + 'mountpoint': {'type': 'string', 'required': True}, + 'size': {'type': 'integer', 'required': True} + } + }, + }, + 'services': {'type': 'list', 'empty': False}, + 'online': {'type': 'boolean', 'required': True} + } + } + }, data) |