mirror of
https://github.com/MatMoul/dokytree.git
synced 2025-11-20 22:42:05 +00:00
Inital commit
This commit is contained in:
52
samples/it_v1/schemas_builder/build.sh
Executable file
52
samples/it_v1/schemas_builder/build.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare -r PARTDIR=./parts
|
||||
declare -r SCHEMADIR=../schemas
|
||||
declare -r OBJECTSDIR=./objects
|
||||
|
||||
getSchemaHeader() {
|
||||
local DOC="{\n"
|
||||
DOC+="\t\""'$schema'"\": \"http://json-schema.org/draft-07/schema#\",\n"
|
||||
DOC+="\t\"title\": \"YAML Schema for computer\",\n"
|
||||
DOC+="\t\"type\": \"object\",\n"
|
||||
DOC+="\t\"additionalProperties\": false,\n"
|
||||
DOC+="\t\"properties\": {\n"
|
||||
echo -e "${DOC}"
|
||||
}
|
||||
getSchemaFooter() {
|
||||
local DOC+="\t}\n"
|
||||
DOC+="}\n"
|
||||
echo -e "${DOC}"
|
||||
}
|
||||
getPart() {
|
||||
local -r PARTFILE=${PARTDIR}/${1}.json
|
||||
if [ ! -f "${PARTFILE}" ]; then
|
||||
echo "${PARTFILE} not found"
|
||||
exit 1
|
||||
fi
|
||||
tail -n +4 "${PARTFILE}" | head -n -2
|
||||
}
|
||||
|
||||
buildObject() {
|
||||
local -r OBJECTFILE=${1}
|
||||
local DOC=$(getSchemaHeader)"\n"
|
||||
|
||||
while IFS= read -r LINE; do
|
||||
if [[ ! $LINE =~ ^[[:space:]]*\#.*$ ]]; then
|
||||
if [ -f ${PARTDIR}/"${LINE}".json ]; then
|
||||
DOC+=$(getPart "${LINE}")",\n"
|
||||
else
|
||||
echo "Error: Part not found : ${LINE} in ${OBJECTFILE}"
|
||||
fi
|
||||
fi
|
||||
done < "${OBJECTFILE}"
|
||||
DOC="${DOC::-3}\n"
|
||||
|
||||
DOC+=$(getSchemaFooter)
|
||||
local SCHEMAFILE=${SCHEMADIR}/$(basename "${OBJECTFILE}").json
|
||||
echo -e "${DOC}" > "${SCHEMAFILE}"
|
||||
}
|
||||
|
||||
for OBJECTFILE in "${OBJECTSDIR}"/*; do
|
||||
buildObject "${OBJECTFILE}"
|
||||
done
|
||||
6
samples/it_v1/schemas_builder/objects/_index
Normal file
6
samples/it_v1/schemas_builder/objects/_index
Normal file
@@ -0,0 +1,6 @@
|
||||
index
|
||||
title
|
||||
book
|
||||
toc
|
||||
templates
|
||||
files
|
||||
4
samples/it_v1/schemas_builder/objects/ad_acls
Normal file
4
samples/it_v1/schemas_builder/objects/ad_acls
Normal file
@@ -0,0 +1,4 @@
|
||||
todo
|
||||
name
|
||||
ad_acls
|
||||
files
|
||||
4
samples/it_v1/schemas_builder/objects/ad_dfs
Normal file
4
samples/it_v1/schemas_builder/objects/ad_dfs
Normal file
@@ -0,0 +1,4 @@
|
||||
todo
|
||||
name
|
||||
ad_dfs
|
||||
files
|
||||
4
samples/it_v1/schemas_builder/objects/ad_domain
Normal file
4
samples/it_v1/schemas_builder/objects/ad_domain
Normal file
@@ -0,0 +1,4 @@
|
||||
todo
|
||||
name
|
||||
ad_domain
|
||||
files
|
||||
4
samples/it_v1/schemas_builder/objects/ad_shares
Normal file
4
samples/it_v1/schemas_builder/objects/ad_shares
Normal file
@@ -0,0 +1,4 @@
|
||||
todo
|
||||
name
|
||||
ad_shares
|
||||
files
|
||||
4
samples/it_v1/schemas_builder/objects/ad_usergroups
Normal file
4
samples/it_v1/schemas_builder/objects/ad_usergroups
Normal file
@@ -0,0 +1,4 @@
|
||||
todo
|
||||
name
|
||||
ad_usergroups
|
||||
files
|
||||
11
samples/it_v1/schemas_builder/objects/computer
Normal file
11
samples/it_v1/schemas_builder/objects/computer
Normal file
@@ -0,0 +1,11 @@
|
||||
todo
|
||||
name
|
||||
computer_type
|
||||
# computer_roles
|
||||
model
|
||||
computer_os
|
||||
location
|
||||
interfaces
|
||||
maintenance_updates
|
||||
maintenance_backups
|
||||
files
|
||||
11
samples/it_v1/schemas_builder/objects/netdev
Normal file
11
samples/it_v1/schemas_builder/objects/netdev
Normal file
@@ -0,0 +1,11 @@
|
||||
todo
|
||||
name
|
||||
netdev_type
|
||||
netdev_roles
|
||||
model
|
||||
netdev_os
|
||||
location
|
||||
interfaces
|
||||
maintenance_updates
|
||||
maintenance_backups
|
||||
files
|
||||
9
samples/it_v1/schemas_builder/objects/printer
Normal file
9
samples/it_v1/schemas_builder/objects/printer
Normal file
@@ -0,0 +1,9 @@
|
||||
todo
|
||||
name
|
||||
printer_type
|
||||
model
|
||||
location
|
||||
interfaces
|
||||
maintenance_updates
|
||||
maintenance_backups
|
||||
files
|
||||
3
samples/it_v1/schemas_builder/objects/secrets
Normal file
3
samples/it_v1/schemas_builder/objects/secrets
Normal file
@@ -0,0 +1,3 @@
|
||||
todo
|
||||
name
|
||||
secrets
|
||||
11
samples/it_v1/schemas_builder/objects/server
Normal file
11
samples/it_v1/schemas_builder/objects/server
Normal file
@@ -0,0 +1,11 @@
|
||||
todo
|
||||
name
|
||||
server_type
|
||||
server_roles
|
||||
model
|
||||
server_os
|
||||
location
|
||||
interfaces
|
||||
maintenance_updates
|
||||
maintenance_backups
|
||||
files
|
||||
5
samples/it_v1/schemas_builder/objects/software
Normal file
5
samples/it_v1/schemas_builder/objects/software
Normal file
@@ -0,0 +1,5 @@
|
||||
todo
|
||||
name
|
||||
software
|
||||
urls
|
||||
files
|
||||
4
samples/it_v1/schemas_builder/objects/subnet
Normal file
4
samples/it_v1/schemas_builder/objects/subnet
Normal file
@@ -0,0 +1,4 @@
|
||||
todo
|
||||
subnet_name
|
||||
subnet
|
||||
files
|
||||
9
samples/it_v1/schemas_builder/objects/voipdev
Normal file
9
samples/it_v1/schemas_builder/objects/voipdev
Normal file
@@ -0,0 +1,9 @@
|
||||
todo
|
||||
name
|
||||
voipdev_type
|
||||
model
|
||||
location
|
||||
interfaces
|
||||
maintenance_updates
|
||||
maintenance_backups
|
||||
files
|
||||
4
samples/it_v1/schemas_builder/objects/wifi
Normal file
4
samples/it_v1/schemas_builder/objects/wifi
Normal file
@@ -0,0 +1,4 @@
|
||||
todo
|
||||
subnet_name
|
||||
wifi
|
||||
files
|
||||
48
samples/it_v1/schemas_builder/parts/ad_acls.json
Normal file
48
samples/it_v1/schemas_builder/parts/ad_acls.json
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"folders": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"properties": {
|
||||
"path": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"acls": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"access": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''",
|
||||
"'RO'",
|
||||
"'RW'",
|
||||
"'traversal'",
|
||||
"'DENY'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
51
samples/it_v1/schemas_builder/parts/ad_dfs.json
Normal file
51
samples/it_v1/schemas_builder/parts/ad_dfs.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"path": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"targets": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
},
|
||||
"folders": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"targets": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
46
samples/it_v1/schemas_builder/parts/ad_domain.json
Normal file
46
samples/it_v1/schemas_builder/parts/ad_domain.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"dc": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"fsmo": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''",
|
||||
"'all'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"servers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
37
samples/it_v1/schemas_builder/parts/ad_shares.json
Normal file
37
samples/it_v1/schemas_builder/parts/ad_shares.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"fileshares": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"printshares": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
samples/it_v1/schemas_builder/parts/ad_usergroups.json
Normal file
21
samples/it_v1/schemas_builder/parts/ad_usergroups.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"usergroups": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
6
samples/it_v1/schemas_builder/parts/book.json
Normal file
6
samples/it_v1/schemas_builder/parts/book.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"book": { "type": "boolean" }
|
||||
}
|
||||
}
|
||||
26
samples/it_v1/schemas_builder/parts/computer_os.json
Normal file
26
samples/it_v1/schemas_builder/parts/computer_os.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"os": {
|
||||
"type": "string",
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{"enum": [
|
||||
"''",
|
||||
"'Windows XP Home'",
|
||||
"'Windows XP Pro'",
|
||||
"'Windows Vista Home'",
|
||||
"'Windows Vista Pro'",
|
||||
"'Windows 7 Home'",
|
||||
"'Windows 7 Pro'",
|
||||
"'Windows 8 Home'",
|
||||
"'Windows 8 Pro'",
|
||||
"'Windows 10 Home'",
|
||||
"'Windows 10 Pro'",
|
||||
"'Windows 11 Home'",
|
||||
"'Windows 11 Pro'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
20
samples/it_v1/schemas_builder/parts/computer_type.json
Normal file
20
samples/it_v1/schemas_builder/parts/computer_type.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'notebook'",
|
||||
"'rack'",
|
||||
"'slim'",
|
||||
"'small'",
|
||||
"'tower'",
|
||||
"'vm'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
38
samples/it_v1/schemas_builder/parts/files.json
Normal file
38
samples/it_v1/schemas_builder/parts/files.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"headfiles": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
},
|
||||
"footfiles": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
6
samples/it_v1/schemas_builder/parts/index.json
Normal file
6
samples/it_v1/schemas_builder/parts/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"index": { "type": "integer" }
|
||||
}
|
||||
}
|
||||
63
samples/it_v1/schemas_builder/parts/interfaces.json
Normal file
63
samples/it_v1/schemas_builder/parts/interfaces.json
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"interfaces": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"anyOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''",
|
||||
"'LAN'",
|
||||
"'WIFI'",
|
||||
"'WAN'",
|
||||
"'VPN'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"ip": {
|
||||
"anyOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"mask": {
|
||||
"anyOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''",
|
||||
"'255.255.255.0'",
|
||||
"'255.255.0.0'",
|
||||
"'255.0.0.0'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"gw": {
|
||||
"anyOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"dns": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
13
samples/it_v1/schemas_builder/parts/location.json
Normal file
13
samples/it_v1/schemas_builder/parts/location.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"location": {
|
||||
"anyOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
86
samples/it_v1/schemas_builder/parts/maintenance_backups.json
Normal file
86
samples/it_v1/schemas_builder/parts/maintenance_backups.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"backups": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'none'",
|
||||
"'hypervisor'",
|
||||
"'windowsbackup'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"method": {
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'auto'",
|
||||
"'manual'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"frequency": {
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'daily'",
|
||||
"'weekly'",
|
||||
"'monthly'",
|
||||
"'quarterly'",
|
||||
"'halfyearly'",
|
||||
"'yearly'",
|
||||
"'monday'",
|
||||
"'tuesday'",
|
||||
"'wednesday'",
|
||||
"'thursday'",
|
||||
"'friday'",
|
||||
"'saturday'",
|
||||
"'sonday'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"target": {
|
||||
"anyOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''",
|
||||
"'usb'",
|
||||
"'pbs'",
|
||||
"'share'",
|
||||
"'iscsi'",
|
||||
"'cloud'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"time": {
|
||||
"anyOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''",
|
||||
"'auto'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"duration": {
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "type": "integer" },
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
72
samples/it_v1/schemas_builder/parts/maintenance_updates.json
Normal file
72
samples/it_v1/schemas_builder/parts/maintenance_updates.json
Normal file
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"updates": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'os'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"method": {
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'auto'",
|
||||
"'manual'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"frequency": {
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'auto'",
|
||||
"'daily'",
|
||||
"'weekly'",
|
||||
"'monthly'",
|
||||
"'quarterly'",
|
||||
"'halfyearly'",
|
||||
"'yearly'",
|
||||
"'monday'",
|
||||
"'tuesday'",
|
||||
"'wednesday'",
|
||||
"'thursday'",
|
||||
"'friday'",
|
||||
"'saturday'",
|
||||
"'sonday'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"time": {
|
||||
"anyOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''",
|
||||
"'auto'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"duration": {
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "type": "integer" },
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
13
samples/it_v1/schemas_builder/parts/model.json
Normal file
13
samples/it_v1/schemas_builder/parts/model.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"model": {
|
||||
"anyOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
13
samples/it_v1/schemas_builder/parts/name.json
Normal file
13
samples/it_v1/schemas_builder/parts/name.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"name": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
16
samples/it_v1/schemas_builder/parts/netdev_os.json
Normal file
16
samples/it_v1/schemas_builder/parts/netdev_os.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"os": {
|
||||
"type": "string",
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{"enum": [
|
||||
"''",
|
||||
"'Linux'",
|
||||
"'Debian'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
21
samples/it_v1/schemas_builder/parts/netdev_roles.json
Normal file
21
samples/it_v1/schemas_builder/parts/netdev_roles.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"roles": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'DHCP'",
|
||||
"'DNS'",
|
||||
"'VPN'",
|
||||
"'Firewall'",
|
||||
"'Router'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
samples/it_v1/schemas_builder/parts/netdev_type.json
Normal file
18
samples/it_v1/schemas_builder/parts/netdev_type.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'box'",
|
||||
"'rack'",
|
||||
"'wall'",
|
||||
"'ceiling'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
17
samples/it_v1/schemas_builder/parts/printer_type.json
Normal file
17
samples/it_v1/schemas_builder/parts/printer_type.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'printer'",
|
||||
"'mfc'",
|
||||
"'large printer'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
67
samples/it_v1/schemas_builder/parts/secrets.json
Normal file
67
samples/it_v1/schemas_builder/parts/secrets.json
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"secrets": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"'ad'",
|
||||
"'https'",
|
||||
"'ssh'",
|
||||
"'user'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"user": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"password": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"mfa": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''",
|
||||
"'totp'",
|
||||
"'sms'",
|
||||
"'e-mail'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"value": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
28
samples/it_v1/schemas_builder/parts/server_os.json
Normal file
28
samples/it_v1/schemas_builder/parts/server_os.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"os": {
|
||||
"type": "string",
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{"enum": [
|
||||
"''",
|
||||
"'Windows 2000'",
|
||||
"'Windows 2003'",
|
||||
"'Windows 2008'",
|
||||
"'Windows 2008 R2'",
|
||||
"'Windows 2012'",
|
||||
"'Windows 2012 R2'",
|
||||
"'Windows 2016'",
|
||||
"'Windows 2019'",
|
||||
"'Windows 2021'",
|
||||
"'Debian'",
|
||||
"'Debian / Proxmox VE'",
|
||||
"'Debian / Proxmox BS'",
|
||||
"'FreeBSD / OPNSense'",
|
||||
"'FreeBSD / pfSense'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
26
samples/it_v1/schemas_builder/parts/server_roles.json
Normal file
26
samples/it_v1/schemas_builder/parts/server_roles.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"roles": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'DHCP'",
|
||||
"'DNS'",
|
||||
"'VPN'",
|
||||
"'Firewall'",
|
||||
"'DC'",
|
||||
"'File Server'",
|
||||
"'Print Server'",
|
||||
"'App Server'",
|
||||
"'Backup Server'",
|
||||
"'Hypervisor'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
samples/it_v1/schemas_builder/parts/server_type.json
Normal file
18
samples/it_v1/schemas_builder/parts/server_type.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'mini'",
|
||||
"'rack'",
|
||||
"'tower'",
|
||||
"'vm'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
22
samples/it_v1/schemas_builder/parts/software.json
Normal file
22
samples/it_v1/schemas_builder/parts/software.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"publisher": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"licenses": {
|
||||
"oneOf": [
|
||||
{"type": "integer"},
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
87
samples/it_v1/schemas_builder/parts/subnet.json
Normal file
87
samples/it_v1/schemas_builder/parts/subnet.json
Normal file
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"subnet": {
|
||||
"type": "string",
|
||||
"oneOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'192.168.0.0/24'",
|
||||
"'192.168.1.0/24'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"gw": {
|
||||
"oneOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'192.168.0.1'",
|
||||
"'192.168.1.1'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"dns": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'192.168.0.1'",
|
||||
"'192.168.1.1'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
},
|
||||
"vlans": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"dhcp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"server": {
|
||||
"oneOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'192.168.0.1'",
|
||||
"'192.168.1.1'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"ranges": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"properties": {
|
||||
"from": {
|
||||
"oneOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'192.168.0.20'",
|
||||
"'192.168.1.20'"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"to": {
|
||||
"oneOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'192.168.0.99'",
|
||||
"'192.168.1.99'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
28
samples/it_v1/schemas_builder/parts/subnet_name.json
Normal file
28
samples/it_v1/schemas_builder/parts/subnet_name.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"name": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''",
|
||||
"'LAN'",
|
||||
"'LAN01'",
|
||||
"'LAN02'",
|
||||
"'LAN03'",
|
||||
"'LAN04'",
|
||||
"'LAN06'",
|
||||
"'LAN07'",
|
||||
"'LAN08'",
|
||||
"'LAN09'",
|
||||
"'LAN10'",
|
||||
"'WAN'",
|
||||
"'WIFI'",
|
||||
"'GUEST'",
|
||||
"'DMZ'",
|
||||
"'VPN'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
26
samples/it_v1/schemas_builder/parts/templates.json
Normal file
26
samples/it_v1/schemas_builder/parts/templates.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"templates": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"node": {
|
||||
"anyOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
13
samples/it_v1/schemas_builder/parts/title.json
Normal file
13
samples/it_v1/schemas_builder/parts/title.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"title": {
|
||||
"anyOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
6
samples/it_v1/schemas_builder/parts/toc.json
Normal file
6
samples/it_v1/schemas_builder/parts/toc.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"toc": { "type": "boolean" }
|
||||
}
|
||||
}
|
||||
31
samples/it_v1/schemas_builder/parts/todo.json
Normal file
31
samples/it_v1/schemas_builder/parts/todo.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"todo": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"msg": {
|
||||
"anyOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"priority": { "type": "integer" },
|
||||
"duration": {
|
||||
"anyOf": [
|
||||
{"type": "integer"},
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
29
samples/it_v1/schemas_builder/parts/urls.json
Normal file
29
samples/it_v1/schemas_builder/parts/urls.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"urls": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"website": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"download": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
17
samples/it_v1/schemas_builder/parts/voipdev_type.json
Normal file
17
samples/it_v1/schemas_builder/parts/voipdev_type.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "enum": [
|
||||
"''",
|
||||
"'phone'",
|
||||
"'antenna'",
|
||||
"'gateway'"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
21
samples/it_v1/schemas_builder/parts/wifi.json
Normal file
21
samples/it_v1/schemas_builder/parts/wifi.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"ssid": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
},
|
||||
"key": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"enum": [
|
||||
"''"
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user