Add support to push a different file ready event format 23/14223/2
authoraravind.est <aravindhan.a@est.tech>
Fri, 7 Mar 2025 16:54:50 +0000 (16:54 +0000)
committeraravind.est <aravindhan.a@est.tech>
Fri, 7 Mar 2025 17:04:59 +0000 (17:04 +0000)
Support to push TS28532 file ready event format added

Issue-ID: NONRTRIC-1047
Change-Id: Ia466d8d9d23fe3ff2e3499ae410429c515ad3ca6
Signed-off-by: aravind.est <aravindhan.a@est.tech>
install/helm/nrt-pm/charts/dfc/config/application.yaml
install/scripts/kafka-client-send-genfiles-file-ready.sh
install/scripts/push-genfiles-to-file-ready-topic.sh

index ec9ca2c..49e0e09 100644 (file)
@@ -1,5 +1,6 @@
 #  ============LICENSE_START===============================================
 #  Copyright (C) 2023 Nordix Foundation. All rights reserved.
+#  Copyright (C) 2023-2025 OpenInfra Foundation Europe. 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.
@@ -49,6 +50,9 @@ app:
   number-of-worker-treads: 50
    # If the file name is empty, no authorization token is used
   auth-token-file: /token-cache/jwt.txt
+  # If specified, this value will be used as a class to map the fileready event from kafka
+  # If this is empty, default filereadymessage class will be used
+  file-ready-message-class:
    # KAFKA boostrap servers. This is only needed if there are Information Types that uses a kafkaInputTopic
   # several redundant boostrap servers can be specified, separated by a comma ','.
   kafka:
index 61c5297..b14f0e7 100755 (executable)
@@ -2,6 +2,7 @@
 
 #  ============LICENSE_START===============================================
 #  Copyright (C) 2023 Nordix Foundation. All rights reserved.
+#  Copyright (C) 2023-2025 OpenInfra Foundation Europe. 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.
@@ -71,6 +72,8 @@ if [ $VARIANT == "ves" ]; then
     PUSHMSG="to ves-collector"
 elif [ $VARIANT == "file-ready" ]; then
     PUSHMSG="to file-ready topic"
+elif [ $VARIANT == "file-ready-ts28532" ]; then
+    PUSHMSG="to file-ready topic"
 fi
 
 # Unix time of 20230515.0700
@@ -140,6 +143,8 @@ for (( i=0; i<$EVT_COUNT; i++)); do
             fi
             if [ $VARIANT == "ves" ]; then
                 EVT='{"commonEventHeader":{"domain":"notification","sequence":0,"eventName":"Noti_RnNode-Ericsson_FileReady","eventId":"FileReady_'$TCNTR'","priority":"Normal","version":"4.0.1","vesEventListenerVersion":"7.0.1","sourceName":"'$NO'","reportingEntityName":"'$NO'","lastEpochMicrosec":'$CURTIMEMS',"startEpochMicrosec":'$STTIMEMS',"timeZoneOffset":"UTC'$TIMEZONE'"},"notificationFields":{"notificationFieldsVersion":"2.0","changeType":"FileReady","changeIdentifier":"PM_MEAS_FILES","arrayOfNamedHashMap":[{"name":"'$FN'","hashMap":{"fileFormatType":"org.3GPP.32.435#measCollec","location":"'$URL'","fileFormatVersion":"V10","compression":"gzip"}}]}}'
+            elif [ $VARIANT == "file-ready-ts28532" ]; then
+                EVT='{"event":{"commonEventHeader":{"reportingEntityId":"","nfNamingCode":"001","timeZoneOffset":"UTC'$TIMEZONE'","version":"4.1","vesEventListenerVersion":"7.2.1","domain":"stndDefined","eventId":"ManagedElement=pynts-o-du-o1_stndDefined","eventName":"stndDefined_PyNTS_FileReady","eventType":"PyNTS_FileReady","sequence":0,"priority":"Low","reportingEntityName":"ManagementElement=pynts-o-du-o1","sourceId":"ManagementElement=pynts-o-du-o1","sourceName":"'$NO'","startEpochMicrosec":1737029100022212,"lastEpochMicrosec":1737029100022212,"nfVendorName":"pynts","stndDefinedNamespace":"3GPP-PerformanceAssurance"},"stndDefinedFields":{"schemaReference":"https://forge.3gpp.org/rep/sa5/MnS/blob/Rel-18/OpenAPI/TS28532_FileDataReportingMnS.yaml#components/schemas/NotifyFileReady","stndDefinedFieldsVersion":"1.0","data":{"href":"href1","notificationType":"notifyFileReady","fileInfoList":[{"fileSize":1288,"fileExpirationTime":"2025-01-16T12:08:00.017Z","fileCompression":"no","fileFormat":"xml","fileDataType":"Performance","fileLocation":"'$URL'","fileReadyTime":"2025-01-16T12:05:00.022Z"}],"additionalText":"Have fun!","notificationId":1,"eventTime":"2025-01-16T12:05:00.022Z","systemDN":"ManagedElement=pynts-o-du-o1"}}}}'
             else
                 EVT='{"event":{"commonEventHeader":{"sequence":0,"eventName":"Noti_RnNode-Ericsson_FileReady","sourceName":"'$NO'","lastEpochMicrosec":'$CURTIMEMS',"startEpochMicrosec":'$STTIMEMS',"timeZoneOffset":"UTC'$TIMEZONE'","changeIdentifier":"PM_MEAS_FILES"},"notificationFields":{"notificationFieldsVersion":"notificationFieldsVersion","changeType":"FileReady","changeIdentifier":"PM_MEAS_FILES","arrayOfNamedHashMap":[{"name":"'$FN'","hashMap":{"fileFormatType":"org.3GPP.32.435#measCollec","location":"'$URL'","fileFormatVersion":"V10","compression":"gzip"}}]}}}'
             fi
