Demo of pm data/events to rapps

https://jira.o-ran-sc.org/browse/NONRTRIC-739

Signed-off-by: BjornMagnussonXA <bjorn.magnusson@est.tech>
Change-Id: I4990bd2b7a8394e4acc125bfe5c7e9fea47c99e3
diff --git a/pm-data-event-demo/group5/.env b/pm-data-event-demo/group5/.env
new file mode 100644
index 0000000..15b1834
--- /dev/null
+++ b/pm-data-event-demo/group5/.env
@@ -0,0 +1,18 @@
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2022 Nordix Foundation. All rights reserved.
+#  ========================================================================
+#  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.
+#  ============LICENSE_END=================================================
+#
+
+COMPOSE_PROJECT_NAME=group5
diff --git a/pm-data-event-demo/group5/addSubscriber.json b/pm-data-event-demo/group5/addSubscriber.json
new file mode 100644
index 0000000..4892251
--- /dev/null
+++ b/pm-data-event-demo/group5/addSubscriber.json
@@ -0,0 +1,20 @@
+{
+  "delivery": {
+    "url": "http://pmmapper:8081/delivery",
+    "user": "username",
+    "password": "password",
+    "use100": true
+  },
+  "follow_redirect": false,
+  "metadataOnly": false,
+  "suspend": false,
+  "groupid": 0,
+  "links": {
+    "self": "https://dmaap-dr-prov/subscribe/1",
+    "log": "https://dmaap-dr-prov/feedlog/1",
+    "feed": "https://dmaap-dr-prov/feed/1"
+  },
+  "subscriber": "pmmapper",
+  "decompress": true,
+  "privilegedSubscriber": true
+}
diff --git a/pm-data-event-demo/group5/config_dr.sh b/pm-data-event-demo/group5/config_dr.sh
new file mode 100755
index 0000000..75dc1be
--- /dev/null
+++ b/pm-data-event-demo/group5/config_dr.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+################################################################################
+#   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.                                             #
+################################################################################
+
+
+
+# Data Router Configuration.
+docker exec -i datarouter-prov sh -c "curl -sk  -X PUT https://dmaap-dr-prov:8443/internal/api/NODES?val=dmaap-dr-node\|$GATEWAY_IP"
+docker exec -i datarouter-prov sh -c "curl -sk  -X PUT https://dmaap-dr-prov:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$GATEWAY_IP"
+
+# Create PM Mapper feed on data router
+curl -s -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" --data-ascii @./group5/createFeed.json --post301 --location-trusted -k https://localhost:8543
+
+# PM Mapper subscriber on data router
+curl -s -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" --data-ascii @./group5/addSubscriber.json --post301 --location-trusted -k https://localhost:8543/subscribe/1
diff --git a/pm-data-event-demo/group5/createFeed.json b/pm-data-event-demo/group5/createFeed.json
new file mode 100644
index 0000000..493249a
--- /dev/null
+++ b/pm-data-event-demo/group5/createFeed.json
@@ -0,0 +1,19 @@
+{
+  "name": "PM Mapper Feed",
+  "version": "m1.0",
+  "description": "PM Mapper Feed",
+  "business_description": "PM Mapper",
+  "suspend": false,
+  "deleted": false,
+  "changeowner": true,
+  "authorization": {
+    "classification": "unclassified",
+    "endpoint_addrs": [],
+    "endpoint_ids": [
+      {
+        "password": "pmmapper",
+        "id": "pmmapper"
+      }
+    ]
+  }
+}
diff --git a/pm-data-event-demo/group5/docker-compose5.yaml b/pm-data-event-demo/group5/docker-compose5.yaml
new file mode 100644
index 0000000..de2aef3
--- /dev/null
+++ b/pm-data-event-demo/group5/docker-compose5.yaml
@@ -0,0 +1,89 @@
+version: '3.3'
+
+services:
+  datarouter-prov:
+    image: nexus3.onap.org:10003/onap/dmaap/datarouter-prov:2.1.10-STAGING-latest
+    container_name: datarouter-prov
+    hostname: dmaap-dr-prov
+    ports:
+     - "443:8443"
+     - "8543:8443"
+     - "8480:8080"
+    volumes:
+     - ./dr-mount/provserver.properties:/opt/app/datartr/etc/provserver.properties
+    depends_on:
+      - mariadb
+    healthcheck:
+      test: ["CMD", "curl", "-f", "http://dmaap-dr-prov:8080/internal/prov"]
+      interval: 10s
+      timeout: 10s
+      retries: 5
+    networks:
+      - smo
+    labels:
+      - "pmflowtest=cont"
+
+  datarouter-node:
+    image: nexus3.onap.org:10003/onap/dmaap/datarouter-node:2.1.10-STAGING-latest
+    container_name: datarouter-node
+    hostname: dmaap-dr-node
+    ports:
+     - "9443:8443"
+     - "9090:8080"
+    volumes:
+     - ./dr-mount/node.properties:/opt/app/datartr/etc/node.properties
+    depends_on:
+      - datarouter-prov
+    networks:
+      - smo
+    labels:
+      - "pmflowtest=cont"
+
+  mariadb:
+    image: nexus3.onap.org:10001/mariadb:10.2.14
+    container_name: mariadb
+    ports:
+      - "3306:3306"
+    environment:
+      MYSQL_ROOT_PASSWORD: datarouter
+      MYSQL_DATABASE: datarouter
+      MYSQL_USER: datarouter
+      MYSQL_PASSWORD: datarouter
+    healthcheck:
+      test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "--silent"]
+      interval: 10s
+      timeout: 30s
+      retries: 5
+    networks:
+      - smo
+    labels:
+      - "pmflowtest=cont"
+
+  pmmapper:
+    image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pm-mapper:1.8.0
+    container_name: pmmapper
+    ports:
+      - "8281:8081"
+    volumes:
+      - type: bind
+        source: ./pmmapper/certs
+        target: /opt/app/pm-mapper/etc/certs/
+      - type: bind
+        source: ./pmmapper/mount_config.yaml
+        target: /app-config/application_config.yaml
+    environment:
+      CONFIG_BINDING_SERVICE: 127.0.0.1
+      CONFIG_BINDING_SERVICE_SERVICE_PORT: 10000
+      CBS_CLIENT_CONFIG_PATH: /app-config/application_config.yaml
+      PROCESSING_LIMIT_RATE: 1
+      THREADS_MULTIPLIER: 1
+      PROCESSING_THREADS_COUNT: 1
+    networks:
+      - smo
+    labels:
+      - "pmflowtest=cont"
+
+networks:
+  smo:
+    external: true
+
diff --git a/pm-data-event-demo/group5/dr-mount/node.properties b/pm-data-event-demo/group5/dr-mount/node.properties
new file mode 100644
index 0000000..ddd4ebc
--- /dev/null
+++ b/pm-data-event-demo/group5/dr-mount/node.properties
@@ -0,0 +1,87 @@
+#-------------------------------------------------------------------------------
+# ============LICENSE_START==================================================
+# * org.onap.dmaap
+# * ===========================================================================
+# * Copyright � 2017 AT&T Intellectual Property. All rights reserved.
+# * ===========================================================================
+# * 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.
+# * ============LICENSE_END====================================================
+# *
+# * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+# *
+#-------------------------------------------------------------------------------
+#
+#    Configuration parameters set at startup for the DataRouter node
+#
+#    URL to retrieve dynamic configuration
+ProvisioningURL = https://dmaap-dr-prov:8443/internal/prov
+#
+#    URL to upload PUB/DEL/EXP logs
+LogUploadURL = https://dmaap-dr-prov:8443/internal/logs
+#
+#    The port number for http as seen within the server
+IntHttpPort = 8080
+#
+#    The port number for https as seen within the server
+IntHttpsPort = 8443
+#
+#    The external port number for https taking port mapping into account
+ExtHttpsPort = 443
+#
+#    The minimum interval between fetches of the dynamic configuration from the provisioning server
+MinProvFetchInterval = 10000
+#
+#    The minimum interval between saves of the redirection data file
+MinRedirSaveInterval = 10000
+#
+#    The path to the directory where log files are stored
+LogDir = /opt/app/datartr/logs
+#
+#    The retention interval (in days) for log files
+LogRetention = 30
+#
+#    The path to the directories where data and meta data files are stored
+SpoolDir = /opt/app/datartr/spool
+#
+#    The path to the redirection data file
+RedirectionFile = etc/redirections.dat
+#
+#    The type of keystore for https
+KeyStoreType = PKCS12
+#
+#    The type of truststore for https
+TrustStoreType = jks
+#
+#    The path to the file used to trigger an orderly shutdown
+QuiesceFile = etc/SHUTDOWN
+#
+#    The key used to generate passwords for node to node transfers
+NodeAuthKey = Node123!
+#
+#    DR_NODE DEFAULT ENABLED TLS PROTOCOLS
+NodeHttpsProtocols = TLSv1.1|TLSv1.2
+#
+#    AAF type to generate permission string
+AAFType = org.onap.dmaap-dr.feed
+#
+#    AAF default instance to generate permission string - default should be legacy
+AAFInstance = legacy
+#
+#    AAF action to generate permission string - default should be publish
+AAFAction = publish
+#
+#    AAF CADI enabled flag
+CadiEnabled = false
+#
+#    AAF Props file path
+AAFPropsFilePath = /opt/app/osaaf/local/org.onap.dmaap-dr.props
\ No newline at end of file
diff --git a/pm-data-event-demo/group5/dr-mount/provserver.properties b/pm-data-event-demo/group5/dr-mount/provserver.properties
new file mode 100644
index 0000000..c0e79bf
--- /dev/null
+++ b/pm-data-event-demo/group5/dr-mount/provserver.properties
@@ -0,0 +1,60 @@
+#-------------------------------------------------------------------------------
+# ============LICENSE_START==================================================
+# * org.onap.dmaap
+# * ===========================================================================
+# * Copyright � 2017 AT&T Intellectual Property. All rights reserved.
+# * ===========================================================================
+# * 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.
+# * ============LICENSE_END====================================================
+# *
+# * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+# *
+#-------------------------------------------------------------------------------
+
+#Jetty Server properties
+org.onap.dmaap.datarouter.provserver.http.port           = 8080
+org.onap.dmaap.datarouter.provserver.https.port          = 8443
+org.onap.dmaap.datarouter.provserver.https.relaxation    = true
+
+org.onap.dmaap.datarouter.provserver.aafprops.path       = /opt/app/osaaf/local/org.onap.dmaap-dr.props
+
+org.onap.dmaap.datarouter.provserver.accesslog.dir       = /opt/app/datartr/logs
+org.onap.dmaap.datarouter.provserver.spooldir            = /opt/app/datartr/spool
+org.onap.dmaap.datarouter.provserver.dbscripts           = /opt/app/datartr/etc/misc
+org.onap.dmaap.datarouter.provserver.logretention        = 30
+
+#DMAAP-597 (Tech Dept) REST request source IP auth
+# relaxation to accommodate OOM kubernetes deploy
+org.onap.dmaap.datarouter.provserver.isaddressauthenabled = false
+
+#Localhost address config
+org.onap.dmaap.datarouter.provserver.localhost = 127.0.0.1
+
+# Database access
+org.onap.dmaap.datarouter.db.driver   = org.mariadb.jdbc.Driver
+org.onap.dmaap.datarouter.db.url      = jdbc:mariadb://mariadb:3306/datarouter
+org.onap.dmaap.datarouter.db.login    = datarouter
+org.onap.dmaap.datarouter.db.password = datarouter
+
+# PROV - DEFAULT ENABLED TLS PROTOCOLS
+org.onap.dmaap.datarouter.provserver.https.include.protocols = TLSv1.1|TLSv1.2
+
+# AAF config
+org.onap.dmaap.datarouter.provserver.cadi.enabled = false
+
+org.onap.dmaap.datarouter.provserver.passwordencryption   = PasswordEncryptionKey#@$%^&1234#
+org.onap.dmaap.datarouter.provserver.aaf.feed.type        = org.onap.dmaap-dr.feed
+org.onap.dmaap.datarouter.provserver.aaf.sub.type         = org.onap.dmaap-dr.sub
+org.onap.dmaap.datarouter.provserver.aaf.instance         = legacy
+org.onap.dmaap.datarouter.provserver.aaf.action.publish   = publish
+org.onap.dmaap.datarouter.provserver.aaf.action.subscribe = subscribe
\ No newline at end of file
diff --git a/pm-data-event-demo/group5/pmmapper/certs/cert.jks b/pm-data-event-demo/group5/pmmapper/certs/cert.jks
new file mode 100644
index 0000000..33dc9a3
--- /dev/null
+++ b/pm-data-event-demo/group5/pmmapper/certs/cert.jks
Binary files differ
diff --git a/pm-data-event-demo/group5/pmmapper/certs/jks.pass b/pm-data-event-demo/group5/pmmapper/certs/jks.pass
new file mode 100644
index 0000000..ae8f7e7
--- /dev/null
+++ b/pm-data-event-demo/group5/pmmapper/certs/jks.pass
@@ -0,0 +1 @@
+Er1tmip;T4w[%1}YE?x{fN9v
\ No newline at end of file
diff --git a/pm-data-event-demo/group5/pmmapper/certs/trust.jks b/pm-data-event-demo/group5/pmmapper/certs/trust.jks
new file mode 100644
index 0000000..679c95a
--- /dev/null
+++ b/pm-data-event-demo/group5/pmmapper/certs/trust.jks
Binary files differ
diff --git a/pm-data-event-demo/group5/pmmapper/certs/trust.pass b/pm-data-event-demo/group5/pmmapper/certs/trust.pass
new file mode 100644
index 0000000..d3d01b0
--- /dev/null
+++ b/pm-data-event-demo/group5/pmmapper/certs/trust.pass
@@ -0,0 +1 @@
+583Ls;XF(qDQu3p!L22gyh1t
\ No newline at end of file
diff --git a/pm-data-event-demo/group5/pmmapper/mount_config.yaml b/pm-data-event-demo/group5/pmmapper/mount_config.yaml
new file mode 100644
index 0000000..d1f2631
--- /dev/null
+++ b/pm-data-event-demo/group5/pmmapper/mount_config.yaml
@@ -0,0 +1,36 @@
+pm-mapper-filter:
+#  filters:
+#    - pmDefVsn: "1.0"
+#      nfType: "gnb"
+#      vendor: "Nokia"
+#      measTypes:
+#      - attTCHSeizures
+#      - succTCHSeizures2
+#      - succImmediateAssignProcs8
+   filters: [] #disabling filters
+key_store_path: "/opt/app/pm-mapper/etc/certs/cert.jks"
+key_store_pass_path: "/opt/app/pm-mapper/etc/certs/jks.pass"
+trust_store_path: "/opt/app/pm-mapper/etc/certs/trust.jks"
+trust_store_pass_path: "/opt/app/pm-mapper/etc/certs/trust.pass"
+dmaap_dr_delete_endpoint: "https://dmaap-dr-node:8443/delete"
+dmaap_dr_feed_name: "1"
+aaf_identity: "aaf_admin@people.osaaf.org"
+aaf_password: "demo123456!"
+enable_http: true
+streams_publishes:
+  dmaap_publisher:
+    type: "message_router"
+    dmaap_info:
+      topic_url: "http://onap-dmaap:3904/events/org.onap.dmaap.mr.VES_PM"
+      client_role: "org.onap.dcae.pmPublisher"
+      location: "csit-pmmapper"
+      client_id: "1562763644939"
+streams_subscribes:
+  dmaap_subscriber:
+    type: "data_router"
+    dmaap_info:
+      username: "username"
+      password: "password"
+      location: "csit-pmmapper"
+      delivery_url: "http://pmmapper:8081/delivery"
+      subscriber_id: 1