turn telemetry and realtime filter into an enum

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2023-03-08 17:31:46 +01:00
parent 5517c1c7e0
commit 0f40765f2c
5 changed files with 81 additions and 3 deletions

View File

@@ -8,3 +8,17 @@ properties:
type: array
items:
type: string
enum:
- ssh
- health
- health.dns
- health.dhcp
- health.radius
- health.memory
- client
- client.join
- client.leave
- client.key-mismatch
- wifi
- wifi.start
- wifi.stop

View File

@@ -1,5 +1,5 @@
description:
Configure the unsolicitated telemetry stream.
Configure the unsolicited telemetry stream.
type: object
properties:
interval:
@@ -12,3 +12,17 @@ properties:
type: array
items:
type: string
enum:
- ssh
- health
- health.dns
- health.dhcp
- health.radius
- health.memory
- client
- client.join
- client.leave
- client.key-mismatch
- wifi
- wifi.start
- wifi.stop

View File

@@ -8520,6 +8520,9 @@ function instantiateMetricsTelemetry(location, value, errors) {
if (type(value) != "string")
push(errors, [ location, "must be of type string" ]);
if (!(value in [ "ssh", "health", "health.dns", "health.dhcp", "health.radius", "health.memory", "client", "client.join", "client.leave", "client.key-mismatch", "wifi", "wifi.start", "wifi.stop" ]))
push(errors, [ location, "must be one of \"ssh\", \"health\", \"health.dns\", \"health.dhcp\", \"health.radius\", \"health.memory\", \"client\", \"client.join\", \"client.leave\", \"client.key-mismatch\", \"wifi\", \"wifi.start\" or \"wifi.stop\"" ]);
return value;
}
@@ -8555,6 +8558,9 @@ function instantiateMetricsRealtime(location, value, errors) {
if (type(value) != "string")
push(errors, [ location, "must be of type string" ]);
if (!(value in [ "ssh", "health", "health.dns", "health.dhcp", "health.radius", "health.memory", "client", "client.join", "client.leave", "client.key-mismatch", "wifi", "wifi.start", "wifi.stop" ]))
push(errors, [ location, "must be one of \"ssh\", \"health\", \"health.dns\", \"health.dhcp\", \"health.radius\", \"health.memory\", \"client\", \"client.join\", \"client.leave\", \"client.key-mismatch\", \"wifi\", \"wifi.start\" or \"wifi.stop\"" ]);
return value;
}

View File

@@ -0,0 +1,14 @@
type: object
description:
This section contains info about connected mesh nodes.
properties:
destiination:
type: string
next_hop:
type: string
metric:
type: number
expire:
type: number
hop_count:
type: number

View File

@@ -3084,7 +3084,22 @@
"types": {
"type": "array",
"items": {
"type": "string"
"type": "string",
"enum": [
"ssh",
"health",
"health.dns",
"health.dhcp",
"health.radius",
"health.memory",
"client",
"client.join",
"client.leave",
"client.key-mismatch",
"wifi",
"wifi.start",
"wifi.stop"
]
}
}
}
@@ -3095,7 +3110,22 @@
"types": {
"type": "array",
"items": {
"type": "string"
"type": "string",
"enum": [
"ssh",
"health",
"health.dns",
"health.dhcp",
"health.radius",
"health.memory",
"client",
"client.join",
"client.leave",
"client.key-mismatch",
"wifi",
"wifi.start",
"wifi.stop"
]
}
}
}