NONRTRIC-955: Update copyright notices
[sim/a1-interface.git] / near-rt-ric-simulator / README.md
index 7ae28f0..2369872 100644 (file)
@@ -1,6 +1,6 @@
-# O-RAN-SC Near-RealTime RIC Simulator
+# O-RAN-SC A1 Simulator
 
-The O-RAN SC Near-RealTime RIC simulates the A1 as an generic REST API which can receive and send northbound messages. The simulator validates the payload and applies policy.
+The O-RAN SC A1 simulator simulates the A1 as an generic REST API which can receive and send northbound messages. The simulator validates the payload and applies policy.
 
 The simulator supports multiple A1 interface versions (version of the open API yaml file\):
 
@@ -59,6 +59,7 @@ URIs for A1:
 |  GET, get a policy | http://localhost:8085/a1-p/policytypes/{policy\_type\_id}/policies/{policy\_instance\_id} |
 |  PUT, create/update a policy | http://localhost:8085/a1-p/policytypes/{policy\_type\_id}/policies/{policy\_instance\_id} |
 |  GET, get policy status | http://localhost:8085/a1-p/policytypes/{policy\_type\_id}/policies/{policy\_instance\_id}/status |
+|  PUT, deliver data produced by data producer | http://localhost:8085/data-delivery json payload = {"job":"101",    "payload":"another payload"}|
 
 Swagger UI at: http://localhost:8085/ui/
 
@@ -82,8 +83,6 @@ URIs for admin operations:
 |  Turn on http header and payload logging | http://localhost:8085payload_logging/on |
 |  Turn off http header and payload logging | http://localhost:8085payload_logging/off |
 
-
-
 # Supported operations in simulator A1 Standard 1.1.3
 
 For the complete yaml specification, see [STD_A1.yaml](../near-rt-ric-simulator/api/STD_1.1.3/STD_A1.yaml).
@@ -164,7 +163,7 @@ An env variable, A1\_VERSION need to be passed to the container at start to sele
 
 An env variable, REMOTE_HOSTS_LOGGING, can be set (any value is ok) and the the counter remote\_hosts will log the host names of all remote hosts that has accessed the A1 URIs. If host names cannot be resolved, the ip address of the remote host is logged instead. This logging is default off so must be configured to be enabled. If not configured, the counter remote\_hosts will return a fixed text indicating that host name logging is not enabled. Use this feature with caution, remote host lookup may take time in certain environments.
 
-And optional env variable, DUPLICATE_CHECK, can be set to '1' to turn on duplicate check of policiy json. A duplicate policy is when the policy json is exactly same as for a different policy id of the same type.  This function is default set off if the variable is not set at all or set to '0'.
+And optional env variable, DUPLICATE_CHECK, can be set to '1' to turn on duplicate check of policy json. A duplicate policy is when the policy json is exactly same as for a different policy id of the same type.  This function is default set off if the variable is not set at all or set to '0'.
 
 The simulator can also run using the https protocol. The enable https, a valid certificate and key need to provided. There is self-signed certificate available in the certificate dir and that dir shall be mounted to the container to make it available
 
@@ -222,15 +221,49 @@ Go to the test folder of the selected version, 'test/<version>/.
 
 Note that test can be performed both using the nonsecure http port and the secure https port.
 
-Build and start the simulator container using:
+Build and start the simulator containers: STD_1.1.3 and OSC_2.1.0, using:
+
+./build_and_start.sh duplicate-check|ignore-duplicate
+
+Build and start the simulator container version STD_2.0.0, using two alternatives: ext-srv or kafka-srv. However, both can not be used at the same time to start A1 sim.
 
-./build\_and\_start.sh duplicate-check|ignore-duplicate
+In order to start with ext-srv:
+./build_and_start.sh duplicate-check|ignore-duplicate ext-srv|ext-srv-secure|ignore-ext-srv
 
