diff options
author | 2019-02-15 13:46:01 +0000 | |
---|---|---|
committer | 2019-02-15 13:46:01 +0000 | |
commit | 924ab47c83837fae7c70713cab51665b8fc858a6 (patch) | |
tree | d26b3fcf654603bdf27992399a76c7f879fffcc6 /src/main/resources/mapping.ftl | |
parent | 85d315a40fa48255e1104a0c2d6c5ad984952c9c (diff) |
Add Mapping
Change-Id: I417b7fe9d0e588c6c38dc23eb55e43a85e277e81
Issue-ID: DCAEGEN2-1216
Signed-off-by: JoeOLeary <joseph.o.leary@est.tech>
Diffstat (limited to 'src/main/resources/mapping.ftl')
-rw-r--r-- | src/main/resources/mapping.ftl | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/src/main/resources/mapping.ftl b/src/main/resources/mapping.ftl new file mode 100644 index 0000000..0b35c54 --- /dev/null +++ b/src/main/resources/mapping.ftl @@ -0,0 +1,128 @@ +<#ftl ns_prefixes={"D":"http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec"}> +<#-- + ============LICENSE_START======================================================= + Copyright (C) 2019 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. + + SPDX-License-Identifier: Apache-2.0 + ============LICENSE_END========================================================= + --> +<#assign fileHeader = xml.measCollecFile.fileHeader> +<#assign fileFooter = xml.measCollecFile.fileFooter> +<#assign measData = xml.measCollecFile.measData> +<#setting datetime_format="iso"> +{ + "event": { + "commonEventHeader": <@commonEventHeader/> + <#if measData?has_content>, + "perf3gppFields": <@perf3gppFields/> + </#if> + } +} + + +<#macro commonEventHeader> +{ + "domain": "perf3gpp", + "eventId": "${eventId}", + "sequence": 0, + "eventName": "perf3gpp_${metadata.productName}-${metadata.vendorName}_pmMeasResult", + "sourceName": "${metadata.sourceName}", + "reportingEntityName": "", + "priority": "Normal", + "startEpochMicrosec": ${fileHeader.measCollec.@beginTime?datetime?long?c}, + "lastEpochMicrosec": ${fileFooter.measCollec.@endTime?datetime?long?c}, + "version": "4.0", + "vesEventListenerVersion": "7.1", + "timeZoneOffset": "${metadata.timeZoneOffset}" +} +</#macro> + + +<#macro measTypes measInfo> +{ + "sMeasTypesList":[ + <#if measInfo.measType?has_content> + <#list measInfo.measType as measType> + "${measType}"<#sep>,</#sep> + </#list> + <#else> + <#list measInfo.measTypes?split(" ") as measType> + "${measType}"<#sep>,</#sep> + </#list> + </#if> + ] +} +</#macro> + + +<#macro measValuesList measInfo> +[ + { + "measObjInstId": "${measInfo.measValue.@measObjLdn[0]!}", + "suspectFlag": "${measInfo.measValue.suspect[0]! "false"}", + "measResults": [ + <#if measInfo.measValue.r?has_content> + <#list measInfo.measValue.r as r> + { + "p": ${r.@p}, + "sValue": "${r}" + }<#sep>,</#sep> + </#list> + <#else> + <#list measInfo.measValue.measResults?split(" ") as r> + { + "p":${r?index+1}, + "sValue": "${r}" + }<#sep>,</#sep> + </#list> + </#if> + ] + } +] +</#macro> + + +<#macro measInfoList> +[ +<#list measData.measInfo as measInfo> + { + "measInfoId": { + "sMeasInfoId": "${measInfo.@measInfoId[0]!}" + }, + "measTypes": <@measTypes measInfo/>, + "measValuesList": <@measValuesList measInfo/> + }<#sep>,</#sep> +</#list> +] +</#macro> + + +<#macro measDataCollection> +{ + "granularityPeriod": ${measData.measInfo.granPeriod.@endTime[0]!?datetime?long?c}, + "measuredEntityUserName": "${measData.managedElement.@userLabel[0]!}", + "measuredEntityDn": "${measData.managedElement.@localDn}", + "measuredEntitySoftwareVersion": "${measData.managedElement.@swVersion}", + "measInfoList": <@measInfoList/> +} +</#macro> + + +<#macro perf3gppFields> +{ + "perf3gppFieldsVersion": "1.0", + "measDataCollection": <@measDataCollection/> +} +</#macro> |