@@ -179,6 +184,8 @@ for (( i=0; i<$EVT_COUNT; i++)); do
             fi
             if [ $VARIANT == "ves" ]; then
                 EVT='{"commonEventHeader":{"domain":"notification","sequence":0,"eventName":"Noti_RnNode-Ericsson_FileReady","eventId":"FileReady_'$TCNTR'","priority":"Normal","version":"4.0.1","vesEventListenerVersion":"7.0.1","sourceName":"'$NO'","reportingEntityName":"'$NO'","lastEpochMicrosec":'$CURTIMEMS',"startEpochMicrosec":'$STTIMEMS',"timeZoneOffset":"UTC'$TIMEZONE'"},"notificationFields":{"notificationFieldsVersion":"2.0","changeType":"FileReady","changeIdentifier":"PM_MEAS_FILES","arrayOfNamedHashMap":[{"name":"'$FN'","hashMap":{"fileFormatType":"org.3GPP.32.435#measCollec","location":"'$URL'","fileFormatVersion":"V10","compression":"gzip"}}]}}'
+            elif [ $VARIANT == "file-ready-ts28532" ]; then
+                EVT='{"event":{"commonEventHeader":{"reportingEntityId":"","nfNamingCode":"001","timeZoneOffset":"UTC'$TIMEZONE'","version":"4.1","vesEventListenerVersion":"7.2.1","domain":"stndDefined","eventId":"ManagedElement=pynts-o-du-o1_stndDefined","eventName":"stndDefined_PyNTS_FileReady","eventType":"PyNTS_FileReady","sequence":0,"priority":"Low","reportingEntityName":"ManagementElement=pynts-o-du-o1","sourceId":"ManagementElement=pynts-o-du-o1","sourceName":"'$NO'","startEpochMicrosec":1737029100022212,"lastEpochMicrosec":1737029100022212,"nfVendorName":"pynts","stndDefinedNamespace":"3GPP-PerformanceAssurance"},"stndDefinedFields":{"schemaReference":"https://forge.3gpp.org/rep/sa5/MnS/blob/Rel-18/OpenAPI/TS28532_FileDataReportingMnS.yaml#components/schemas/NotifyFileReady","stndDefinedFieldsVersion":"1.0","data":{"href":"href1","notificationType":"notifyFileReady","fileInfoList":[{"fileSize":1288,"fileExpirationTime":"2025-01-16T12:08:00.017Z","fileCompression":"no","fileFormat":"xml","fileDataType":"Performance","fileLocation":"'$URL'","fileReadyTime":"2025-01-16T12:05:00.022Z"}],"additionalText":"Have fun!","notificationId":1,"eventTime":"2025-01-16T12:05:00.022Z","systemDN":"ManagedElement=pynts-o-du-o1"}}}}'
             else
                 EVT='{"event":{"commonEventHeader":{"sequence":0,"eventName":"Noti_RnNode-Ericsson_FileReady","sourceName":"'$NO'","lastEpochMicrosec":'$CURTIMEMS',"startEpochMicrosec":'$STTIMEMS',"timeZoneOffset":"UTC'$TIMEZONE'","changeIdentifier":"PM_MEAS_FILES"},"notificationFields":{"notificationFieldsVersion":"notificationFieldsVersion","changeType":"FileReady","changeIdentifier":"PM_MEAS_FILES","arrayOfNamedHashMap":[{"name":"'$FN'","hashMap":{"fileFormatType":"org.3GPP.32.435#measCollec","location":"'$URL'","fileFormatVersion":"V10","compression":"gzip"}}]}}}'
             fi
index 1d5b7cc..7e447db 100755 (executable)
@@ -2,6 +2,7 @@
 
 #  ============LICENSE_START===============================================
 #  Copyright (C) 2023 Nordix Foundation. All rights reserved.
+#  Copyright (C) 2023-2025 OpenInfra Foundation Europe. 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.
@@ -30,12 +31,13 @@ FILE_EXT=$4
 TYPE=$5
 SRV_COUNT=$6
 HIST=$7
+FILE_READY_FORMAT=${8:-file-ready}
 
 print_usage() {
-    echo "Usage: push-genfiles-to-file-ready-topic.sh <node-count> <num-of-events> <node-name-base> <file-extension> sftp|ftpes|https <num-servers> [hist]"
+    echo "Usage: push-genfiles-to-file-ready-topic.sh <node-count> <num-of-events> <node-name-base> <file-extension> sftp|ftpes|https <num-servers> [hist] <file-ready-format>"
     exit 1
 }
-if [ $# -lt 6 ] || [ $# -gt 7 ]; then
+if [ $# -lt 6 ] || [ $# -gt 8 ]; then
     print_usage
 fi
 
@@ -69,7 +71,7 @@ fi
 chmod +x kafka-client-send-genfiles-file-ready.sh
 kubectl cp kafka-client-send-genfiles-file-ready.sh nonrtric/kafka-client:/home/appuser
 
-kubectl exec kafka-client -n nonrtric -- bash -c './kafka-client-send-genfiles-file-ready.sh file-ready '$NODE_COUNT' '$EVT_COUNT' '$NODE_NAME_BASE' '$FILE_EXT' '$TYPE' '$SRV_COUNT' '$HIST
+kubectl exec kafka-client -n nonrtric -- bash -c './kafka-client-send-genfiles-file-ready.sh '$FILE_READY_FORMAT' '$NODE_COUNT' '$EVT_COUNT' '$NODE_NAME_BASE' '$FILE_EXT' '$TYPE' '$SRV_COUNT' '$HIST
 
 echo done