Kafka message dispatcher documentation 47/8847/6
authorhalil.cakal <halil.cakal@est.tech>
Wed, 10 Aug 2022 08:19:15 +0000 (09:19 +0100)
committerhalil.cakal <halil.cakal@est.tech>
Mon, 22 Aug 2022 08:44:06 +0000 (09:44 +0100)
Patch set 2: Creates docs and readme for kafka dispatcher module and updates readme for A1 sim.
Patch set 3: Typo fixes.
Patch set 4: Naming refactor.
Patch set 5: Review.
Patch set 6: Review fixes.

Issue-ID: NONRTRIC-782
Change-Id: Id3071d4e3dab6ecf27853183888307b101667e78
Signed-off-by: halil.cakal <halil.cakal@est.tech>
13 files changed:
LICENSE.txt [new file with mode: 0755]
docs/callout-server.rst
docs/conf.py
docs/index.rst
docs/kafka-message-dispatcher.rst [new file with mode: 0755]
docs/release-notes.rst
near-rt-ric-simulator/README.md
near-rt-ric-simulator/api/STD_1.1.3/STD_A1.yaml
near-rt-ric-simulator/test/EXT_SRV/README.md
near-rt-ric-simulator/test/EXT_SRV/api/EXT_SRV_api.yaml
near-rt-ric-simulator/test/KAFKA_DISPATCHER/.gitignore [new file with mode: 0644]
near-rt-ric-simulator/test/KAFKA_DISPATCHER/README.md [new file with mode: 0644]
near-rt-ric-simulator/test/KAFKA_DISPATCHER/api/KAFKA_DISPATCHER_api.yaml

diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100755 (executable)
index 0000000..96589bf
--- /dev/null
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License. 
index d670468..f2556f4 100755 (executable)
@@ -11,6 +11,8 @@
 .. |yaml-icon| image:: ./images/yaml_logo.png
                   :width: 40px
 
+.. _calloutserver:
+
 =====================
 Callout Server
 =====================
@@ -18,14 +20,11 @@ Callout Server
 API Documentation
 =================
 
-The O-RAN SC external server is an extension for Near-RealTime RIC simulator. It creates an external web server building RESTful API. It is capable of recieving Rest calls from the northbound simulator version STD_2.0.0 and responses back to it.
-
-The details of API definitions are being explained below:
-
-See `Callout server API <./EXT_SRV_api.html>`_ for full details of the API.
+The O-RAN SC external call-out server allows behavioral extensions to be added to the A1 Simulator. It creates an external call-out server, which provides a RESTful API. A1 Policy operations, for some A1 Policy Types, can then be redirected to the external call-out server, supporting supplemental simulator behavior for those A1 Policy Types. 
 
-The API is also described in YAML:
+**Note:** call-out server functionality is only available for *'STD_2.0.0'* version simulators.
 
+The external call-out server exposes a 'Callout server API' REST API. This internal API is invoked directly by the A1 Simulator, and is not intended to be used by any other client.  The 'Callout Server API' is documented in `Callout Server API <./EXT_SRV_api.html>`_ and in OpenAPI YAML format:
 
 .. csv-table::
    :header: "API name", "|yaml-icon|"
@@ -33,6 +32,7 @@ The API is also described in YAML:
 
    "Callout Server API", ":download:`link <../near-rt-ric-simulator/test/EXT_SRV/api/EXT_SRV_api.yaml>`"
 
+External call-out servers also expose an 'Admin API' to manipulate the behavior of the call-out server itself. The 'Callout Server Admin API' is documented below: 
 
 Admin Functions
 ================
index e4fa58d..42330a6 100644 (file)
@@ -8,6 +8,7 @@ linkcheck_ignore = [
     'http://localhost.*',
     'http://127.0.0.1.*',
     'https://gerrit.o-ran-sc.org.*',
+    './KAFKA_DISPATCHER_api.html',
     './EXT_SRV_api.html', #Generated file that doesn't exist at link check.
 ]
 
@@ -19,7 +20,13 @@ redoc = [
                 'page': 'EXT_SRV_api',
                 'spec': '../near-rt-ric-simulator/test/EXT_SRV/api/EXT_SRV_api.yaml',
                 'embed': True,
-            }
+            },
+            {
+                'name': 'Kafka Message Dispatcher',
+                'page': 'KAFKA_DISPATCHER_api',
+                'spec': '../near-rt-ric-simulator/test/KAFKA_DISPATCHER/api/KAFKA_DISPATCHER_api.yaml',
+                'embed': True,
+            },
         ]
 
 redoc_uri = 'https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js'
index 43757b8..b96a895 100644 (file)
@@ -21,5 +21,6 @@ A1 Interface Simulator
    ./overview.rst
    ./simulator-api.rst
    ./callout-server.rst
