ucentral-schema: add poe to the data model

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2020-11-28 13:08:24 +01:00
parent 86f19c550f
commit 42662a247f
5 changed files with 34 additions and 0 deletions

11
cfg/cfg_poe.uc Normal file
View File

@@ -0,0 +1,11 @@
{%
function generate_poe() {
local poe = {};
for (local k, v in cfg.poe.ports)
poe["port" + (k + 1)] = v;
uci_render("poe", { "poe": poe});
}
generate_poe();
%}

View File

@@ -10,6 +10,7 @@ yaml2json schema/ssh.yml ssh.schema
yaml2json schema/wifi-phy.yml wifi-phy.schema
yaml2json schema/wifi-ssid.yml wifi-ssid.schema
yaml2json schema/steer.yml steer.schema
yaml2json schema/poe.yml poe.schema
./merge-schema.py
mkdir -p docs
jsonschema2md ucentral.schema.json docs/ucentral-schema.md

View File

@@ -36,4 +36,5 @@ schema_merge("log", "log.schema")
schema_merge("ntp", "ntp.schema")
schema_merge("ssh", "ssh.schema")
schema_merge("steer", "steer.schema")
schema_merge("poe", "poe.schema")
schema_write()

11
schema/poe.yml Normal file
View File

@@ -0,0 +1,11 @@
type: object
properties:
poe:
description:
This Object allows you to en/disable PoE on a network port.
type: object
properties:
ports:
description:
This is an array of the PoE state of the ports. any value other than 0 will enable PoE on a port.
type: array

View File

@@ -464,6 +464,16 @@
"type": "string"
}
}
},
"poe": {
"description": "This Object allows you to en/disable PoE on a network port.",
"type": "object",
"properties": {
"ports": {
"description": "This is an array of the PoE state of the ports. any value other than 0 will enable PoE on a port.",
"type": "array"
}
}
}
}
}