summaryrefslogtreecommitdiffstats
path: root/src/main/resources/templates/org.3GPP.28.550#measData
blob: 653077e83b61dc07279b1873947763ae239f3afd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<#ftl>
<#--
  ============LICENSE_START=======================================================
   Copyright (C) 2019-2020 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=========================================================
 -->
<#compress>
<#assign fileHeader = xml.MeasDataFile.fileHeader>
<#assign fileFooter = xml.MeasDataFile.fileFooter>
<#assign measData = xml.MeasDataFile.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.MeasData.@beginTime?datetime?long?c},
    "lastEpochMicrosec": ${fileFooter.MeasData.@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>
[
<#list measInfo.measValue as measValue>
    {
        "measObjInstId": "${measValue.@measObjLdn[0]!}",
        "suspectFlag": "${measValue.suspect[0]! "false"}",
        "measResults": [
        <#if measValue.r?has_content>
        <#list measValue.r as r>
            {
                "p": ${r.@p},
                "sValue": "${r}"
            }<#sep>,</#sep>
        </#list>
        <#else>
        <#list measValue.measResults?split(" ") as r>
            {
                "p":${r?index+1},
                "sValue": "${r}"
            }<#sep>,</#sep>
        </#list>
        </#if>
        ]
   }
<#sep>,</#sep>
</#list>
]
</#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.measuredEntity.@userLabel[0]!}",
    "measuredEntityDn": "${measData.measuredEntity.@localDn[0]!}",
    "measuredEntitySoftwareVersion": "${measData.measuredEntity.@swVersion[0]!}",
    "measInfoList": <@measInfoList/>
}
</#macro>

<#macro perf3gppFields>
{
    "perf3gppFieldsVersion": "1.0",
    "measDataCollection": <@measDataCollection/>
}
</#macro>
</#compress>