summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorEdyta Krukowska <edyta.krukowska@nokia.com>2021-03-02 14:44:48 +0100
committerEdyta Krukowska <edyta.krukowska@nokia.com>2021-03-09 14:20:04 +0100
commite5ba738691cf34f0d58a47796d6e0d3da7641f33 (patch)
treef0df24345a1fa3a3a860c406866ef64ad34a824c /README.md
parenta9292d1d05c313ba41a1401a3b5bcf3b8866b6aa (diff)
Move avcnsimulator to nf-simulator/avcn-manager
Issue-ID: INT-1869 Signed-off-by: Edyta Krukowska <edyta.krukowska@nokia.com> Change-Id: I5c0dcdf7bf67d0dac9ff7e77829890920f426b7d
Diffstat (limited to 'README.md')
-rw-r--r--README.md128
1 files changed, 128 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..45d8576
--- /dev/null
+++ b/README.md
@@ -0,0 +1,128 @@
+# AVCN Simulator
+Simulator that fetches changes of configuration from kafka and sends them to VES client.
+
+## What does it do?
+The simulator processes notifications from NETCONF server. It does this by being a subscriber of a Kafka topic that is fed
+with NETCONF notifications. The topic name is "config". Incoming notifications are then processed and output of this
+ processing is sent to VES client.
+
+### Processing details
+1. When last element contain value (equal sign) then cut it together with `'/'` from path and fill attributeList object with key equal to name of element before `'='` and value equal to element after `'='` keeping key and value quoted (`""`),
+2. Convert remaining `'/'` into `' , '` ,
+3. Convert all container types (without `[key='value']`) to `<container name>=<container name>`
+4. Convert all list types (with `[key='value']`) to `<list name>=<value>`
+````
+{containerA}/{listB}[{keyB}={valueB}]/{containerC}/{listD}[{keyD}={valueD}]/{[leaf, leaf-list]} = {value of leaf}
+
+{
+ "variables": {
+ "dn": " {containerA}={containerA} , {listB}={valueB} , {containerC}={containerC} , {listD}={valued}",
+ "attributesList": {
+ "{leaf, leaf-list}": "{value of leaf}"
+ }
+ }
+}
+````
+
+### VES client Request
+The resulting request to VES client looks like the following (the "dn" and "attributesList"
+ parameters are dependent on the actual NETCONF notification's value):
+````
+{
+ "simulatorParams": {
+ "repeatCount": 1,
+ "repeatInterval": 1,
+ "vesServerUrl": ""
+ },
+ "templateName": "notification.json",
+ "patch": {},
+ "variables": {
+ "dn": "",
+ "attributesList": {}
+ }
+}
+````
+
+### Examples
+````
+/example-sports:sports/person[name='name 1'] (list instance)
+
+{
+ "simulatorParams": { },
+ "templateName": "cmNotify.json",
+ "patch": { },
+ "variables": {
+ "dn":" example-sports:sports= example-sports:sports , person=name 1",
+ "attributesList": { }
+ }
+}
+````
+
+````
+/example-sports:sports/person[name='name 1']/name = name 1
+
+{
+ "simulatorParams": { },
+ "templateName": "cmNotify.json",
+ "patch": { },
+ "variables": {
+ "dn":" example-sports:sports= example-sports:sports , person=name 1",
+ "attributesList": { "name": "name 2" }
+ }
+}
+````
+
+````
+/example-sports:sports/person[name='name 2'] (list instance)
+
+{
+ "simulatorParams": { },
+ "templateName": "cmNotify.json",
+ "patch": { },
+ "variables": {
+ "dn":" example-sports:sports= example-sports:sports , person=name 2",
+ "attributesList": { }
+ }
+}
+````
+
+````
+/example-sports:sports/team[name='team 1']/player[name='player 1'] (list instance)
+
+{
+ "simulatorParams": { },
+ "templateName": "cmNotify.json",
+ "patch": { },
+ "variables": {
+ "dn":" example-sports:sports= example-sports:sports , player=player 1",
+ "attributesList": { }
+ }
+}
+````
+
+````
+/example-sports:sports/team[name='team 1']/player[name='player 1']/name = player 1
+{
+ "simulatorParams": { },
+ "templateName": "cmNotify.json",
+ "patch": { },
+ "variables": {
+ "dn":" example-sports:sports= example-sports:sports , player=player 1",
+ "attributesList": { "name": "player 1"”" }
+ }
+}
+````
+## Simulator configuration
+It's possible to override default configuration. Following environment variables can be set
+
+ KAFKA_BOOTSTRAP_SERVERS - Kafka host, by default kafka1:9092
+
+ KAFKA_APPLICATION_ID - An identifier for the stream processing application. Must be unique within the Kafka cluster.
+ By default avcn-simulator
+
+ KAFKA_SOURCE_TOPIC - Kafka topic, where Netconf simulator pushes notification, by default config
+
+ REST_CLIENT_PNF_SIMULATOR_ENDPOINT - VES client's URL, by default pnf-simulator:5000/simulator/start
+
+ REST_CLIENT_VES_ENDPOINT - VES URL, AVNC events will be send via VES client to this address
+