+   ./kafka-message-dispatcher.rst
    ./release-notes.rst
 
diff --git a/docs/kafka-message-dispatcher.rst b/docs/kafka-message-dispatcher.rst
new file mode 100755 (executable)
index 0000000..9bfebf7
--- /dev/null
@@ -0,0 +1,220 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. SPDX-License-Identifier: CC-BY-4.0
+.. Copyright (C) 2022 Nordix
+
+.. |nbsp| unicode:: 0xA0
+   :trim:
+
+.. |nbh| unicode:: 0x2011
+   :trim:
+
+.. |yaml-icon| image:: ./images/yaml_logo.png
+                  :width: 40px
+
+========================
+Kafka Message Dispatcher
+========================
+
+API Documentation
+=================
+
+The O-RAN SC Kafka Message Dispatcher is a specific implementation of an A1 Simulator ref:`calloutserver`, which further redirects A1 Policy operations to a Kafka message topic, to be consumed by an external function. 
+
+A1 Policy are redirected as Kafka messages to a configured Kafka Topic to an external receiver, then responses from the external receiver are collected from another configured Kafka Topic. This provides a Kafka-based request-response abstraction for adding supplemental simulator behavior for particular A1 Policy Types. After a request message is sent, a response message will be expected within some configurable timeout interval (default: 30 sec). The topics to be used for particular A1 Policy Types is configured using a JSON map (Example: `policytype_to_topicmap.json <../near-rt-ric-simulator/test/KAFKA_DISPATCHER/resources/policytype_to_topicmap.json>` 
+
+**Note:** As with other A1 Simulator call-out servers, the Kafka message dispatcher functionality is only available for *'STD_2.0.0'* version simulators.
+
+The Kafka message dispatcher exposes a 'Kafka Message Dispatcher' REST API. This internal API is invoked directly by the A1 Simulator, and is not intended to be used by any other client.  This API is documented in `Kafka Message Dispatcher API <./KAFKA_DISPATCHER_api.html>`_ and in OpenAPI YAML format:
+
+.. csv-table::
+   :header: "API name", "|yaml-icon|"
+   :widths: 10,5
+
+   "Kafka Message Dispatcher API", ":download:`link <../near-rt-ric-simulator/test/KAFKA_DISPATCHER/api/KAFKA_DISPATCHER_api.yaml>`"
+
+The Kafka message dispatcher also exposes an 'Admin API' to manipulate the behavior of the Kafka message dispather itself. The 'Kafka Message Dispatcher Admin API' is documented below: 
+
+Admin Functions
+================
+
+Health Check
+------------
+
+GET
++++
+
+Returns the status of the Kafka Message Dispatcher.
+
+**URL path:**
+ /
+
+**Parameters:**
+  None.
+
+**Responses:**
+  200:
+    OK
+
+**Examples:**
+
+**Call**: ::
+
+  curl -X GET "http://localhost:7075/"
+
+**Result**:
+
+200: ::
+
+  OK
+
+
+Response manipulation
+---------------------
+It is possible to manipulate the response of all operations on the Kafka Message Dispatcher module
+
+POST
+++++
+
+Force a specific response code for the all (the next) Kafka Message Dispatcher module operations. Unless it is reset, it will always respond the same response code back.
+
+**URL path:**
+
+/dispatcheradmin/forceresponse?code=<http-response-code>
+
+**Parameters:**
+
+code: (*Required*)
+
+The HTTP response code to return.
+
+**Responses:**
+
+200:
+
+Force response code: <expected code> set for all all dispatcher response until it is resetted
+
+**Examples:**
+
+**Call**: ::
+
+  curl -X POST "http://localhost:7075/dispatcheradmin/forceresponse?code=500"
+
+**Result**:
+
+200: ::
+
+  Force response code: 500 set for all dispatcher response until it is resetted
+
+
+Reset response-manipulation
+---------------------------
+It is possible to reset the response manipulation on the Kafka Message Dispatcher module
+
+POST
+++++
+
+Clears specific response code for all (the next) Kafka Message Dispatcher module operation.
+
+**URL path:**
+
+/dispatcheradmin/forceresponse
+
+**Parameters:**
+
+code: (*Required*)
+
+The HTTP response code to return.
+
+**Responses:**
+
+200:
+
+Force response code has been resetted for dispatcher responses
+
+**Examples:**
+
+**Call**: ::
+
+  curl -X POST "http://localhost:7075/dispatcheradmin/forceresponse"
+
+**Result**:
+
+200: ::
+
+  Force response code has been resetted for dispatcher responses
+
+
+Response time manipulation
+--------------------------
+It is possible to set a period of time to delay response time.
+
+POST
+++++
+
+Force delayed response of all dispatcher responses. The setting will remain until the delay is cleared.
+
+**URL path:**
+
+/dispatcheradmin/forcedelay?delay=<delay-time-seconds>
+
+**Parameters:**
+
+delay: (*Required*)
+
+The time in seconds to delay all responses.
+
+**Responses:**
+
+200:
+
+Force delay: <expected_delay> sec set for all dispatcher responses until it is resetted
+
+**Examples:**
+
+**Call**: ::
+
+  curl -X POST "http://localhost:7075/dispatcheradmin/forcedelay?delay=5"
+
+**Result**:
+
+200: ::
+
+  Force delay: 5 sec set for all dispatcher responses until it is resetted
+
+
+Reset response time manipulation
+--------------------------------
+It is also possible to reset delay response time.
+
+POST
+++++
+
+The setting will clear the delay.
+
+**URL path:**
+
+/dispatcheradmin/forcedelay
+
+**Parameters:**
+
+None.
+
+The time in seconds to delay all responses.
+
+**Responses:**
+
+200:
+
+Force delay has been resetted for all dispatcher responses
+
+**Examples:**
+
+**Call**: ::
+
+  curl -X POST "http://localhost:7075/dispatcheradmin/forcedelay"
+
+**Result**:
+
+200: ::
+
+  Force delay has been resetted for all dispatcher responses
index f2e7251..9f605b0 100644 (file)
@@ -1,21 +1,21 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
-.. Copyright (C) 2021 Nordix
+.. Copyright (C) 2021-2022 Nordix
 
 =============
 Release-Notes
 =============
 
 
-This document provides the release notes for the release of the Near-RT RIC A1 Interface Simulator.
+This document provides the release notes for the release of the A1 Simulator (previously called Near-RT RIC A1 Interface).
 
 .. contents::
    :depth: 3
    :local:
 
 
-Version history Near-RT RIC A1 Interface Simulator
-==================================================
+Version history A1 Simulator (previously called Near-RT RIC A1 Interface)
+=========================================================================
 
 +------------+----------+------------------+----------------+
 | **Date**   | **Ver.** | **Author**       | **Comment**    |
index c9f9e99..235d592 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\):
 
