6-add-domain-action.sh 1.55 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
read -p "Enter ZONE:" ZONE

if [[ -z "$ZONE" ]]; then
   printf '%s\n' "No input entered"
   exit 1
else
   printf "You entered ZONE %s " "$ZONE"
fi



read -p "Enter DOMAIN:" DOMAIN
if [[ -z "$DOMAIN" ]]; then
   printf '%s\n' "No input entered"
   exit 1
else
   printf "You entered DOMAIN %s " "$DOMAIN"
fi


read -p "Enter IP:" IP
if [[ -z "$IP" ]]; then
   printf '%s\n' "No input entered"
   exit 1
else
   printf "You entered IP %s " "$IP"
fi

echo "========================================================================"
echo "Adding domain"
echo "========================================================================"

ADD_DOMAIN_OP_ID=`osm ns-action --action_name add-domain --vnf_name $VNF_NAME --kdu_name $KDU_NAME  --params "{'zone_name': $ZONE, 'subdomain': $DOMAIN, 'ip': $IP}" $PDNS_NS_NAME`

echo "========================================================================"
echo "Showing action status"
echo "========================================================================"
osm ns-op-show $ADD_DOMAIN_OP_ID

echo "========================================================================"
Ubuntu's avatar
Ubuntu committed
47
echo "Check action status using osm ns-op-show $ADD_DOMAIN_OP_ID"
aticig's avatar
aticig committed
48
49
50
51
echo "========================================================================"

echo "========================================================================"
echo "Get the list of all operations using osm ns-op-list $PDNS_NS_ID"
Ubuntu's avatar
Ubuntu committed
52
echo "========================================================================"