pybackive/backive/config/schema.yml

91 lines
3.0 KiB
YAML

### backive config schema
#
#
definitions:
device_section:
type: object
patternProperties:
"^[^ \t/\\]+$":
# The pattern can be any name...
# "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$":
type: object
properties:
uuid:
type: string
mountname:
type: string
required:
- mountname
- uuid
additionalProperties: false
backup_section:
type: object
patternProperties:
"^[a-zA-Z0-9_-]+$":
type: object
properties:
user:
type: string
from:
type: string
# from directory
# from_remote:
# type: object
# properties:
# user:
# type: string
# password:
# type: string
# ssh_key_path:
# type: string
to:
type: string
# to directory
target_device:
type: string
# target device name
frequency:
# JUST DAYS!
type: integer
# other possibilities in the future
# weekly, biweekly, monthly, yearly
# 7d, 2w, 1m, 1y (this needs parser)
script:
type: string
# MVP just executes a script, nothing else
# scripts:
# type: array
# items:
# type: object
# properties:
# target:
# enum: [ "local", "remote" ]
# script:
# type: string
# execute: [ "before", "after" ]
# additionalProperties: false
# tool:
# type: object
required:
- target_device
- script
- frequency
additionalProperties: false
preferences_section:
type: object
properties:
mount_root:
type: string
pattern: "^(/[^/]+)+$"
additionalProperties: false
type: object
properties:
devices:
"$ref": "#:/definitions/device_section"
backups:
"$ref": "#:/definitions/backup_section"
preferences:
"$ref": "#:/definitions/preferences_section"