RIC-642 related changes: REST subscription, rnib enhancements, symptomdata, rest service with healthy and config interface

Signed-off-by: Erkki Hietala <erkki.hietala@nokia.com>
Change-Id: Ibcbc85b57da571fb9c0eb3adff9ba950aec6c4c9
diff --git a/docs/conf.py b/docs/conf.py
index ccad5c3..6a252b0 100755
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -5,6 +5,8 @@
 # autodoc needs this to find the code
 sys.path.insert(0, os.path.abspath("../"))
 
+language = 'en'
+
 extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinx.ext.viewcode", "numpydoc"]
 
 # don't alphabetically order
diff --git a/docs/developer-guide.rst b/docs/developer-guide.rst
index 6892d15..036acfb 100644
--- a/docs/developer-guide.rst
+++ b/docs/developer-guide.rst
@@ -11,7 +11,7 @@
 Tech Stack
 ----------
 
-The framework requires Python version 3.7 or later, and depends on
+The framework requires Python version 3.8 or later, and depends on
 these packages provided by the O-RAN-SC project and third parties:
 
 * msgpack
@@ -48,6 +48,73 @@
    Xapp as a docker container or in configmap in case of Xapp as a pod.
 #. Copy the xappConfig.json into the docker image in Dockerfile.
 
+Example Xapp
+------------
+
+Director examples has many examples for creating the xapp having features like:
+* REST subscription interface
+* symptomdata handler
+* rmr send/receive
+* REST healthy and ready response handler
+* REST config handler
+
+List of xapps:
+* ping_xapp.py and ping_xapp.py using RMR to send and receive
+* xapp_symptomdata.py for subscribing the symptomdata event
+* xapp_test.py for both symptomdata, RMR recveice, k8s healthy service and REST subscription
+
+xapp_test.py
+------------
+
+Test xapp can be run by creating the docker container or as standalone process. For testing restserversimu.py
+has been made to emulate the REST subscription request responses and responding the symptomdata dynamic registration
+reponse. When running the xapp_test you need to create the RMR static routing file so that the rmr initialization
+will return (otherwise it will wait for rtmgr connection).
+
+Test xapp has as well the config file in descriptor/config-file.json where your can adjust the local runtime
+environment for subscriptions and symptomdata lwsd service ip address.
+
+Subsciprion interface url has the submgr service endpoint : ``http://service-ricplt-submgr-http.ricplt:8088/``
+Symptomdata registration url set to lwsd service url : ``http://service-ricplt-lwsd-http.ricplt:8080/ric/v1/lwsd``
+
+In case of using restserversimu.py for testing configure your host ip address, for example 192.168.1.122 port 8090:
+
+Subsciprion interface url has the submgr service endpoint : ``http://192.168.1.122:9000/``
+Symptomdata registration url set to lwsd service url : ``http://192.168.1.122:9000/ric/v1/lwsd``
+
+Then start the restserversimu:
+
+export PYTHONPATH=./
+python3 examples/restserversimu.py -port 9000 -address 192.168.1.122
+
+and then the xapp_test:
+
+export PYTHONPATH=./
+export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
+export RMR_SEED_RT=examples/descriptor/xapp-test.rt
+export RMR_SRC_ID="192.168.1.122"
+python3 examples/xapp_test.py -config examples/descriptor/config-file.json -port 8888 -xapp xapp-test -service xapp-test
+
+If you like to implement the kubernetes healthy service responder, you can follow the example how to use the 
+xapp_rest.py defined rest hander. Basically you can initiate the REST service listener and add the handlers (examples in
+xapp_tets.py).
+
+Subscription REST interface
+---------------------------
+
+api/xapp_rest_api.yaml defines interface and it has been used to generate the swagger api calls.
+
+Generating the swagger client model:
+docker run --rm -v ${PWD}:/local -u $(id -u ${USER}):$(id -g ${USER}) swaggerapi/swagger-codegen-cli generate -i /local/api/xapp_rest_api.yaml -l python -o /local/out
+
+swagger-codegen-cli generated code result needs to be adjusted to have the ricxappframe prefix. 
+Replace the module name to have the ricxappframe prefix:
+
+find ./out/swagger_client -type f -exec sed -i -e 's/swagger_client/ricxappframe\.swagger_client/g' {} \;
+
+Then copy the generated ./out/swagger_client directory to ./ricxappframe/subsclient directory:
+
+cp -r ./out/swagger_client/* ./ricxappframe/subsclient
 
 Unit Testing
 ------------
diff --git a/docs/release-notes.rst b/docs/release-notes.rst
index 939d2a4..f6f0f89 100644
--- a/docs/release-notes.rst
+++ b/docs/release-notes.rst
@@ -10,6 +10,10 @@
 The format is based on `Keep a Changelog <http://keepachangelog.com/>`__
 and this project adheres to `Semantic Versioning <http://semver.org/>`__.
 
+[3.1.0] - 2022-03-22
+--------------------
+* Added the symptomdata module
+
 [3.0.2] - 2021-12-17
 --------------------
 * Fix caching of error code data not happening (`RIC-862 <https://jira.o-ran-sc.org/browse/RIC-862>`_)
diff --git a/docs/user-guide.rst b/docs/user-guide.rst
index 8189ab4..0f2bbdf 100644
--- a/docs/user-guide.rst
+++ b/docs/user-guide.rst
@@ -49,3 +49,27 @@
 
 .. autoclass:: ricxappframe.xapp_sdl.SDLWrapper
     :members:
+
+Class Symptomdata
+-----------------
+
+Application writers may instantiate this class directly to communicate with the symptomdata service.
+
+.. autoclass:: ricxappframe.xapp_symptomdata.Symptomdata
+    :members:
+
+Class NewSubscriber
+-------------------
+
+Application writers may instantiate this class directly to communicate REST based subscriptions.
+
+.. autoclass:: ricxappframe.xapp_subscribe.NewSubscriber
+    :members:
+
+Class RestHandler
+-----------------
+
+Application writers may instantiate this class directly to have the xapp REST server service.
+
+.. autoclass:: ricxappframe.xapp_rest.RestHandler
+    :members: