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
23 domain="pnfRegistration";
26 [controllerName]=$(hostname --fqdn)
28 [eventId]="${pnfIdByType[$pnfType]}_${modelByType[$pnfType]}"
29 [eventTime]=${eventTime}
30 [eventType]=EventType5G
31 [pnfId]=${pnfIdByType[$pnfType]}
33 [model]=${modelByType[$pnfType]}
34 [oamIp]=${oamIpByType[$pnfType]}
35 [macAddress]=02:42:f7:d4:62:ce
36 [oamIpV6]=0:0:0:0:0:ffff:a0a:0${oamIpByType[$pnfType]:(-2)}
37 [vendor]=${vendorsByType[$pnfType]^^}
38 [timestamp]=${timestamp}
39 [eventId]="${pnfIdByType[$pnfType]}_${modelByType[$pnfType]}"
40 [eventTime]=${eventTime}
41 [eventType]=EventType5G
44 echo "################################################################################";
45 echo "# send PNF registration";
47 for key in "${!mapping[@]}"
49 #label=${${"$spaces$i"}:(-14)};
52 echo "$label: ${mapping[$key]}";
53 if [ $key = "timestamp" ]; then
54 sequence="$sequence s/\"@$key@\"/${mapping[$key]}/g; "
56 sequence="$sequence s/@$key@/${mapping[$key]}/g; "
61 body="./json/examples/${pnfType^^}-${domain}.json"
62 sed -e "$sequence" ./json/templates/$domain.json > $body;
64 curl -i -k -u $basicAuthVes -X POST -d @${body} --header "Content-Type: application/json" $urlVes