Merge "Changed xapp-descriptor and parsing"
authorScott Daniels <daniels@research.att.com>
Wed, 27 May 2020 17:21:26 +0000 (17:21 +0000)
committerGerrit Code Review <gerrit@o-ran-sc.org>
Wed, 27 May 2020 17:21:26 +0000 (17:21 +0000)
container-tag.yaml
docs/release-notes.rst
init/config-file.json
init/init_script.py

index 8ea858b..d99f50d 100644 (file)
@@ -1,4 +1,4 @@
 # this is used by CI jobs to apply a tag when it builds the image
 ---
-tag: '1.0.0'
+tag: '1.0.1'
 
index 685a99c..a5c1671 100644 (file)
@@ -21,7 +21,7 @@ Version history
 | **Date**           | **Ver.**           | **Author**         | **Comment**        |
 |                    |                    |                    |                    |
 +--------------------+--------------------+--------------------+--------------------+
-| 2020-21-05         | 1.0.0              |   Shraboni Jana    | First draft        |
+| 2020-21-05         | 1.0.1              |   Shraboni Jana    | Second draft       |
 |                    |                    |                    |                    |
 +--------------------+--------------------+--------------------+--------------------+
 
index d4db879..0326319 100644 (file)
@@ -1,83 +1,48 @@
-{\r
-    "config-file.json": {\r
-        "xapp_name": "hwxapp",\r
-        "version": "1.0.0",\r
-        "containers": [\r
-            {\r
-                "name": "hwxapp",\r
-                "image": {\r
-                    "registry": "nexus3.o-ran-sc.org:10002",\r
-                    "name": "o-ran-sc/ric-app-hw",\r
-                    "tag": "0.0.1"\r
-                },\r
-                "command": "python3 init.py config-file.json"\r
-            }\r
-        ],\r
-        "livenessProbe": {\r
-            "exec": {\r
-                "command": [\r
-                    "/usr/local/bin/health_ck"\r
-                ]\r
-            },\r
-            "initialDelaySeconds": 5,\r
-            "periodSeconds": 15\r
-        },\r
-        "messaging": {\r
-            "ports": [\r
-                {\r
-                    "name": "rmr-data",\r
-                    "container": "hwxapp",\r
-                    "port": 4560,\r
-                    "rxMessages": [ \r
-                                               "RIC_SUB_RESP", \r
-                                               "RIC_SUB_FAILURE", \r
-                                               "RIC_SUB_DEL_RESP", "RIC_SUB_DEL_FAILURE", "RIC_INDICATION", "RIC_CONTROL_ACK", "RIC_CONTROL_FAILURE", "A1_POLICY_REQ", "RIC_HEALTH_CHECK_REQ" \r
-                    ],\r
-                    "txMessages": [ "RIC_SUB_REQ", "RIC_SUB_DEL_REQ", "RIC_CONTROL_REQ", "A1_POLICY_RESP", "A1_POLICY_QUERY", "RIC_HEALTH_CHECK_RESP" ],\r
-                    "policies": [1],\r
-                    "description": "rmr receive data port for HWxapp"\r
-                },\r
-                {\r
-                    "name": "rmr-route",\r
-                    "container": "hwxapp",\r
-                    "port": 4561,\r
-                    "description": "rmr route port for hwxapp"\r
-                }\r
-            ]\r
-        },\r
-        "controls": {\r
-            "ves_collector_address": "xapp-sandbox2.research.att.com:8888"\r
-        },\r
-        "rmr": {\r
-            "protPort": "tcp:4560",\r
-            "maxSize": 2072,\r
-            "numWorkers": 1,\r
-            "txMessages": [\r
-                "RIC_SUB_REQ", "RIC_SUB_DEL_REQ", "RIC_CONTROL_REQ", "A1_POLICY_RESP", "A1_POLICY_QUERY", "RIC_HEALTH_CHECK_RESP"\r
-            ],\r
-            "rxMessages": [\r
-                "RIC_SUB_RESP", \r
-                               "RIC_SUB_FAILURE", \r
-                               "RIC_SUB_DEL_RESP", "RIC_SUB_DEL_FAILURE", "RIC_INDICATION", "RIC_CONTROL_ACK", "RIC_CONTROL_FAILURE", "A1_POLICY_REQ", "RIC_HEALTH_CHECK_REQ"              \r
-            ]\r
-        }\r
-    },\r
-  "controls-schema.json": {\r
-        "$schema": "http://json-schema.org/draft-07/schema#",\r
-        "$id": "#/controls",\r
-        "type": "object",\r
-        "title": "Controls Section Schema",\r
-        "required": [],\r
-        "properties": {\r
-            "ves_collector_address": {\r
-                "$id": "#/controls/ves_collector_address",\r
-                "type": "string",\r
-                "title": "ves_collector_address",\r
-                "default": "localhost:8080",\r
-                "examples": [\r
-                    "localhost:8080"\r
-                ]\r
-            }\r
-        }\r
-    }\r
-}
\ No newline at end of file
+ {
+        "xapp_name": "hwxapp",
+        "version": "1.0.0",
+        "containers": [
+            {
+                "name": "hwxapp",
+                "image": {
+                    "registry": "nexus3.o-ran-sc.org:10002",
+                    "name": "o-ran-sc/ric-app-hw",
+                    "tag": "1.0.1"
+                       }
+            }
+        ],
+        "messaging": {
+            "ports": [
+                {
+                    "name": "rmr-data",
+                    "container": "hwxapp",
+                    "port": 4560,
+                    "rxMessages": [ 
+                                               "RIC_SUB_RESP", 
+                                               "A1_POLICY_REQ", "RIC_HEALTH_CHECK_REQ" 
+                    ],
+                    "txMessages": [ "RIC_SUB_REQ", "A1_POLICY_RESP", "A1_POLICY_QUERY", "RIC_HEALTH_CHECK_RESP" ],
+                    "policies": [1],
+                    "description": "rmr receive data port for HWxapp"
+                },
+                {
+                    "name": "rmr-route",
+                    "container": "hwxapp",
+                    "port": 4561,
+                    "description": "rmr route port for hwxapp"
+                }
+            ]
+        },
+        "rmr": {
+            "protPort": "tcp:4560",
+            "maxSize": 2072,
+            "numWorkers": 1,
+            "txMessages": [
+                "RIC_SUB_REQ", "A1_POLICY_RESP", "A1_POLICY_QUERY", "RIC_HEALTH_CHECK_RESP"
+            ],
+            "rxMessages": [
+                "RIC_SUB_RESP", 
+                               "A1_POLICY_REQ", "RIC_HEALTH_CHECK_REQ"              
+            ]
+        }
+  }
index 85f00d1..c6a2b40 100644 (file)
@@ -30,7 +30,7 @@ import sys;
 import os;
 import signal;
 import time;
-
+import ast;
 
 def signal_handler(signum, frame):
     print("Received signal {0}\n".format(signum));
@@ -42,14 +42,21 @@ def signal_handler(signum, frame):
         
 
 def parseConfigJson(config):
+    
     for k1 in config.keys():
-        for k2 in config[k1].keys():
-            #print(k2);
-            if k2 in ParseSection:
-                result = ParseSection[k2](config[k1]);
-                if result == False:
+        if k1 in ParseSection:
+            result = ParseSection[k1](config);
+            if result == False:
                     return False;
 
+        
+#        for k2 in config[k1].keys():
+            #print(k2);
+#            if k2 in ParseSection:
+#                result = ParseSection[k2](config[k1]);
+#                if result == False:
+#                    return False;
+
 
         
 def getMessagingInfo(config):
@@ -70,7 +77,9 @@ def getXappName(config):
     if myKey not in config.keys():
         print(("Error ! No information found for {0} in config\n".format(myKey)));
         return False;
+
     xapp_name = config[myKey];
+    print("Xapp Name is: " + xapp_name); 
     os.environ["XAPP_NAME"] = xapp_name;
 
 default_routing_file = "/tmp/routeinfo/routes.txt";