5-add-zone-action.sh 1.07 KB
Newer Older
aticig's avatar
aticig committed
1
2
#!/bin/bash

Ubuntu's avatar
Ubuntu committed
3
4
5
6
export PDNS_NS_NAME=powerdns_ns
export VNF_NAME=powerdns
export KDU_NAME=powerdns

aticig's avatar
aticig committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
read -p "Enter ZONE:" ZONE

# Check if string is empty using -z. For more 'help test'
if [[ -z "$ZONE" ]]; then
   printf '%s\n' "No input entered"
   exit 1
else
   printf "You entered ZONE %s " "$ZONE"
fi

echo "========================================================================"
echo "Adding zone"
echo "========================================================================"

ADD_ZONE_OP_ID=`osm ns-action --action_name add-zone --vnf_name $VNF_NAME --kdu_name $KDU_NAME --params "{"zone_name": $ZONE}" $PDNS_NS_NAME`

echo "========================================================================"
echo "Showing action status"
echo "========================================================================"

# Check operation status
osm ns-op-show $ADD_ZONE_OP_ID

echo "========================================================================"
Ubuntu's avatar
Ubuntu committed
31
echo "Check action status using osm ns-op-show $ADD_ZONE_OP_ID"
aticig's avatar
aticig committed
32
echo "========================================================================"
Ubuntu's avatar
Ubuntu committed
33