chronos-exporter: adding a JSON schema
Change-Id: Ib42a5a8adfa1b4dd6c783a4a828fbd2b94f74fa0
diff --git a/chronos-exporter/Chart.yaml b/chronos-exporter/Chart.yaml
index 2c9d8ff..e1edb2a 100644
--- a/chronos-exporter/Chart.yaml
+++ b/chronos-exporter/Chart.yaml
@@ -7,7 +7,7 @@
description: Chronos Exporter
kubeVersion: ">=1.15.0"
type: application
-version: 0.0.2
+version: 0.0.3
appVersion: v0.0.2
keywords:
- aether
diff --git a/chronos-exporter/files/configs/config-schema.json b/chronos-exporter/files/configs/config-schema.json
new file mode 100644
index 0000000..8e5d45f
--- /dev/null
+++ b/chronos-exporter/files/configs/config-schema.json
@@ -0,0 +1,213 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "https://aetheropennetworking.org/roc/chronos-schema.json",
+ "title": "Chronos Config Schema",
+ "description": "A schema for validating the intermediate format for Chronos configuration",
+ "type": "object",
+ "properties": {
+ "sites": {
+ "description": "a collection of sites",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "site-id": {
+ "type": "string",
+ "pattern": "^([a-zA-Z0-9\\-\\.-])*$",
+ "minLength": 3
+ },
+ "display-name": {
+ "type": "string",
+ "maxLength": 50
+ },
+ "image": {
+ "type": "string"
+ },
+ "small-cells": {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "small-cell-id": {
+ "type": "string",
+ "pattern": "^([a-zA-Z0-9\\-\\.-])*$",
+ "minLength": 3
+ },
+ "display-name": {
+ "type": "string",
+ "maxLength": 50
+ }
+ },
+ "required": [
+ "small-cell-id",
+ "display-name"
+ ]
+ }
+ },
+ "slices": {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "slice-id": {
+ "type": "string",
+ "pattern": "^([a-zA-Z0-9\\-\\.-])*$",
+ "minLength": 3
+ },
+ "display-name": {
+ "type": "string",
+ "maxLength": 50
+ },
+ "device-groups": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "uniqueItems": true
+ }
+ },
+ "applications": {
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "device-groups": {
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "device-group-id": {
+ "type": "string",
+ "pattern": "^([a-zA-Z0-9\\-\\.-])*$",
+ "minLength": 3
+ },
+ "display-name": {
+ "type": "string",
+ "maxLength": 50
+ },
+ "devices": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "uniqueItems": true
+ }
+ }
+ },
+ "required": [
+ "device-group-id",
+ "display-name"
+ ]
+ }
+ },
+ "devices": {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "serial-number": {
+ "type": "string",
+ "pattern": "^([a-zA-Z0-9\\-\\.-])*$",
+ "minLength": 3
+ },
+ "imei": {
+ "type": "string",
+ "maxLength": 20
+ },
+ "display-name": {
+ "type": "string",
+ "maxLength": 50
+ },
+ "location": {
+ "type": "string",
+ "maxLength": 50
+ },
+ "type": {
+ "type": "string"
+ },
+ "sim": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "serial-number",
+ "imei",
+ "display-name",
+ "type"
+ ]
+ }
+ },
+ "sims": {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "iccid": {
+ "type": "string",
+ "pattern": "^([a-zA-Z0-9\\-\\.-])*$",
+ "minLength": 3
+ },
+ "display-name": {
+ "type": "string",
+ "maxLength": 50
+ }
+ },
+ "required": [
+ "iccid"
+ ]
+ }
+ }
+ },
+ "required": [
+ "site-id",
+ "small-cells",
+ "slices",
+ "device-groups",
+ "devices",
+ "sims"
+ ]
+ }
+ },
+ "applications": {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "application-id": {
+ "type": "string",
+ "pattern": "^([a-zA-Z0-9\\-\\.-])*$",
+ "minLength": 3
+ },
+ "display-name": {
+ "type": "string",
+ "maxLength": 50
+ }
+ },
+ "required": [
+ "application-id",
+ "display-name"
+ ]
+ }
+ }
+ },
+ "required": [
+ "sites",
+ "applications"
+ ]
+}
\ No newline at end of file
diff --git a/chronos-exporter/files/configs/demo-configuration.json b/chronos-exporter/files/configs/demo-configuration.json
index 389bb98..70c1d9f 100644
--- a/chronos-exporter/files/configs/demo-configuration.json
+++ b/chronos-exporter/files/configs/demo-configuration.json
@@ -28,6 +28,9 @@
"display-name": "Cameras Slice",
"device-groups": [
"cameras"
+ ],
+ "applications": [
+ "nvr"
]
},
{
@@ -178,5 +181,11 @@
}
]
}
+ ],
+ "applications": [
+ {
+ "application-id": "nvr-application",
+ "display-name": "Network Video Recorder"
+ }
]
}
\ No newline at end of file
diff --git a/chronos-umbrella/Chart.yaml b/chronos-umbrella/Chart.yaml
index 557791f..eefaa6a 100644
--- a/chronos-umbrella/Chart.yaml
+++ b/chronos-umbrella/Chart.yaml
@@ -7,7 +7,7 @@
description: Chronos Umbrella chart to deploy all Aether ROC
kubeVersion: ">=1.18.0"
type: application
-version: 0.0.2
+version: 0.0.3
appVersion: v0.0.0
keywords:
- aether
@@ -29,4 +29,4 @@
- name: chronos-exporter
condition: import.chronos-exporter.enabled
repository: "file://../chronos-exporter"
- version: 0.0.2
+ version: 0.0.3