AETHER-2841 convert configuration to YAML
Change-Id: I7682081e26638249722c6467c74e255e20336821
diff --git a/chronos-exporter/Chart.yaml b/chronos-exporter/Chart.yaml
index e1edb2a..e222b9f 100644
--- a/chronos-exporter/Chart.yaml
+++ b/chronos-exporter/Chart.yaml
@@ -7,8 +7,8 @@
description: Chronos Exporter
kubeVersion: ">=1.15.0"
type: application
-version: 0.0.3
-appVersion: v0.0.2
+version: 0.0.4
+appVersion: v0.0.3
keywords:
- aether
- exporter
diff --git a/chronos-exporter/files/configs/README.md b/chronos-exporter/files/configs/README.md
new file mode 100644
index 0000000..80ade7a
--- /dev/null
+++ b/chronos-exporter/files/configs/README.md
@@ -0,0 +1,22 @@
+<!--
+SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org>
+
+SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+-->
+
+# Configuration
+
+This YAML file must be valid compared to the OpenAPI3 specification at
+https://github.com/onosproject/chronos-exporter/blob/master/api/config-openapi3.yaml
+
+When the file is loaded in to the `chronos-exporter` it is unmarshalled in
+to Go structs and then made available in JSON format at
+
+```bash
+curl http://localhost:2112/config
+```
+
+In a deployed `chronos-umbrella` this is available
+through a reverse proxy at
+
+http://localhost:8184/chronos-exporter/config
diff --git a/chronos-exporter/files/configs/config-schema.json b/chronos-exporter/files/configs/config-schema.json
deleted file mode 100644
index 8e5d45f..0000000
--- a/chronos-exporter/files/configs/config-schema.json
+++ /dev/null
@@ -1,213 +0,0 @@
-{
- "$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
deleted file mode 100644
index 70c1d9f..0000000
--- a/chronos-exporter/files/configs/demo-configuration.json
+++ /dev/null
@@ -1,191 +0,0 @@
-{
- "sites": [
- {
- "site-id": "freemont",
- "display-name": "Freemont, CA",
- "image": "https://en.wikipedia.org/wiki/File:Mission_Peak_over_Lake_Elizabeth,_in_Fremont,_California_(cropped).JPG",
- "small-cells": [
- {
- "small-cell-id": "freemont-sc-north",
- "display-name": "North Cell"
- },
- {
- "small-cell-id": "freemont-sc-south",
- "display-name": "South Cell"
- },
- {
- "small-cell-id": "freemont-sc-east",
- "display-name": "East Cell"
- },
- {
- "small-cell-id": "freemont-sc-west",
- "display-name": "West Cell"
- }
- ],
- "slices": [
- {
- "slice-id": "freemont-slice-cameras",
- "display-name": "Cameras Slice",
- "device-groups": [
- "cameras"
- ],
- "applications": [
- "nvr"
- ]
- },
- {
- "slice-id": "freemont-slice-phones",
- "display-name": "Phones Slice",
- "device-groups": [
- "phones"
- ]
- }
- ],
- "device-groups": [
- {
- "device-group-id": "phones",
- "display-name": "Phones group",
- "devices": [
- "752365A",
- "752908B"
- ]
- },
- {
- "device-group-id": "cameras",
- "display-name": "Cameras group",
- "devices": [
- "7568111",
- "7568112",
- "7568113",
- "7568114",
- "7568115",
- "7568116",
- "7568117"
- ]
- },
- {
- "device-group-id": "dg2",
- "display-name": "DG 2"
- }
- ],
- "devices": [
- {
- "serial-number": "752365A",
- "imei": "123-456-7891",
- "display-name": "Phone 1",
- "location": "Somewhere",
- "type": "Pixel 5 Phone",
- "sim": "123-456-789"
- },
- {
- "serial-number": "752908B",
- "imei": "123-456-7892",
- "display-name": "Phone 2",
- "location": "Somewhere",
- "type": "iPhone 11",
- "sim": "123-456-788"
- },
- {
- "serial-number": "7568111",
- "imei": "123-456-7893",
- "display-name": "Camera 1",
- "location": "Front entrance",
- "type": "Camera",
- "sim": "123-456-787"
- },
- {
- "serial-number": "7568112",
- "imei": "123-456-7894",
- "display-name": "Camera 2",
- "location": "South Gate",
- "type": "Camera",
- "sim": "123-456-786"
- },
- {
- "serial-number": "7568113",
- "imei": "123-456-7895",
- "display-name": "Camera 3",
- "location": "Store Room 1",
- "type": "Camera",
- "sim": "123-456-785"
- },
- {
- "serial-number": "7568114",
- "imei": "123-456-7896",
- "display-name": "Camera 4",
- "location": "Store Room 2",
- "type": "Camera",
- "sim": "123-456-784"
- },
- {
- "serial-number": "7568115",
- "imei": "123-456-7897",
- "display-name": "Camera 5",
- "location": "Corridor 1",
- "type": "Camera",
- "sim": "123-456-783"
- },
- {
- "serial-number": "7568116",
- "imei": "123-456-7898",
- "display-name": "Camera 6",
- "location": "Corridor 2",
- "type": "Camera",
- "sim": "123-456-782"
- },
- {
- "serial-number": "7568117",
- "imei": "123-456-7899",
- "display-name": "Camera 7",
- "location": "Atrium",
- "type": "Camera",
- "sim": "123-456-781"
- }
- ],
- "sims": [
- {
- "iccid": "123-456-789",
- "display-name": "Sim 9"
- },
- {
- "iccid": "123-456-788",
- "display-name": "Sim 8"
- },
- {
- "iccid": "123-456-787",
- "display-name": "Sim 7"
- },
- {
- "iccid": "123-456-786",
- "display-name": "Sim 6"
- },
- {
- "iccid": "123-456-785",
- "display-name": "Sim 5"
- },
- {
- "iccid": "123-456-784",
- "display-name": "Sim 4"
- },
- {
- "iccid": "123-456-783",
- "display-name": "Sim 3"
- },
- {
- "iccid": "123-456-782",
- "display-name": "Sim 2"
- },
- {
- "iccid": "123-456-781",
- "display-name": "Sim 1"
- }
- ]
- }
- ],
- "applications": [
- {
- "application-id": "nvr-application",
- "display-name": "Network Video Recorder"
- }
- ]
-}
\ No newline at end of file
diff --git a/chronos-exporter/files/configs/demo-configuration.yaml b/chronos-exporter/files/configs/demo-configuration.yaml
new file mode 100644
index 0000000..dfb4270
--- /dev/null
+++ b/chronos-exporter/files/configs/demo-configuration.yaml
@@ -0,0 +1,264 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+sites:
+ - site-id: freemont
+ display-name: Freemont, CA
+ image: https://en.wikipedia.org/wiki/File:Mission_Peak_over_Lake_Elizabeth,_in_Fremont,_California_(cropped).JPG
+ small-cells:
+ - small-cell-id: freemont-sc-north
+ display-name: North Cell
+ - small-cell-id: freemont-sc-south
+ display-name: South Cell
+ - small-cell-id: freemont-sc-east
+ display-name: East Cell
+ - small-cell-id: freemont-sc-west
+ display-name: West Cell
+ slices:
+ - slice-id: freemont-slice-cameras
+ display-name: Cameras Slice
+ device-groups:
+ - cameras
+ applications:
+ - nvr-application
+ - occupant-counter
+ - slice-id: freemont-slice-phones
+ display-name: Phones Slice
+ device-groups:
+ - phones
+ applications:
+ - expenses-application
+ device-groups:
+ - device-group-id: phones
+ display-name: Phones group
+ devices:
+ - 752365A
+ - 752908B
+ - device-group-id: cameras
+ display-name: Cameras group
+ devices:
+ - 7568111
+ - 7568112
+ - 7568113
+ - 7568114
+ - 7568115
+ - 7568116
+ - 7568117
+ devices:
+ - serial-number: 752365A
+ imei: 123-456-7891
+ display-name: Phone 1
+ location: Somewhere
+ type: Pixel 5 Phone
+ sim: 123-456-789
+ - serial-number: 752908B
+ imei: 123-456-7892
+ display-name: Phone 2
+ location: Somewhere
+ type: iPhone 11
+ sim: 123-456-788
+ - serial-number: 7568111
+ imei: 123-456-7893
+ display-name: Camera 1
+ location: Front entrance
+ type: Camera
+ sim: 123-456-787
+ - serial-number: 7568112
+ imei: 123-456-7894
+ display-name: Camera 2
+ location: South Gate
+ type: Camera
+ sim: 123-456-786
+ - serial-number: 7568113
+ imei: 123-456-7895
+ display-name: Camera 3
+ location: Store Room 1
+ type: Camera
+ sim: 123-456-785
+ - serial-number: 7568114
+ imei: 123-456-7896
+ display-name: Camera 4
+ location: Store Room 2
+ type: Camera
+ sim: 123-456-784
+ - serial-number: 7568115
+ imei: 123-456-7897
+ display-name: Camera 5
+ location: Corridor 1
+ type: Camera
+ sim: 123-456-783
+ - serial-number: 7568116
+ imei: 123-456-7898
+ display-name: Camera 6
+ location: Corridor 2
+ type: Camera
+ sim: 123-456-782
+ - serial-number: 7568117
+ imei: 123-456-7899
+ display-name: Camera 7
+ location: Atrium
+ type: Camera
+ sim: 123-456-781
+ sims:
+ - iccid: 123-456-789
+ display-name: Sim 9
+ - iccid: 123-456-788
+ display-name: Sim 8
+ - iccid: 123-456-787
+ display-name: Sim 7
+ - iccid: 123-456-786
+ display-name: Sim 6
+ - iccid: 123-456-785
+ display-name: Sim 5
+ - iccid: 123-456-784
+ display-name: Sim 4
+ - iccid: 123-456-783
+ display-name: Sim 3
+ - iccid: 123-456-782
+ display-name: Sim 2
+ - iccid: 123-456-781
+ display-name: Sim 1
+ - site-id: berlin
+ display-name: Berlin, DE
+ image: https://en.wikipedia.org/wiki/Berlin#/media/File:Brandenburger_Tor_abends.jpg
+ small-cells:
+ - small-cell-id: berlin-sc-north
+ display-name: North Cell
+ - small-cell-id: berlin-sc-south
+ display-name: South Cell
+ - small-cell-id: berlin-sc-east
+ display-name: East Cell
+ - small-cell-id: berlin-sc-west
+ display-name: West Cell
+ slices:
+ - slice-id: berlin-slice-cameras
+ display-name: Cameras Slice
+ device-groups:
+ - cameras
+ applications:
+ - nvr-application
+ - occupant-counter
+ - slice-id: berlin-slice-phones
+ display-name: Phones Slice
+ device-groups:
+ - phones
+ applications:
+ - expenses-application
+ device-groups:
+ - device-group-id: phones
+ display-name: Phones group
+ devices:
+ - 18876871
+ - 18876872
+ - 18876873
+ - 18876874
+ - 18876875
+ - device-group-id: cameras
+ display-name: Cameras group
+ devices:
+ - 18876881
+ - 18876882
+ - 18876883
+ - 18876884
+ - 18876885
+ - 18876886
+ - 18876887
+ devices:
+ - serial-number: 18876871
+ imei: 123-456-7891
+ display-name: Phone 1
+ location: Somewhere
+ type: Pixel 5 Phone
+ sim: 123-671-789
+ - serial-number: 18876872
+ imei: 123-671-7892
+ display-name: Phone 2
+ location: Somewhere
+ type: iPhone 11
+ sim: 123-671-788
+ - serial-number: 18876873
+ imei: 123-671-7892
+ display-name: Phone 3
+ location: Somewhere
+ type: iPhone 11
+ sim: 123-671-788
+ - serial-number: 18876874
+ imei: 123-671-7892
+ display-name: Phone 4
+ location: Somewhere
+ type: iPhone 11
+ sim: 123-671-788
+ - serial-number: 18876875
+ imei: 123-671-7892
+ display-name: Phone 5
+ location: Somewhere
+ type: iPhone 11
+ sim: 123-671-788
+ - serial-number: 18876881
+ imei: 123-671-7893
+ display-name: Camera 1
+ location: Front entrance
+ type: Camera
+ sim: 123-671-787
+ - serial-number: 18876882
+ imei: 123-671-7894
+ display-name: Camera 2
+ location: South Gate
+ type: Camera
+ sim: 123-671-786
+ - serial-number: 18876883
+ imei: 123-671-7895
+ display-name: Camera 3
+ location: Store Room 1
+ type: Camera
+ sim: 123-671-785
+ - serial-number: 18876884
+ imei: 123-671-7896
+ display-name: Camera 4
+ location: Store Room 2
+ type: Camera
+ sim: 123-671-784
+ - serial-number: 18876885
+ imei: 123-671-7897
+ display-name: Camera 5
+ location: Corridor 1
+ type: Camera
+ sim: 123-671-783
+ - serial-number: 18876886
+ imei: 123-671-7898
+ display-name: Camera 6
+ location: Corridor 2
+ type: Camera
+ sim: 123-671-782
+ - serial-number: 18876887
+ imei: 123-671-7899
+ display-name: Camera 7
+ location: Atrium
+ type: Camera
+ sim: 123-671-781
+ sims:
+ - iccid: 123-671-789
+ display-name: Sim 9
+ - iccid: 123-671-788
+ display-name: Sim 8
+ - iccid: 123-671-787
+ display-name: Sim 7
+ - iccid: 123-671-786
+ display-name: Sim 6
+ - iccid: 123-671-785
+ display-name: Sim 5
+ - iccid: 123-671-784
+ display-name: Sim 4
+ - iccid: 123-671-783
+ display-name: Sim 3
+ - iccid: 123-671-782
+ display-name: Sim 2
+ - iccid: 123-671-781
+ display-name: Sim 1
+applications:
+ - application-id: nvr-application
+ display-name: Network Video Recorder
+ - application-id: occupant-counter
+ display-name: Occupant Counting Application
+ - application-id: expenses-application
+ display-name: Expenses Application
diff --git a/chronos-exporter/templates/configmap.yaml b/chronos-exporter/templates/configmap.yaml
index 5090a7e..dd502ed 100644
--- a/chronos-exporter/templates/configmap.yaml
+++ b/chronos-exporter/templates/configmap.yaml
@@ -12,7 +12,5 @@
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
data:
- {{ $root := . }}
- {{ range $path, $bytes := .Files.Glob "files/configs/*.json" }}
- {{ base $path }}: '{{ $root.Files.Get $path }}'
- {{ end }}
+{{ (.Files.Glob "files/configs/*.yaml").AsConfig | indent 2 }}
+
diff --git a/chronos-exporter/values.yaml b/chronos-exporter/values.yaml
index df98f3a..794c50d 100644
--- a/chronos-exporter/values.yaml
+++ b/chronos-exporter/values.yaml
@@ -10,11 +10,11 @@
image:
repository: onosproject/chronos-exporter
- tag: v0.0.2
+ tag: v0.0.3
pullPolicy: IfNotPresent
pullSecrets: []
service:
type: ClusterIP
-configfile: /etc/chronos-exporter/configs/demo-configuration.json
\ No newline at end of file
+configfile: /etc/chronos-exporter/configs/demo-configuration.yaml
\ No newline at end of file
diff --git a/chronos-umbrella/Chart.yaml b/chronos-umbrella/Chart.yaml
index e0e3e15..3546927 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.5
+version: 0.0.6
appVersion: v0.0.0
keywords:
- aether
@@ -29,7 +29,7 @@
- name: chronos-exporter
condition: import.chronos-exporter.enabled
repository: "file://../chronos-exporter"
- version: 0.0.3
+ version: 0.0.4
- name: aether-enterprise-portal
condition: import.aether-enterprise-portal.enabled
repository: "file://../aether-enterprise-portal"