diff options
30 files changed, 992 insertions, 0 deletions
diff --git a/tools/development/Makefile b/tools/development/Makefile new file mode 100644 index 0000000..fc5cf39 --- /dev/null +++ b/tools/development/Makefile @@ -0,0 +1,38 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2021 NOKIA +# ================================================================================ +# 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========================================================= + +setup-all: setup-local run-pm-mapper config-dmaap subscribe-pm-mapper + +test: + @echo test + +setup-local: + @./setup-local.sh + +run-pm-mapper: + @./run-pm-mapper.sh + +config-dmaap: + @./config-dmaap.sh + +subscribe-pm-mapper: + @./subscribe-pm-mapper.sh + +clean-env: + @./clean-environment.sh + +list-files: + @ls files-publisher/files diff --git a/tools/development/README.md b/tools/development/README.md new file mode 100644 index 0000000..8c3dad8 --- /dev/null +++ b/tools/development/README.md @@ -0,0 +1,80 @@ +#PM-Mapper local development +This projects is based on pm-mapper CSIT aligned for local development + +##Run pm-mapper locally +To run pm-mapper execute following scripts +``` +make setup-all +``` +To change pm-mapper image go to script 'run-pm-mapper.sh' and edit': +``` +IMAGE=onap/org.onap.dcaegen2.services.pm-mapper:latest +``` + +To clean environment (remove all containers): +``` +make clean-env +``` + +##Send sample file + +1. To list avaiable files use: +``` +make list-files +``` + +2 a. To send MeasDataFile Enter to files publisher containers and go to files directory: +``` +./send-meas-data.sh <file name> +``` +E.g: +``` +./send-meas-data.sh C20190329.0000-0015.xml.gz +``` +MeasDataFile Examples: + +- C20190329.0000-0015.xml.gz +- PM202007171301+020024C202007171207+0200-1215+0200_45678.xml.gz + +2 b. To send MeasCollec file use: +``` +./send-meas-collec.sh A20181002.0000-1000-0015-1000_5G.xml +``` + +MeasCollec Examples: + +- A20181002.0000-1000-0015-1000_5G.xml.gz + +## HINTS: +File names must start with 'A', 'C' or 'PM' + +Files xml should be zipped by gzip. To send raw xml a small alignment is necessary: +Go to './send-meas-data.sh' or './send-meas-collec.sh' and change endpoint: +``` +https://dmaap-dr-node:8443/publish/1/Apm_TEST_REQUEST.xml.gz +``` +to: +``` +https://dmaap-dr-node:8443/publish/1/Apm_TEST_REQUEST.xml +``` + +To gzip file use: +``` +gzip -k <filename> +``` + +##Container logs: + +### PM-Mapper logs: +``` +docker logs -f pmmapper +``` + +### Message-Router simulator logs (output of processed messages by PM-Mapper): +``` +docker logs -f mr-simulator +``` + + +#####Info: +Certificate validity - 2023 August diff --git a/tools/development/certs/cert.jks b/tools/development/certs/cert.jks Binary files differnew file mode 100644 index 0000000..33dc9a3 --- /dev/null +++ b/tools/development/certs/cert.jks diff --git a/tools/development/certs/jks.pass b/tools/development/certs/jks.pass new file mode 100644 index 0000000..ae8f7e7 --- /dev/null +++ b/tools/development/certs/jks.pass @@ -0,0 +1 @@ +Er1tmip;T4w[%1}YE?x{fN9v
\ No newline at end of file diff --git a/tools/development/certs/trust.jks b/tools/development/certs/trust.jks Binary files differnew file mode 100644 index 0000000..679c95a --- /dev/null +++ b/tools/development/certs/trust.jks diff --git a/tools/development/certs/trust.pass b/tools/development/certs/trust.pass new file mode 100644 index 0000000..d3d01b0 --- /dev/null +++ b/tools/development/certs/trust.pass @@ -0,0 +1 @@ +583Ls;XF(qDQu3p!L22gyh1t
\ No newline at end of file diff --git a/tools/development/clean-environment.sh b/tools/development/clean-environment.sh new file mode 100755 index 0000000..22fe370 --- /dev/null +++ b/tools/development/clean-environment.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# Copyright (C) 2021 NOKIA +# ================================================================================ +# 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========================================================= +source ./env/containers_ip + +docker stop pmmapper +docker rm pmmapper +docker-compose down diff --git a/tools/development/config-dmaap.sh b/tools/development/config-dmaap.sh new file mode 100755 index 0000000..a06d883 --- /dev/null +++ b/tools/development/config-dmaap.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# Copyright (C) 2021 NOKIA +# ================================================================================ +# 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========================================================= +source ./env/containers_ip + +#Data Router healthcheck +echo "Waiting for DataRouter ready" +for i in $(seq 10); do + curl -sf 'http://localhost:8080/internal/prov' -o /dev/null + curl_status=$? + if [ curl_status -eq 0 ]; then + break + else + sleep 2 + fi +done + +# Data Router Configuration. +docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$GATEWAY_IP" +docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$GATEWAY_IP" + +# Create PM Mapper feed on data router +curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" --data-ascii @./resources/createFeed.json --post301 --location-trusted -k https://localhost:8443 diff --git a/tools/development/docker-compose.yml b/tools/development/docker-compose.yml new file mode 100644 index 0000000..ac30ec4 --- /dev/null +++ b/tools/development/docker-compose.yml @@ -0,0 +1,116 @@ +version: '3.3' + +services: + datarouter-prov: + image: nexus3.onap.org:10001/onap/dmaap/datarouter-prov + container_name: datarouter-prov + hostname: dmaap-dr-prov + ports: + - "443:8443" + - "8443:8443" + - "8080: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: + pmmapper-network: + ipv4_address: $DR_PROV_IP + extra_hosts: + - "dmaap-dr-node:$DR_NODE_IP" + - "dcae-pm-mapper:$PMMAPPER_IP" + + datarouter-node: + image: nexus3.onap.org:10001/onap/dmaap/datarouter-node + 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: + pmmapper-network: + ipv4_address: $DR_NODE_IP + extra_hosts: + - "dmaap-dr-prov:$DR_PROV_IP" + - "dcae-pm-mapper:$PMMAPPER_IP" + + node: + image: nexus3.onap.org:10001/node:10-slim + container_name: mr-simulator + volumes: + - ./message-router/mrserver.js:/tmp/mrserver.js + command: + nodejs /tmp/mrserver.js + networks: + pmmapper-network: + ipv4_address: $NODE_IP + + 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: + pmmapper-network: + ipv4_address: $MARIADB_IP + + consul: + container_name: consul + image: nexus3.onap.org:10001/consul:latest + ports: + - "8500:8500" + networks: + pmmapper-network: + ipv4_address: $CONSUL_IP + + cbs: + container_name: cbs + image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding.app-app:latest + environment: + CONSUL_HOST: $CONSUL_IP + networks: + pmmapper-network: + ipv4_address: $CBS_IP + + + files-publisher: + container_name: files-publisher + build: + context: . + dockerfile: files-publisher/Dockerfile + volumes: + - ./files-publisher/files/:/files/ + extra_hosts: + - "dmaap-dr-prov:$DR_PROV_IP" + - "dmaap-dr-node:$DR_NODE_IP" + networks: + pmmapper-network: + ipv4_address: $FILES_PUBLISHER_IP + + +networks: + pmmapper-network: + driver: bridge + ipam: + config: + - subnet: 172.18.0.0/16 + diff --git a/tools/development/dr-mount/node.properties b/tools/development/dr-mount/node.properties new file mode 100644 index 0000000..ddd4ebc --- /dev/null +++ b/tools/development/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/tools/development/dr-mount/provserver.properties b/tools/development/dr-mount/provserver.properties new file mode 100644 index 0000000..e242991 --- /dev/null +++ b/tools/development/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://172.18.0.6: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/tools/development/env/containers_ip b/tools/development/env/containers_ip new file mode 100755 index 0000000..b09ce01 --- /dev/null +++ b/tools/development/env/containers_ip @@ -0,0 +1,26 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# Copyright (C) 2021 NOKIA +# ================================================================================ +# 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========================================================= + +export GATEWAY_IP=172.18.0.1 +export DR_NODE_IP=172.18.0.2 +export DR_PROV_IP=172.18.0.3 +export CONSUL_IP=172.18.0.4 +export CBS_IP=172.18.0.5 +export MARIADB_IP=172.18.0.6 +export NODE_IP=172.18.0.7 +export PMMAPPER_IP=172.18.0.8 +export FILES_PUBLISHER_IP=172.18.0.9 diff --git a/tools/development/files-publisher/Dockerfile b/tools/development/files-publisher/Dockerfile new file mode 100644 index 0000000..23a275e --- /dev/null +++ b/tools/development/files-publisher/Dockerfile @@ -0,0 +1,9 @@ +FROM nexus3.onap.org:10001/alpine:latest + +RUN apk add --update curl +RUN rm -rf /var/cache/apk/* +ENV http_proxy="" +ENV https_proxy="" +ENV HTTP_PROXY="" +ENV HTTPS_PROXY="" +ENTRYPOINT ["/bin/sh", "-c", " while true; do sleep 30; done;"] diff --git a/tools/development/files-publisher/files/A20181002.0000-1000-0015-1000_5G.xml b/tools/development/files-publisher/files/A20181002.0000-1000-0015-1000_5G.xml new file mode 100644 index 0000000..fadc8a6 --- /dev/null +++ b/tools/development/files-publisher/files/A20181002.0000-1000-0015-1000_5G.xml @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?xml-stylesheet type="text/xsl" href="MeasDataCollection.xsl"?> +<measCollecFile xmlns="http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xsi:schemaLocation="http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec"> + <fileHeader fileFormatVersion="32.435 V7.0" vendorName="Company NN" dnPrefix="DC=a1.companyNN.com,SubNetwork=1,IRPAgent=1"> + <fileSender localDn="SubNetwork=CountryNN,MeContext=MEC-Gbg-1,ManagedElement=RNC-Gbg-1" elementType="RNC"/> + <measCollec beginTime="2000-03-01T14:00:00+02:00"/> + </fileHeader> + <measData> + <managedElement localDn="SubNetwork=CountryNN,MeContext=MEC-Gbg-1,ManagedElement=RNC-Gbg-1" userLabel="RNC Telecomville"/> + <measInfo> + <job jobId="1231"/> + <granPeriod duration="PT900S" endTime="2000-03-01T14:14:30+02:00"/> + <repPeriod duration="PT1800S"/> + <measType p="1">attTCHSeizures</measType> + <measType p="2">succTCHSeizures</measType> + <measType p="3">attImmediateAssignProcs</measType> + <measType p="4">succImmediateAssignProcs</measType> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-997"> + <r p="1">234</r> + <r p="2">345</r> + <r p="3">567</r> + <r p="4">789</r> + </measValue> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-998"> + <r p="1">890</r> + <r p="2">901</r> + <r p="3">123</r> + <r p="4">234</r> + </measValue> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-999"> + <r p="1">456</r> + <r p="2">567</r> + <r p="3">678</r> + <r p="4">789</r> + <suspect>true</suspect> + </measValue> + </measInfo> + <measInfo measInfoId="ENodeBFunction"> + <job jobId="1232"/> + <granPeriod duration="PT900S" endTime="2000-03-01T14:14:30+02:00"/> + <repPeriod duration="PT1800S"/> + <measType p="1">attTCHSeizures1</measType> + <measType p="2">succTCHSeizures2</measType> + <measType p="3">attImmediateAssignProcs3</measType> + <measType p="4">succImmediateAssignProcs4</measType> + <measValue measObjLdn="ManagedElement=RNC-Gbg-1,ENodeBFunction=1"> + <r p="1">4</r> + <r p="2">86,87,2,6,77,96,75,33,24</r> + <r p="3">40</r> + <r p="4">90</r> + <suspect>false</suspect> + </measValue> + </measInfo> + <measInfo> + <job jobId="1233"/> + <granPeriod duration="PT900S" endTime="2000-03-01T14:14:30+02:00"/> + <repPeriod duration="PT1800S"/> + <measType p="1">attTCHSeizures5</measType> + <measType p="2">succTCHSeizures6</measType> + <measType p="3">attImmediateAssignProcs7</measType> + <measType p="4">succImmediateAssignProcs8</measType> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-997"> + <r p="1">238</r> + <r p="2">344</r> + <r p="3">563</r> + <r p="4">787</r> + </measValue> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-998"> + <r p="1">898</r> + <r p="2">905</r> + <r p="3">127</r> + <r p="4">238</r> + </measValue> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-999"> + <r p="1">454</r> + <r p="2">569</r> + <r p="3">672</r> + <r p="4">785</r> + <suspect>true</suspect> + </measValue> + </measInfo> + </measData> + <fileFooter> + <measCollec endTime="2000-03-01T14:15:00+02:00"/> + </fileFooter> +</measCollecFile> diff --git a/tools/development/files-publisher/files/A20181002.0000-1000-0015-1000_5G.xml.gz b/tools/development/files-publisher/files/A20181002.0000-1000-0015-1000_5G.xml.gz Binary files differnew file mode 100644 index 0000000..32865fc --- /dev/null +++ b/tools/development/files-publisher/files/A20181002.0000-1000-0015-1000_5G.xml.gz diff --git a/tools/development/files-publisher/files/C20190329.0000-0015.xml b/tools/development/files-publisher/files/C20190329.0000-0015.xml new file mode 100644 index 0000000..9c1b985 --- /dev/null +++ b/tools/development/files-publisher/files/C20190329.0000-0015.xml @@ -0,0 +1,49 @@ +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> + <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd" + fileFormatVersion="28.532 V1.0"> + <fileSender senderName="Dublin"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> + </fileHeader> + <measData> + <measEntity swVersion="r0.1" localDn="Dublin1"/> + <measInfo measInfoId="measInfoId1"> + <job jobId="jobId1"/> + <granPeriod endTime="2001-10-02T12:15:00Z" duration="PT100S"/> + <repPeriod duration="PT100S"/> + <measTypes>z1 a1 zz1 b1</measTypes> + <measValue measObjLdn="objLdn"> + <measResults>1 11 111 1111</measResults> + <suspect>false</suspect> + </measValue> + </measInfo> + </measData> + <measData> + <measEntity swVersion="r0.2" localDn="Dublin2"/> + <measInfo measInfoId="measInfoId2"> + <job jobId="jobId"/> + <granPeriod endTime="2002-10-02T12:15:00Z" duration="PT200S"/> + <repPeriod duration="PT200S"/> + <measTypes>attTCHSeizures succTCHSeizures2 zz2 b2</measTypes> + <measValue measObjLdn="objLdn"> + <measResults>2 22 222 2222</measResults> + <suspect>false</suspect> + </measValue> + </measInfo> + </measData> + <measData> + <measEntity swVersion="r0.3" localDn="Dublin3"/> + <measInfo measInfoId="measInfoId3"> + <job jobId="jobId"/> + <granPeriod endTime="2003-10-02T12:15:00Z" duration="PT300S"/> + <repPeriod duration="PT300S"/> + <measTypes>z3 a3 zz3 succImmediateAssignProcs8</measTypes> + <measValue measObjLdn="objLdn"> + <measResults>3 33 333 3333</measResults> + <suspect>false</suspect> + </measValue> + </measInfo> + </measData> + <fileFooter> + <measData endTime="2018-10-02T12:15:00+01:00"/> + </fileFooter> +</measDataFile> diff --git a/tools/development/files-publisher/files/C20190329.0000-0015.xml.gz b/tools/development/files-publisher/files/C20190329.0000-0015.xml.gz Binary files differnew file mode 100644 index 0000000..bf981d5 --- /dev/null +++ b/tools/development/files-publisher/files/C20190329.0000-0015.xml.gz diff --git a/tools/development/files-publisher/files/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml b/tools/development/files-publisher/files/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml new file mode 100644 index 0000000..8d42d62 --- /dev/null +++ b/tools/development/files-publisher/files/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?xml-stylesheet type="text/xsl" href="MeasDataCollection.xsl"?> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xsi:schemaLocation="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> + <fileHeader fileFormatVersion="28.532 V7.0" vendorName="Company NN" dnPrefix="DC=a1.companyNN.com,SubNetwork=1,IRPAgent=1"> + <fileSender senderName="SubNetwork=CountryNN,MeContext=MEC-Gbg-1,ManagedElement=RNC-Gbg-1"/> + <measData beginTime="2000-03-01T14:00:00+02:00"/> + </fileHeader> + <measData> + <measEntity localDn="SubNetwork=CountryNN,MeContext=MEC-Gbg-1,ManagedElement=RNC-Gbg-1" userLabel="RNC Telecomville"/> + <measInfo> + <job jobId="1231"/> + <granPeriod duration="PT900S" endTime="2000-03-01T14:14:30+02:00"/> + <repPeriod duration="PT1800S"/> + <measType p="1">attTCHSeizures</measType> + <measType p="2">succTCHSeizures</measType> + <measType p="3">attImmediateAssignProcs</measType> + <measType p="4">succImmediateAssignProcs</measType> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-997"> + <r p="1">234</r> + <r p="2">345</r> + <r p="3">567</r> + <r p="4">789</r> + </measValue> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-998"> + <r p="1">890</r> + <r p="2">901</r> + <r p="3">123</r> + <r p="4">234</r> + </measValue> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-999"> + <r p="1">456</r> + <r p="2">567</r> + <r p="3">678</r> + <r p="4">789</r> + <suspect>true</suspect> + </measValue> + </measInfo> + <measInfo measInfoId="ENodeBFunction"> + <job jobId="1232"/> + <granPeriod duration="PT900S" endTime="2000-03-01T14:14:30+02:00"/> + <repPeriod duration="PT1800S"/> + <measType p="1">attTCHSeizures1</measType> + <measType p="2">succTCHSeizures2</measType> + <measType p="3">attImmediateAssignProcs3</measType> + <measType p="4">succImmediateAssignProcs4</measType> + <measValue measObjLdn="ManagedElement=RNC-Gbg-1,ENodeBFunction=1"> + <r p="1">4</r> + <r p="2">86,87,2,6,77,96,75,33,24</r> + <r p="3">40</r> + <r p="4">90</r> + <suspect>false</suspect> + </measValue> + </measInfo> + <measInfo> + <job jobId="1233"/> + <granPeriod duration="PT900S" endTime="2000-03-01T14:14:30+02:00"/> + <repPeriod duration="PT1800S"/> + <measType p="1">attTCHSeizures5</measType> + <measType p="2">succTCHSeizures6</measType> + <measType p="3">attImmediateAssignProcs7</measType> + <measType p="4">succImmediateAssignProcs8</measType> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-997"> + <r p="1">238</r> + <r p="2">344</r> + <r p="3">563</r> + <r p="4">787</r> + </measValue> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-998"> + <r p="1">898</r> + <r p="2">905</r> + <r p="3">127</r> + <r p="4">238</r> + </measValue> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-999"> + <r p="1">454</r> + <r p="2">569</r> + <r p="3">672</r> + <r p="4">785</r> + <suspect>true</suspect> + </measValue> + </measInfo> + </measData> + <fileFooter> + <measData endTime="2000-03-01T14:15:00+02:00"/> + </fileFooter> +</measDataFile> diff --git a/tools/development/files-publisher/files/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml.gz b/tools/development/files-publisher/files/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml.gz Binary files differnew file mode 100644 index 0000000..9d1add1 --- /dev/null +++ b/tools/development/files-publisher/files/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml.gz diff --git a/tools/development/message-router/mrserver.js b/tools/development/message-router/mrserver.js new file mode 100644 index 0000000..ace7f9b --- /dev/null +++ b/tools/development/message-router/mrserver.js @@ -0,0 +1,49 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nokia. + * ================================================================================ + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +var httpServer = function () { + var http = require('http'), + + start = function (port) { + var server = http.createServer(function (req, res) { + processHttpRequest(req, res); + }); + server.listen(port, function () { + console.log('Listening on ' + port + '...'); + }); + }, + + processHttpRequest = function (req, res) { + res.writeHead(200, {'Content-Type': 'text/plain'}); + console.log('Received message'); + req.on('data', chunk => { + console.log(`-----MESSAGE_CONTENT_BEGIN-----\n ${chunk}`); + console.log('-----MESSAGE_CONTENT_END-----'); + }); + setTimeout(() => { + res.end('Published' + ' Successfully.\n'); + }, 100) + }; + + return { + start: start + } +}(); + +httpServer.start(3904); diff --git a/tools/development/resources/addSubscriber.json b/tools/development/resources/addSubscriber.json new file mode 100644 index 0000000..0666a7d --- /dev/null +++ b/tools/development/resources/addSubscriber.json @@ -0,0 +1,20 @@ +{ + "delivery":{ + "url":"http://dcae-pm-mapper: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 + }
\ No newline at end of file diff --git a/tools/development/resources/cbs.json b/tools/development/resources/cbs.json new file mode 100644 index 0000000..5e0b943 --- /dev/null +++ b/tools/development/resources/cbs.json @@ -0,0 +1,7 @@ +{ + "ID": "cbs", + "Name": "config_binding_service", + "Tags": ["cbs"], + "Address": "", + "Port": 10000 +}
\ No newline at end of file diff --git a/tools/development/resources/config.json b/tools/development/resources/config.json new file mode 100644 index 0000000..3f1009d --- /dev/null +++ b/tools/development/resources/config.json @@ -0,0 +1,35 @@ +{ + "pm-mapper-filter": { "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://message-router: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://dcae-pm-mapper:8081/delivery", + "subscriber_id": 1 + } + } + } +}
\ No newline at end of file diff --git a/tools/development/resources/createFeed.json b/tools/development/resources/createFeed.json new file mode 100644 index 0000000..f93633d --- /dev/null +++ b/tools/development/resources/createFeed.json @@ -0,0 +1,18 @@ +{ + "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" + }] + } + }
\ No newline at end of file diff --git a/tools/development/restart-pm-mapper.sh b/tools/development/restart-pm-mapper.sh new file mode 100755 index 0000000..3574dd5 --- /dev/null +++ b/tools/development/restart-pm-mapper.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# Copyright (C) 2021 NOKIA +# ================================================================================ +# 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========================================================= +source ./env/containers_ip + +docker restart pmmapper + + diff --git a/tools/development/run-pm-mapper.sh b/tools/development/run-pm-mapper.sh new file mode 100755 index 0000000..0a01243 --- /dev/null +++ b/tools/development/run-pm-mapper.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# Copyright (C) 2021 NOKIA +# ================================================================================ +# 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========================================================= +source ./env/containers_ip +IMAGE=onap/org.onap.dcaegen2.services.pm-mapper:latest + +docker run -d -p 8081:8081 \ + --mount type=bind,source="$PWD/certs",target="/opt/app/pm-mapper/etc/certs/" \ + -e "CONFIG_BINDING_SERVICE_SERVICE_HOST=$CBS_IP" \ + -e "CONFIG_BINDING_SERVICE_SERVICE_PORT=10000" \ + -e "HOSTNAME=pmmapper" \ + -e "PROCESSING_LIMIT_RATE=1" \ + -e "THREADS_MULTIPLIER=1" \ + -e "PROCESSING_THREADS_COUNT=1" \ + --add-host "dmaap-dr-node:$DR_NODE_IP" \ + --add-host "message-router:$NODE_IP" \ + --network=development_pmmapper-network \ + --name=pmmapper $IMAGE diff --git a/tools/development/send-meas-collec.sh b/tools/development/send-meas-collec.sh new file mode 100755 index 0000000..3358eda --- /dev/null +++ b/tools/development/send-meas-collec.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# Copyright (C) 2021 NOKIA +# ================================================================================ +# 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========================================================= +PUBLISH_FILE_NAME=$1 + +MEAS_COLLEC_META_DATA_HEADER="X-DMAAP-DR-META:{\"productName\":\"gnb\",\"vendorName\":\"Nokia\",\"lastEpochMicrosec\":\"1538478000000\",\"sourceName\":\"oteNB5309\",\"startEpochMicrosec\":\"1538478900000\",\"timeZoneOffset\":\"UTC+05.00\",\"location\":\"ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz\",\"compression\":\"gzip\",\"fileFormatType\":\"org.3GPP.32.435#measCollec\",\"fileFormatVersion\":\"V9\"}" +docker exec -it files-publisher curl -v -L -k -X PUT -H "Content-Type:application/octet-stream" -H "X-ONAP-RequestID:X-ONAP-RequestID=15" -H "${MEAS_COLLEC_META_DATA_HEADER}" -H "X-DMAAP-DR-ON-BEHALF-OF:pm-mapper" -H "Authorization:Basic cG1tYXBwZXI6cG1tYXBwZXI=" --data-binary @"/files/${PUBLISH_FILE_NAME}" https://dmaap-dr-node:8443/publish/1/Apm_TEST_REQUEST.xml.gz + + diff --git a/tools/development/send-meas-data.sh b/tools/development/send-meas-data.sh new file mode 100755 index 0000000..79e0939 --- /dev/null +++ b/tools/development/send-meas-data.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# Copyright (C) 2021 NOKIA +# ================================================================================ +# 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========================================================= +PUBLISH_FILE_NAME=$1 + +MEAS_DATA_META_DATA_HEADER="X-DMAAP-DR-META:{\"productName\":\"gnb\",\"vendorName\":\"Nokia\",\"lastEpochMicrosec\":\"1538478000000\",\"sourceName\":\"oteNB5309\",\"startEpochMicrosec\":\"1538478900000\",\"timeZoneOffset\":\"UTC+05.00\",\"location\":\"ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz\",\"compression\":\"gzip\",\"fileFormatType\":\"org.3GPP.28.532#measData\",\"fileFormatVersion\":\"V9\"}" +docker exec -it files-publisher curl -v -L -k -X PUT -H "Content-Type:application/octet-stream" -H "X-ONAP-RequestID:X-ONAP-RequestID=15" -H "${MEAS_DATA_META_DATA_HEADER}" -H "X-DMAAP-DR-ON-BEHALF-OF:pm-mapper" -H "Authorization:Basic cG1tYXBwZXI6cG1tYXBwZXI=" --data-binary @"/files/${PUBLISH_FILE_NAME}" https://dmaap-dr-node:8443/publish/1/Apm_TEST_REQUEST.xml.gz + + diff --git a/tools/development/setup-local.sh b/tools/development/setup-local.sh new file mode 100755 index 0000000..8dae91f --- /dev/null +++ b/tools/development/setup-local.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# Copyright (C) 2021 NOKIA +# ================================================================================ +# 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========================================================= +SCRIPT_DIR=$PWD + +source ./env/containers_ip + +sed -i 's/datarouter-mariadb/'$MARIADB_IP'/g' $SCRIPT_DIR/dr-mount/provserver.properties + +docker-compose -f $SCRIPT_DIR/docker-compose.yml up -d mariadb consul cbs node files-publisher + +echo "Waiting for MariaDB to come up healthy..." +for i in {1..30}; do + mariadb_state=$(docker inspect --format='{{json .State.Health.Status}}' mariadb) + if [ $mariadb_state = '"healthy"' ] + then + break + else + sleep 2 + fi +done +[ "$mariadb_state" != '"healthy"' ] && echo "Error: MariaDB container state not healthy" && exit 1 + +docker-compose -f $SCRIPT_DIR/docker-compose.yml up -d datarouter-node datarouter-prov + +#Config Consul +curl --request PUT --data @$SCRIPT_DIR/resources/cbs.json http://$CONSUL_IP:8500/v1/agent/service/register +curl 'http://'$CONSUL_IP':8500/v1/kv/pmmapper?dc=dc1' -X PUT \ + -H 'Accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'X-Requested-With: XMLHttpRequest' \ + --data @$SCRIPT_DIR/resources/config.json + diff --git a/tools/development/subscribe-pm-mapper.sh b/tools/development/subscribe-pm-mapper.sh new file mode 100755 index 0000000..bbc775e --- /dev/null +++ b/tools/development/subscribe-pm-mapper.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# Copyright (C) 2021 NOKIA +# ================================================================================ +# 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========================================================= +source ./env/containers_ip + +# PM Mapper subscriber on data router + +curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" --data-ascii @./resources/addSubscriber.json --post301 --location-trusted -k https://localhost:8443/subscribe/1 |