Add Aether Monitoring Lamp code to aether-monitoring repo

Change-Id: I9617ccc0d9cbb977626b3d4fe03198d9d35622b1
diff --git a/VERSION b/VERSION
index 2228cad..fae59ca 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.6.7
+0.6.8
diff --git a/aether-alerting-devices/aether-monitoring-lamp/aml_production_config.json b/aether-alerting-devices/aether-monitoring-lamp/aml_production_config.json
new file mode 100644
index 0000000..a33a64c
--- /dev/null
+++ b/aether-alerting-devices/aether-monitoring-lamp/aml_production_config.json
@@ -0,0 +1,15 @@
+{
+  "debug" : true,
+  "refreshInterval" : 10,
+  "url" : "https://monitoring.aetherproject.org/edges",
+  "activeEdges" : [
+    "ace-cornell1-prd",
+    "ace-menlo-rasp-pi",
+    "ace-tucson",
+    "ace-princeton1-prd",
+    "ace-stanford1-prd",
+    "ace-stanford2-prd",
+    "ace-intel",
+    "ace-nctu"
+  ]
+}
diff --git a/aether-alerting-devices/aether-monitoring-lamp/aml_production_config.json.license b/aether-alerting-devices/aether-monitoring-lamp/aml_production_config.json.license
new file mode 100644
index 0000000..7dc5f1a
--- /dev/null
+++ b/aether-alerting-devices/aether-monitoring-lamp/aml_production_config.json.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org>
+
+SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
\ No newline at end of file
diff --git a/aether-alerting-devices/aether-monitoring-lamp/run_aml.py b/aether-alerting-devices/aether-monitoring-lamp/run_aml.py
new file mode 100644
index 0000000..d2d6f6a
--- /dev/null
+++ b/aether-alerting-devices/aether-monitoring-lamp/run_aml.py
@@ -0,0 +1,62 @@
+# SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+import json
+import urllib.request
+import time
+
+def main():
+    config = json.loads(open("aml_production_config.json", 'r').read())
+
+    # set active edges
+    activeEdges = config['activeEdges']
+
+    # set refresh interval (seconds)
+    refreshInterval = config['refreshInterval']
+
+    # set url to fetch edge status from
+    url = config['url']
+
+    # for debugging
+    debug = config['debug']
+    debugCase = True
+
+    while True:
+        # fetch edge status
+        response = urllib.request.urlopen(url)
+        data = response.read()
+        edges = json.loads(data.decode('utf-8'))
+
+        allEdgesUp = True
+
+        # loop through all edges
+        for e in edges['edges']:
+            # only check active edges specified in config file
+            if e['name'] not in activeEdges:
+                continue
+
+            if isEdgeUp(e):
+                print(e['name'] + '\nok\n')
+            else:
+                print(e['name'] + '\nDOWN\n')
+                allEdgesUp = False
+
+        if allEdgesUp:
+            # Run Green Light Scene
+            # os.system("uiopen shortcuts://run-shortcut?name=edgeOK")
+            print("** All edges are up. **")
+        else:
+            # Run Red Light Scene
+            # os.system("uiopen shortcuts://run-shortcut?name=edgeDOWN")
+            print("** AT LEAST 1 EDGE IS DOWN! **")
+        print("Sleeping for " + str(refreshInterval) + " seconds...")
+
+        time.sleep(refreshInterval)
+
+def isEdgeUp(edge):
+    return edge['status']['control_plane'] == "connected" and \
+           edge['status']['user_plane'] == "connected"
+
+if __name__ == "__main__":
+    main()