2 ################################################################################
4 # Copyright 2019 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 ));
26 granularity="PM15min";
30 [controllerName]=$(hostname --fqdn)
31 [pnfId]=${pnfIdByType[$pnfType]}
32 [granularity]=$granularity
33 [eventId]="${pnfIdByType[$pnfType]}_${collectionEndTime}_${granularity}"
34 [eventType]=${eventType}
36 [interface]=${interfaceByType[$pnfType]}
37 [timestamp]=${timestamp}
38 [eventTime]=${eventTime}
39 [collectionStartTime]=${collectionStartTime}000
40 [collectionEndTime]=${collectionEndTime}000
41 [intervalStartTime]=$(date -u -R -d @$collectionStartTime )
42 [intervalEndTime]=$(date -u -R -d @$collectionEndTime )
43 [vendor]=${vendorsByType[$pnfType]^^}
44 [model]=${modelByType[$pnfType]}
47 echo "################################################################################";
48 echo "# send 15min performance values";
50 for key in "${!mapping[@]}"
54 echo "$label: ${mapping[$key]}";
55 if [ $key = "collectionStartTime" ] || [ $key = "collectionEndTime" ]; then
56 sequence="$sequence s/\"@$key@\"/${mapping[$key]}/g; "
58 sequence="$sequence s/@$key@/${mapping[$key]}/g; "
63 body=./json/examples/${pnfType^^}-${domain}.json
64 sed -e "$sequence" ./json/templates/$domain.json > $body
66 curl -i -k -u $basicAuthVes -X POST -d @${body} --header "Content-Type: application/json" $urlVes