2 ################################################################################
4 # Copyright 2020 highstreet technologies GmbH and others
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # https://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 ################################################################################
19 # Script to send a VES Message EventList to DCAE
28 # exception for controller alarms
29 if [ "${pnfType^^}" == "SDNR" ]
31 eventType="ONAP_SDNR_Controller";
36 [controllerName]=$(hostname --fqdn)
37 [pnfId]=${pnfIdByType[$pnfType]}
38 [eventId]="${pnfIdByType[$pnfType]}_${interfaceByType[$pnfType]}_${alarmType}"
39 [eventType]=${eventType}
41 [interface]=${interfaceByType[$pnfType]}
43 [severity]=${severity}
44 [timestamp]=${timestamp}
45 [eventTime]=${eventTime}
46 [vendor]=${vendorsByType[$pnfType]^^}
47 [model]=${modelByType[$pnfType]}
50 echo "################################################################################";
51 echo "# send EventList wiht heartbeat and fault";
53 for key in "${!mapping[@]}"
55 #label=${${"$spaces$i"}:(-14)};
58 echo "$label: ${mapping[$key]}";
59 if [ $key = "timestamp" ]; then
60 sequence="$sequence s/\"@$key@\"/${mapping[$key]}/g; "
62 sequence="$sequence s/@$key@/${mapping[$key]}/g; "
67 body="./json/examples/${pnfType^^}-${alarmType}-${severity}-event-list.json"
68 sed -e "$sequence" ./json/templates/event-list.json > $body;
70 curl -i -k -u $basicAuthVes -X POST -d @${body} --header "Content-Type: application/json" $urlVes