blob: e99ba5a94ab805b6392ec30982795c93dfb9ef3e [file] [log] [blame]
Pooja0391e472c2018-11-02 20:20:57 +05301.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3.. Copyright 2018 Tech Mahindra Ltd.
4
5Mapping File
6============
7
8Mapping file is needed by Universal VES Adapter to convert the telemetry data into the VES format.
9The Adapter uses Smooks Framework to do the data format conversion by using the mapping files.
10Currently it requires to write the mapping file manually and upload it using the SnmpMapper application. The file gets stored into the postgres database. The pgInventory instance is used for this.
11
12| To know more about smooks framework check the following link:
13| http://www.smooks.org/guide
14
15Following is the default snmp mapping file which is used when no mapping file is found while processing event from SNMP Trap Collector.
16
17.. code-block:: xml
18
19 <?xml version="1.0"?>
20 <smooks-resource-list
21 xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
22 xmlns:json="http://www.milyn.org/xsd/smooks/json-1.1.xsd"
23 xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.4.xsd">
24 <json:reader rootName="vesevent" keyWhitspaceReplacement="-">
25 <json:keyMap>
26 <json:key from="date&amp;time" to="date-and-time" />
27 </json:keyMap>
28 </json:reader>
29
30 <jb:bean class="org.onap.dcaegen2.ves.domain.VesEvent" beanId="vesEvent" createOnElement="vesevent">
31 <jb:wiring property="event" beanIdRef="event"/>
32 </jb:bean>
33
34 <jb:bean class="org.onap.dcaegen2.ves.domain.Event" beanId="event" createOnElement="vesevent">
35 <jb:wiring property="commonEventHeader" beanIdRef="commonEventHeader"/>
36 <jb:wiring property="faultFields" beanIdRef="faultFields"/>
37 <!--<jb:wiring property="measurementsForVfScalingFields" beanIdRef="measurementsForVfScalingFields"/> -->
38 </jb:bean>
39 <!--<jb:bean class="org.onap.dcaegen2.ves.domain.MeasurementsForVfScalingFields" beanId="measurementsForVfScalingFields" createOnElement="simple">
40 <jb:wiring property="additionalMeasurements" beanIdRef="additionalMeasurements"/>
41 </jb:bean>-->
42
43 <jb:bean class="org.onap.dcaegen2.ves.domain.CommonEventHeader" beanId="commonEventHeader" createOnElement="vesevent">
44 <jb:expression property="version">"3.0"</jb:expression>
45 <jb:expression property="eventId">"XXXX"</jb:expression>
46 <jb:expression property="reportingEntityName">"VesAdapter"</jb:expression>
47 <jb:expression property="domain">"fault"</jb:expression>
48 <jb:expression property="eventName" execOnElement="vesevent" >commonEventHeader.domain+"_"+"_"+ faultFields.alarmCondition;</jb:expression>
49 <jb:value property="sequence" data="0" default="0" decoder="Long"/>
50 <jb:value property="lastEpochMicrosec" data="#/time-received" decoder="Double" />
51 <jb:value property="startEpochMicrosec" data="#/time-received" decoder="Double"/>
52 <jb:expression property="priority">"Medium"</jb:expression>
53 <jb:expression property="sourceName">"VesAdapter"</jb:expression>
54 </jb:bean>
55
56 <jb:bean class="org.onap.dcaegen2.ves.domain.FaultFields" beanId="faultFields" createOnElement="vesevent">
57 <jb:value property="alarmCondition" data="#/trap-category" />
58 <jb:expression property="eventSeverity">"MINOR"</jb:expression>
59 <jb:expression property="eventSourceType">"SNMP Agent"</jb:expression>
60 <jb:expression property="specificProblem">"SNMP Fault"</jb:expression>
61 <jb:value property="faultFieldsVersion" data="2.0" default="2.0" decoder="Double" />
62 <jb:wiring property="alarmAdditionalInformation" beanIdRef="alarmAdditionalInformationroot"/>
63 <jb:expression property="vfStatus">"Active"</jb:expression>
64
65 </jb:bean>
66 <jb:bean class="java.util.ArrayList" beanId="alarmAdditionalInformationroot" createOnElement="vesevent">
67 <jb:wiring beanIdRef="alarmAdditionalInformation"/>
68 </jb:bean>
69
70 <jb:bean class="org.onap.dcaegen2.ves.domain.AlarmAdditionalInformation" beanId="alarmAdditionalInformation" createOnElement="varbinds/element">
71 <jb:value property="name" data="#/varbind_oid"/>
72 <jb:value property="value" data="#/varbind_value" />
73 </jb:bean>
74 <!--<jb:bean class="java.util.ArrayList" beanId="additionalMeasurements" createOnElement="simple">
75 <jb:wiring beanIdRef="additionalMeasurement"/>
76 </jb:bean>
77
78 <jb:bean class="org.onap.dcaegen2.ves.domain.AdditionalMeasurement" beanId="additionalMeasurement" createOnElement="varbinds/element">
79 <jb:value property="name" data="#/varbind_value" />
80 </jb:bean> -->
81
82 </smooks-resource-list>
83
84