+In order to start with kafka-srv:
+./build_and_start.sh duplicate-check|ignore-duplicate kafka-srv|kafka-srv-secure publish-resp|ignore-publish
+
+STD_2.0.0 version is now including an external server that is a Python server building RESTful API. The external server supports HTTP/HTTPS protocols.
+The description of the start parameters are explained below:
+ext-srv: Runs external server that supports HTTP protocol only.
+ext-srv-secure: Runs external server that supports HTTPS protocol as well.
+ignore-ext-srv: Ignores external server to run.
+
+STD_2.0.0 version also includes an kafka message dispatcher that is a Python server building RESTful APIs. The kafka server supports HTTP/HTTPS protocols.
+The description of the start parameters are explained below:
+kafka-srv: Runs kafka server that supports HTTP protocol only.
+kafka-srv-secure: Runs kafka server that supports HTTPS protocol as well.
+publish-resp: The flag controls the dispatcher module to decide auto responding to each requests for test purposes only.
+ignore-publish: If the A1 sim is being started using ignore flag, then the dispatcher module will look for a respone message published by south-bound module.
 
 This will build and start the container in interactive mode. The built container only resides in the local docker repository.
 Note, the default port is 8085 for http and 8185 for https. When running the simulator as a container, the defualt ports can be re-mapped to any port on the localhost.
 
-In a second terminal, go to the same folder and run the basic test script, basic\_test.sh nonsecure|secure or commands.sh nonsecure|secure duplicate-check|ignore-duplicate
+In a second terminal, go to the same folder and run the basic test script, basic_test.sh nonsecure|secure or commands.sh nonsecure|secure duplicate-check|ignore-duplicate for STD_1.1.3 and OSC_2.1.0 versions.
+
+For the STD_2.0.0 version, in a second terminal, go to the same folder and run the basic test script for external server activated case:
+./basic_test.sh nonsecure|secure duplicate-check|ignore-duplicate ext-srv|ext-srv-secure|ignore-ext-srv
+The description of the test script parameters are explained below:
+nonsecure|secure: Runs test cases with either support of HTTP/HTTPS protocol.
+duplicate-check|ignore-duplicate: Runs test cases with either support of duplicate/ignore-duplicate flag for the policies.
+ext-srv|ext-srv-secure|ignore-ext-srv: If the simulator started with ext-srv or ext-srv-secure parameter, then one of these options can be used. Otherwise, ignore-ext-srv parameter should be used.
+
+For the STD_2.0.0 version, in a second terminal, go to the same folder and run the basic test script for kafka dispatcher server activated case:
+./basic_test.sh nonsecure|secure duplicate-check|ignore-duplicate ext-srv|ext-srv-secure|ignore-ext-srv
+The description of the test script parameters are explained below:
+nonsecure|secure: Runs test cases with either support of HTTP/HTTPS protocol.
+duplicate-check|ignore-duplicate: Runs test cases with either support of duplicate/ignore-duplicate flag in accordance with the one which used while starting A1 sim.
+ext-srv|ext-srv-secure|ignore-ext-srv: If the simulator started with kafka-srv or kafka-srv-secure parameter, then ignore-ext-srv option should be used.
 
 Note that the arg for duplicate check must match in both scripts.
 This script runs a number of tests towards the simulator to make sure it works properply.
@@ -242,7 +275,7 @@ Only http is tested as the internal flask server is only using http (https is pa
 
 Navigate to 'near-rt-ric-simulator/tests'. Choose the version to test and use that file for test.
 
-Use 'python3 -m pytest \<filename>' to run unit test only with no coverage check
+Use 'python3 -m pytest \<filename>' to run unit test only with no coverage check. Before running that command, the dependencies which are pytest and connexion should be installed in your virtual environment. If the latest connexion version arises DeprecationWarning, you may try to install connexion with version 2.6.0.
 
 Or use 'coverage run  -m pytest \<filename>' to run unit test and produce coverage data.
 
@@ -252,7 +285,7 @@ To use the 'coverage' cmd, coverage need to be installed use 'pip install covera
 
 ## License
 
-Copyright (C) 2022 Nordix Foundation.
+Copyright (C) 2023 Nordix Foundation.
 Licensed under the Apache License, Version 2.0 (the "License")
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at