2 ################################################################################
4 # Copyright 2022 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 an VES Message Event to DCAE
24 collectionEndTime=$(( $timeInS - $(( $timeInS % 900 )) ));
25 collectionStartTime=$(( collectionEndTime - 900 ));
29 [controllerName]=$(hostname --fqdn)
30 [pnfId]=${pnfIdByType[$pnfType]}
31 [eventId]="${pnfIdByType[$pnfType]}_${interfaceByType[$pnfType]}_${alarmType}"
32 [eventType]=${eventType}
34 [timestamp]=${timestamp}
35 [eventTime]=${eventTime}
36 [startTime]=$( date -d @$collectionStartTime -u +%Y%m%d.%H%M+0000 )
37 [endTime]=$( date -d @$collectionEndTime -u +%H%M+0000 )
40 echo "################################################################################";
41 echo "# send VES 3GPP FileReady";
43 for key in "${!mapping[@]}"
45 #label=${${"$spaces$i"}:(-14)};
48 echo "$label: ${mapping[$key]}";
49 if [ $key = "timestamp" ]; then
50 sequence="$sequence s/\"@$key@\"/${mapping[$key]}/g; "
52 sequence="$sequence s/@$key@/${mapping[$key]}/g; "
57 body="./json/examples/${pnfType^^}-${domain}-3gpp-file-ready.json"
58 template="./json/templates/$domain-r16-notify-file-ready.json"
59 sed -e "$sequence" $template > $body;
61 curl -i -k -u $basicAuthVes -X POST -d @${body} --header "Content-Type: application/json" $urlVes