@@ -224,11 +224,15 @@ Note that test can be performed both using the nonsecure http port and the secur
 
 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.sh duplicate-check|ignore-duplicate
 
-Build and start the simulator container: STD_2.0.0, using:
+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 ext-srv|ext-srv-secure|ignore-ext-srv
+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:
@@ -236,18 +240,32 @@ 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 for STD_1.1.3 and OSC_2.1.0 versions.
+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 like:
+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.
 
index 71638f4..002bde4 100644 (file)
@@ -255,4 +255,4 @@ components:
       content:
         application/problem+json:
           schema:
-            "$ref": "#/components/schemas/ProblemDetails"
\ No newline at end of file
+            "$ref": "#/components/schemas/ProblemDetails"
index 3fc49cb..f1c1f57 100644 (file)
@@ -1,6 +1,6 @@
-# O-RAN-SC External Server extension for Near-RealTime RIC Simulator
+# O-RAN-SC External Server extension for A1 Simulator
 
-The O-RAN SC external server is an extension for Near-RealTime RIC simulator. It creates an external web server building RESTful API. It is capable of recieving Rest calls from the northbound simulator version and responses back to it.
+The O-RAN SC external server is an extension for A1 simulator. It creates an external web server building RESTful API. It is capable of recieving Rest calls from the northbound simulator version and responses back to it.
 
 The external server supports GET, PUT and DELETE operations (version of the open API yaml file\):
 
index 72821cd..4765e81 100644 (file)
@@ -6,6 +6,9 @@ info:
     External test server.
     © 2022, O-RAN Alliance.
     All rights reserved.
+  license:
+    name: Copyright (C) 2022 Nordix Foundation. Licensed under the Apache License.
+    url: http://www.apache.org/licenses/LICENSE-2.0
 externalDocs:
   description: 'An external server building CRUD RestFUL APIs which is provisioned by A1 simulator. It will be a refrence point for the callouts'
   url: 'https://docs.o-ran-sc.org/projects/o-ran-sc-sim-a1-interface/en/latest/EXT_SRV_api.html'
