blob: aefc55b2435584c599cf621c9afa60757bf2b023 [file] [log] [blame]
Lusheng Ji37534a52020-08-02 21:25:26 -04001#!/bin/bash
2
3#set -x
4
5acknowledge() {
6 echo "$1"
7 read -n 1 -p "Press any key to continue" mainmenuinput
8 echo
9}
10
11
12echo "This script demonstrates raising alarm within Near RT RIC"
13
14DIRNAME="/tmp/tsflow-$(date +%Y%m%d%H%M)"
15mkdir $DIRNAME
16cd $DIRNAME
17
18echo "===> Add network topology node for Near RT RIC"
19
20ipaddr="$(kubectl get svc --all-namespaces | grep alarmadapter-http | awk '{print $4}')"
21port="$(kubectl get svc --all-namespaces | grep alarmadapter-http | awk '{print $6}' | cut -f1 -d'/')"
22
23
24OP="POST"
25SpecificProblem="8006"
26PerceivedSeverity="MAJOR"
27AdditionalInfo="ethernet"
28IdentifyingInfo="eth1"
29curl -v -X $OP http://"$ipaddr":"$port"/ric/v1/alarms -d '{"SpecificProblem": "${SpecificProblem}", "PerceivedSeverity": "${PerceivedSeverity}", "AdditionalInfo": "${AdditionalInfo}", "IdentifyingInfo": "${IdentifyingInfo}"}'
30
31
32OP="POST"
33SpecificProblem="8005"
34PerceivedSeverity="CRITICAL"
35AdditionalInfo="network-down"
36IdentifyingInfo="switch 1"
37curl -v -X $OP http://"$ipaddr":"$port"/ric/v1/alarms -d '{"SpecificProblem": "${SpecificProblem}", "PerceivedSeverity": "${PerceivedSeverity}", "AdditionalInfo": "${AdditionalInfo}", "IdentifyingInfo": "${IdentifyingInfo}"}'
38
39
40
41
42OP="DELETE"
43SpecificProblem="8005"
44PerceivedSeverity="CRITICAL"
45AdditionalInfo="network-down"
46IdentifyingInfo="switch 1"
47curl -v -X $OP http://"$ipaddr":"$port"/ric/v1/alarms -d '{"SpecificProblem": "${SpecificProblem}", "PerceivedSeverity": "${PerceivedSeverity}", "AdditionalInfo": "${AdditionalInfo}", "IdentifyingInfo": "${IdentifyingInfo}"}'