summaryrefslogtreecommitdiffstats
path: root/src/test/resources
diff options
context:
space:
mode:
authorawudzins <adam.wudzinski@nokia.com>2020-01-13 11:43:08 +0100
committerawudzins <adam.wudzinski@nokia.com>2020-01-17 14:39:20 +0100
commitab6421bcf7b480f9955b6b4376554ec9677e71ed (patch)
tree347d29e9629a04888daf1fd216284f15b72a7149 /src/test/resources
parent7e5a7d1d8cd74e42c8549e02724ec2df589e4117 (diff)
Changed EventTransformation schema to be loaded only once
Issue-ID: DCAEGEN2-1774 Signed-off-by: adamwudzinski <adam.wudzinski@nokia.com> Change-Id: I50f3da2c11201a40be948ab199aaca89bbbb38db
Diffstat (limited to 'src/test/resources')
-rw-r--r--src/test/resources/api_version_config.json7
-rw-r--r--src/test/resources/eventTransform.json396
2 files changed, 403 insertions, 0 deletions
diff --git a/src/test/resources/api_version_config.json b/src/test/resources/api_version_config.json
new file mode 100644
index 00000000..23f585f9
--- /dev/null
+++ b/src/test/resources/api_version_config.json
@@ -0,0 +1,7 @@
+{
+ "apiVersion":
+ {
+ "eventListener": ["4.7.2","5.4.1","7.0.1"],
+ "eventListener_eventBatch": ["4.7.2","5.4.1","7.0.1"]
+ }
+}
diff --git a/src/test/resources/eventTransform.json b/src/test/resources/eventTransform.json
new file mode 100644
index 00000000..ab37a6eb
--- /dev/null
+++ b/src/test/resources/eventTransform.json
@@ -0,0 +1,396 @@
+[
+ {
+ "filter": {
+ "event.commonEventHeader.domain": "heartbeat",
+ "VESversion": "v7"
+ },
+ "processors": [
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.commonEventHeader.version",
+ "value": "3.0",
+ "fieldType": "number"
+ }
+ },
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.heartbeatFields.heartbeatFieldsVersion",
+ "value": "2.0",
+ "fieldType": "number"
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "field": "event.heartbeatFields.additionalFields",
+ "mapType": "HashmapToNameValueArray"
+ }
+ }
+ ]
+ },
+ {
+ "filter": {
+ "event.commonEventHeader.domain": "fault",
+ "VESversion": "v7"
+ },
+ "processors": [
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.commonEventHeader.version",
+ "value": "3.0",
+ "fieldType": "number"
+ }
+ },
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.faultFields.faultFieldsVersion",
+ "value": "3.0",
+ "fieldType": "number"
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "field": "event.faultFields.alarmAdditionalInformation",
+ "mapType": "HashmapToNameValueArray"
+ }
+ }
+ ]
+ },
+ {
+ "filter": {
+ "event.commonEventHeader.domain": "thresholdCrossingAlert",
+ "VESversion": "v7"
+ },
+ "processors": [
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.commonEventHeader.version",
+ "value": "3.0",
+ "fieldType": "number"
+ }
+ },
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.thresholdCrossingFields.thresholdCrossingFieldsVersion",
+ "value": "3.0",
+ "fieldType": "number"
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "field": "event.thresholdCrossingFields.additionalFields",
+ "mapType": "HashmapToNameValueArray"
+ }
+ }
+ ]
+ },
+ {
+ "filter": {
+ "event.commonEventHeader.domain": "measurement",
+ "VESversion": "v7"
+ },
+ "processors": [
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.commonEventHeader.version",
+ "value": "3.0",
+ "fieldType": "number"
+ }
+ },
+ {
+ "functionName": "removeAttribute",
+ "args": {
+ "field": "event.measurementFields.measurementFieldsVersion"
+ }
+ },
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.measurementFields.measurementsForVfScalingVersion",
+ "value": "3.0",
+ "fieldType": "number"
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "field": "event.measurementFields.vNicPerformanceArray[]",
+ "oldField": "event.measurementFields.nicPerformanceArray[]",
+ "attrMap": {
+ "nicIdentifier": "vNicIdentifier"
+ }
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "field": "event.measurementFields.additionalFields",
+ "oldField": "event.measurementFields.additionalFields",
+ "mapType": "hashmapToNameValueArray"
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "field": "event.measurementsForVfScalingFields",
+ "oldField": "event.measurementFields",
+ "mapType": "renameObject"
+ }
+ },
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.commonEventHeader.domain",
+ "value": "measurementsForVfScaling"
+ }
+ }
+ ]
+ },
+ {
+ "filter": {
+ "event.commonEventHeader.domain": "heartbeat",
+ "VESversion": "v4"
+ },
+ "processors": [
+ {
+ "functionName": "concatenateValue",
+ "args": {
+ "field": "event.commonEventHeader.eventName",
+ "concatenate": [
+ "$event.commonEventHeader.domain",
+ "$event.commonEventHeader.eventType",
+ "$event.faultFields.alarmCondition"
+ ],
+ "delimiter": "_"
+ }
+ },
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.heartbeatFields.heartbeatFieldsVersion",
+ "value": "1.0",
+ "fieldType": "number"
+ }
+ },
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.heartbeatFields.heartbeatInterval",
+ "value": "0",
+ "fieldType": "integer"
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "field": "event.commonEventHeader.nfNamingCode",
+ "oldField": "event.commonEventHeader.functionalRole"
+ }
+ }
+ ]
+ },
+ {
+ "filter": {
+ "event.commonEventHeader.domain": "fault",
+ "VESversion": "v4"
+ },
+ "processors": [
+ {
+ "functionName": "concatenateValue",
+ "args": {
+ "field": "event.commonEventHeader.eventName",
+ "concatenate": [
+ "$event.commonEventHeader.domain",
+ "$event.commonEventHeader.eventType",
+ "$event.faultFields.alarmCondition"
+ ],
+ "delimiter": "_"
+ }
+ },
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.faultFields.faultFieldsVersion",
+ "value": "2.0",
+ "fieldType": "number"
+ }
+ },
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.commonEventHeader.version",
+ "value": "3.0",
+ "fieldType": "number"
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "field": "event.commonEventHeader.nfNamingCode",
+ "oldField": "event.commonEventHeader.functionalRole"
+ }
+ }
+ ]
+ },
+ {
+ "filter": {
+ "event.commonEventHeader.domain": "thresholdCrossingAlert",
+ "VESversion": "v4"
+ },
+ "processors": [
+ {
+ "functionName": "concatenateValue",
+ "args": {
+ "field": "event.commonEventHeader.eventName",
+ "concatenate": [
+ "$event.commonEventHeader.domain",
+ "$event.commonEventHeader.elementType",
+ "$event.faultFields.alertDescription"
+ ],
+ "delimiter": "_"
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "field": "event.commonEventHeader.nfNamingCode",
+ "oldField": "event.commonEventHeader.functionalRole"
+ }
+ }
+ ]
+ },
+ {
+ "filter": {
+ "event.commonEventHeader.domain": "measurementsForVfScaling",
+ "VESversion": "v4",
+ "not": {
+ "event.commonEventHeader.reportingEntityName": "matches:.*ircc|irpr.*"
+ }
+ },
+ "processors": [
+ {
+ "functionName": "concatenateValue",
+ "args": {
+ "field": "event.commonEventHeader.eventName",
+ "concatenate": [
+ "$event.commonEventHeader.domain",
+ "$event.commonEventHeader.eventType",
+ "$event.faultFields.alarmCondition"
+ ],
+ "delimiter": "_"
+ }
+ },
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.measurementsForVfScalingFields.measurementsForVfScalingVersion",
+ "value": "2.0",
+ "fieldType": "number"
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "field": "event.measurementsForVfScalingFields.additionalMeasurements[].arrayOfFields[]",
+ "oldField": "event.measurementsForVfScalingFields.additionalMeasurements[].measurements[]"
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "oldField": "event.measurementsForVfScalingFields.aggregateCpuUsage",
+ "field": "event.measurementsForVfScalingFields.cpuUsageArray[0].percentUsage"
+ }
+ },
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.measurementsForVfScalingFields.cpuUsageArray[0].cpuIdentifier",
+ "value": "$event.commonEventHeader.sourceName"
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "field": "event.measurementsForVfScalingFields.memoryUsageArray[0].memoryConfigured",
+ "oldField": "event.measurementsForVfScalingFields.memoryConfigured",
+ "operation": "convertMBtoKB"
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "field": "event.measurementsForVfScalingFields.memoryUsageArray[0].memoryUsed",
+ "oldField": "event.measurementsForVfScalingFields.memoryUsed",
+ "operation": "convertMBtoKB"
+ }
+ },
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.measurementsForVfScalingFields.memoryUsageArray[0].vmIdentifier",
+ "value": "$event.commonEventHeader.sourceName"
+ }
+ },
+ {
+ "functionName": "subtractValue",
+ "args": {
+ "field": "event.measurementsForVfScalingFields.memoryUsageArray[0].memoryFree",
+ "subtract": [
+ "$event.measurementsForVfScalingFields.memoryUsageArray[0].memoryConfigured",
+ "$event.measurementsForVfScalingFields.memoryUsageArray[0].memoryUsed"
+ ]
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "field": "event.measurementsForVfScalingFields.vNicPerformanceArray[]",
+ "oldField": "event.measurementsForVfScalingFields.vNicUsageArray[]",
+ "attrMap": {
+ "broadcastPacketsIn": "receivedBroadcastPacketsAccumulated",
+ "multicastPacketsIn": "receivedMulticastPacketsAccumulated",
+ "bytesIn": "receivedOctetsAccumulated",
+ "packetsIn": "receivedTotalPacketsAccumulated",
+ "unicastPacketsIn": "receivedUnicastPacketsAccumulated",
+ "broadcastPacketsOut": "transmittedBroadcastPacketsAccumulated",
+ "multicastPacketsOut": "transmittedMulticastPacketsAccumulated",
+ "bytesOut": "transmittedOctetsAccumulated",
+ "packetsOut": "transmittedTotalPacketsAccumulated",
+ "unicastPacketsOut": "transmittedUnicastPacketsAccumulated"
+ }
+ }
+ },
+ {
+ "functionName": "map",
+ "args": {
+ "field": "event.measurementsForVfScalingFields.vNicPerformanceArray[]",
+ "oldField": "event.measurementsForVfScalingFields.errors",
+ "attrMap": {
+ "receiveDiscards": "receivedDiscardedPacketsAccumulated",
+ "receiveErrors": "receivedErrorPacketsAccumulated",
+ "transmitDiscards": "transmittedDiscardedPacketsAccumulated",
+ "transmitErrors": "transmittedErrorPacketsAccumulated"
+ }
+ }
+ },
+ {
+ "functionName": "addAttribute",
+ "args": {
+ "field": "event.measurementsForVfScalingFields.vNicPerformanceArray[0].valuesAreSuspect",
+ "value": "false"
+ }
+ }
+ ]
+ }
+]
+