diff --git a/near-rt-ric-simulator/test/KAFKA_DISPATCHER/.gitignore b/near-rt-ric-simulator/test/KAFKA_DISPATCHER/.gitignore
new file mode 100644 (file)
index 0000000..00f2c95
--- /dev/null
@@ -0,0 +1,16 @@
+# Documentation
+.idea/
+.tox
+docs/_build/
+.DS_STORE
+
+# IDE
+.project
+.vscode
+
+.coverage
+coverage.xml
+htmlcov/
+
+# Python virtual env
+venv/
diff --git a/near-rt-ric-simulator/test/KAFKA_DISPATCHER/README.md b/near-rt-ric-simulator/test/KAFKA_DISPATCHER/README.md
new file mode 100644 (file)
index 0000000..8b14200
--- /dev/null
@@ -0,0 +1,78 @@
+# O-RAN-SC Kafka Dispatcher Module extension for A1 Simulator
+
+The O-RAN SC dispatcher module is an extension for A1 simulator. It creates a web server building RESTful APIs. It is capable of recieving Rest calls from the northbound simulator version and respond back to it.
+
+The kafka dispatcher module supports GET, PUT and DELETE operations (version of the open API yaml file\):
+
+| Yaml file version          |     Version id      |
+| -------------------------- |-------------------- |
+| KAFKA_DISPATCHER_api.yaml  |      0.0.1          |
+
+The overall folder structure is \(relative to the location of this README file\):
+
+| Dir              | Description |
+| ---------------- | ----------- |
+|.                 |Dockerfile, tox.ini and README |
+|api               |The open api yaml |
+|src               |Python source code |
+|certificate       |A self-signed certificate and a key |
+|docs              |Auto generated API descriptions in HTML format |
+
+The dispatcher module handles the requests that are defined in the open API yaml file. All these requests are implemented in the dispatcher.py file in the src folder. In addition, a number of administrative functions are also supported and implemented by the main.py in the source folder.
+
+The section below outlines the supported open api rest-based operations as well as the adminstrative operations.
+
+# Ports and certificates
+
+The dispatcher module normally opens the port 7075 for http. If a certificate and a key are provided the kafka dispatcher module will open port 7175 for https instead. The port 7175 is only opened if a valid certificate and key is found.
+The certificate and key shall be placed in the same directory and the directory shall be mounted to /usr/src/app/cert in the container.
+
+| Port     | Protocol |
+| -------- | ----- |
+| 7075     | http  |
+| 7175     | https |
+
+The directory certificate contains a self-signed cert. Use the script generate_cert_and_key.sh to generate a new certificate and key. The password of the certificate must be set 'test'.
+The same urls are availables on both the http port 7075 and the https port 7175. If using curl and https, the flag -k shall be given to make curl ignore checking the certificate.
+
+# Supported operations in Kafka Dispatcher Module 0.0.1
+
+
+For the complete yaml specification, see [openapi.yaml](../api/KAFKA_DISPATCHER_api.yaml)
+
+URIs for server:
+
+| Function              | Path and parameters |
+| --------------------- | ------------------- |
+|  GET, Get the kafka request and response topic map corresponding to policy type | localhost:7075/policytypetotopicmapping/ANR |
+|  GET, Dispatch policy status query opertion as kafka message to kafka cluster | localhost:7075/policytypes/ANR/kafkadispatcher/alpha/status |
+|  PUT, Dispatch create and update operation as kafka message to kafka cluster | localhost:7075/policytypes/ANR/kafkadispatcher/alpha |
+|  DELETE, Dispatch policy delete opertion as kafka message to kafka cluster | localhost:7075/policytypes/ptype1/kafkadispatcher/alpha |
+
+URIs for admin operations:
+
+| Function              | Path and parameters |
+| --------------------- | ------------------- |
+|  GET, Get status of dispatcher module | http://localhost:7075/ |
+|  POST, Force a specific response code for all dispatcher module operations | localhost:7075/dispatcheradmin/forceresponse?code=500 |
+|  POST, Reset force response code | localhost:7075/dispatcheradmin/forceresponse |
+|  POST, Force delayed response of all dispatcher module operations | localhost:7075/dispatcheradmin/forcedelay?delay=5 |
+|  POST, Reset force delayed response | localhost:7075/dispatcheradmin/forcedelay |
+
+
+## License
+
+Copyright (C) 2022 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
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+For more information about license please see the [LICENSE](LICENSE.txt) file for details.
index 5480fbe..9e3cecb 100644 (file)
@@ -1,11 +1,12 @@
 openapi: 3.0.0
 info:
   title: 'Kafka message dispatcher for A1 interface'
-  version: 2.0.0
+  version: 0.0.1
   description: |
     Kafka message dispatcher server.
-    © 2022, O-RAN Alliance.
-    All rights reserved.
+  license:
+    name: Copyright (C) 2022 Nordix Foundation. Licensed under the Apache License.
+    url: http://www.apache.org/licenses/LICENSE-2.0
 externalDocs:
   description: 'RestFUL APIs that create and dispatch Kafka messages to Kafka brokers'
   url: 'https://docs.o-ran-sc.org/projects/o-ran-sc-sim-a1-interface/en/latest/index.html'