aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/vIPSEC/scripts/update_running_streams.sh
diff options
context:
space:
mode:
authorRuoyu Ying <ruoyu.ying@intel.com>2019-04-16 19:15:45 +0800
committerRuoyu Ying <ruoyu.ying@intel.com>2019-04-16 19:17:33 +0800
commit15411868bad0ac9ca4831335442f0b4798e43a4b (patch)
treebb7fee9f3ba7c3876a042a61c490422b99045037 /vnfs/vIPSEC/scripts/update_running_streams.sh
parentd1bef8a2a799a275568642c27fe14ea706b0d166 (diff)
Add scripts for vIPSEC VNF
- Add scripts for vPacketgen and vSink that would be used in vIPSEC VNF. - Fixed minor bugs inside the base_vipsec.yaml Change-Id: Ide06fa3f05babe99a9728653a6d2ac214696049e Issue-ID: INT-793 Signed-off-by: Ruoyu Ying <ruoyu.ying@intel.com>
Diffstat (limited to 'vnfs/vIPSEC/scripts/update_running_streams.sh')
-rw-r--r--vnfs/vIPSEC/scripts/update_running_streams.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/vnfs/vIPSEC/scripts/update_running_streams.sh b/vnfs/vIPSEC/scripts/update_running_streams.sh
new file mode 100644
index 00000000..e21a6ba1
--- /dev/null
+++ b/vnfs/vIPSEC/scripts/update_running_streams.sh
@@ -0,0 +1,18 @@
+#/bin/bash
+
+if [ ! "$#" -eq 1 ]
+then
+ echo "Usage: ./update_running_streams.sh [number of active streams]"
+ exit
+fi
+
+STREAMS=$1
+BODY=""
+
+for((i=1; $i<= $STREAMS; i++)); do
+ BODY+="{\"id\":\"ipsec_udp$i\", \"is-enabled\":\"true\"},"
+done
+
+BODY='{"pg-streams":{"pg-stream": ['${BODY%?}']}}'
+
+curl -X PUT -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 9005870c-900b-2e2e-0902-ef2009bb0ff7" -d "$BODY" "http://localhost:8183/restconf/config/sample-plugin:sample-plugin/pg-streams"