mirror of
https://github.com/Telecominfraproject/ols-ucentral-schema.git
synced 2026-01-27 10:21:47 +00:00
move health_check settings tp the metric deictionary
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -6,3 +6,7 @@
|
||||
|
||||
# Health configuration
|
||||
set ustats.health.interval={{ health.interval }}
|
||||
set ustats.health.dhcp_local={{ b(health.dhcp_local) }}
|
||||
set ustats.health.dhcp_remote={{ b(health.dhcp_remote) }}
|
||||
set ustats.health.dns_local={{ b(health.dns_local) }}
|
||||
set ustats.health.dns_remote={{ b(health.dns_remote) }}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{% if (!length(health_check))
|
||||
health_check = {
|
||||
dhcp_local: 1,
|
||||
dhcp_remote: 0,
|
||||
dns_local: 1,
|
||||
dns_remote: 1,
|
||||
};
|
||||
%}
|
||||
set health.config.dhcp_local={{ b(health_check.dhcp_local) }}
|
||||
set health.config.dhcp_remote={{ b(health_check.dhcp_remote) }}
|
||||
set health.config.dns_local={{ b(health_check.dns_local) }}
|
||||
set health.config.dns_remote={{ b(health_check.dns_remote) }}
|
||||
@@ -8,3 +8,23 @@ properties:
|
||||
The reporting interval defined in seconds.
|
||||
type: integer
|
||||
minimum: 60
|
||||
dhcp-local:
|
||||
description:
|
||||
This is makes the AP probe local downstream DHCP servers.
|
||||
type: boolean
|
||||
default: true
|
||||
dhcp-remote:
|
||||
description:
|
||||
This is makes the AP probe remote upstream DHCP servers.
|
||||
type: boolean
|
||||
default: false
|
||||
dns-local:
|
||||
description:
|
||||
This is makes the AP probe DNS servers.
|
||||
type: boolean
|
||||
default: true
|
||||
dns-remote:
|
||||
description:
|
||||
This is makes the AP probe DNS servers.
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
type: object
|
||||
description:
|
||||
This section can be used to setup the services that health check will probe.
|
||||
properties:
|
||||
dhcp-local:
|
||||
description:
|
||||
This is makes the AP probe local downstream DHCP servers.
|
||||
type: boolean
|
||||
default: true
|
||||
dhcp-remote:
|
||||
description:
|
||||
This is makes the AP probe remote upstream DHCP servers.
|
||||
type: boolean
|
||||
default: false
|
||||
dns-local:
|
||||
description:
|
||||
This is makes the AP probe DNS servers.
|
||||
type: boolean
|
||||
default: true
|
||||
dns-remote:
|
||||
description:
|
||||
This is makes the AP probe DNS servers.
|
||||
type: boolean
|
||||
default: true
|
||||
@@ -37,7 +37,5 @@ properties:
|
||||
$ref: "https://ucentral.io/schema/v1/service/airtime-fairness/"
|
||||
wireguard-overlay:
|
||||
$ref: 'https://ucentral.io/schema/v1/service/wireguard-overlay/'
|
||||
health-check:
|
||||
$ref: 'https://ucentral.io/schema/v1/service/health-check/'
|
||||
captive:
|
||||
$ref: 'https://ucentral.io/schema/v1/service/captive/'
|
||||
|
||||
129
schemareader.uc
129
schemareader.uc
@@ -7220,75 +7220,6 @@ function instantiateServiceWireguardOverlay(location, value, errors) {
|
||||
return value;
|
||||
}
|
||||
|
||||
function instantiateServiceHealthCheck(location, value, errors) {
|
||||
if (type(value) == "object") {
|
||||
let obj = {};
|
||||
|
||||
function parseDhcpLocal(location, value, errors) {
|
||||
if (type(value) != "bool")
|
||||
push(errors, [ location, "must be of type boolean" ]);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
if (exists(value, "dhcp-local")) {
|
||||
obj.dhcp_local = parseDhcpLocal(location + "/dhcp-local", value["dhcp-local"], errors);
|
||||
}
|
||||
else {
|
||||
obj.dhcp_local = true;
|
||||
}
|
||||
|
||||
function parseDhcpRemote(location, value, errors) {
|
||||
if (type(value) != "bool")
|
||||
push(errors, [ location, "must be of type boolean" ]);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
if (exists(value, "dhcp-remote")) {
|
||||
obj.dhcp_remote = parseDhcpRemote(location + "/dhcp-remote", value["dhcp-remote"], errors);
|
||||
}
|
||||
else {
|
||||
obj.dhcp_remote = false;
|
||||
}
|
||||
|
||||
function parseDnsLocal(location, value, errors) {
|
||||
if (type(value) != "bool")
|
||||
push(errors, [ location, "must be of type boolean" ]);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
if (exists(value, "dns-local")) {
|
||||
obj.dns_local = parseDnsLocal(location + "/dns-local", value["dns-local"], errors);
|
||||
}
|
||||
else {
|
||||
obj.dns_local = true;
|
||||
}
|
||||
|
||||
function parseDnsRemote(location, value, errors) {
|
||||
if (type(value) != "bool")
|
||||
push(errors, [ location, "must be of type boolean" ]);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
if (exists(value, "dns-remote")) {
|
||||
obj.dns_remote = parseDnsRemote(location + "/dns-remote", value["dns-remote"], errors);
|
||||
}
|
||||
else {
|
||||
obj.dns_remote = true;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
if (type(value) != "object")
|
||||
push(errors, [ location, "must be of type object" ]);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
function instantiateServiceCaptiveClick(location, value, errors) {
|
||||
if (type(value) == "object") {
|
||||
let obj = {};
|
||||
@@ -8060,10 +7991,6 @@ function instantiateService(location, value, errors) {
|
||||
obj.wireguard_overlay = instantiateServiceWireguardOverlay(location + "/wireguard-overlay", value["wireguard-overlay"], errors);
|
||||
}
|
||||
|
||||
if (exists(value, "health-check")) {
|
||||
obj.health_check = instantiateServiceHealthCheck(location + "/health-check", value["health-check"], errors);
|
||||
}
|
||||
|
||||
if (exists(value, "captive")) {
|
||||
obj.captive = instantiateServiceCaptive(location + "/captive", value["captive"], errors);
|
||||
}
|
||||
@@ -8153,6 +8080,62 @@ function instantiateMetricsHealth(location, value, errors) {
|
||||
obj.interval = parseInterval(location + "/interval", value["interval"], errors);
|
||||
}
|
||||
|
||||
function parseDhcpLocal(location, value, errors) {
|
||||
if (type(value) != "bool")
|
||||
push(errors, [ location, "must be of type boolean" ]);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
if (exists(value, "dhcp-local")) {
|
||||
obj.dhcp_local = parseDhcpLocal(location + "/dhcp-local", value["dhcp-local"], errors);
|
||||
}
|
||||
else {
|
||||
obj.dhcp_local = true;
|
||||
}
|
||||
|
||||
function parseDhcpRemote(location, value, errors) {
|
||||
if (type(value) != "bool")
|
||||
push(errors, [ location, "must be of type boolean" ]);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
if (exists(value, "dhcp-remote")) {
|
||||
obj.dhcp_remote = parseDhcpRemote(location + "/dhcp-remote", value["dhcp-remote"], errors);
|
||||
}
|
||||
else {
|
||||
obj.dhcp_remote = false;
|
||||
}
|
||||
|
||||
function parseDnsLocal(location, value, errors) {
|
||||
if (type(value) != "bool")
|
||||
push(errors, [ location, "must be of type boolean" ]);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
if (exists(value, "dns-local")) {
|
||||
obj.dns_local = parseDnsLocal(location + "/dns-local", value["dns-local"], errors);
|
||||
}
|
||||
else {
|
||||
obj.dns_local = true;
|
||||
}
|
||||
|
||||
function parseDnsRemote(location, value, errors) {
|
||||
if (type(value) != "bool")
|
||||
push(errors, [ location, "must be of type boolean" ]);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
if (exists(value, "dns-remote")) {
|
||||
obj.dns_remote = parseDnsRemote(location + "/dns-remote", value["dns-remote"], errors);
|
||||
}
|
||||
else {
|
||||
obj.dns_remote = true;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ cursor.load("health");
|
||||
cursor.load("dhcp");
|
||||
cursor.load("network");
|
||||
cursor.load("wireless");
|
||||
let config = cursor.get_all("health", "config");
|
||||
let config = cursor.get_all("ustats", "health");
|
||||
let dhcp = cursor.get_all("dhcp");
|
||||
let wifi_config = cursor.get_all("wireless");
|
||||
let wifi_state = require('wifi.iface');
|
||||
|
||||
@@ -2630,27 +2630,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"service.health-check": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"dhcp-local": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"dhcp-remote": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"dns-local": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"dns-remote": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"service.captive.click": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -2913,9 +2892,6 @@
|
||||
"wireguard-overlay": {
|
||||
"$ref": "#/$defs/service.wireguard-overlay"
|
||||
},
|
||||
"health-check": {
|
||||
"$ref": "#/$defs/service.health-check"
|
||||
},
|
||||
"captive": {
|
||||
"$ref": "#/$defs/service.captive"
|
||||
}
|
||||
@@ -2947,6 +2923,22 @@
|
||||
"interval": {
|
||||
"type": "integer",
|
||||
"minimum": 60
|
||||
},
|
||||
"dhcp-local": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"dhcp-remote": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"dns-local": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"dns-remote": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user