summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjuraj.linkes <jlinkes@cisco.com>2016-12-06 10:33:21 +0100
committerjuraj.linkes <jlinkes@cisco.com>2016-12-06 10:33:21 +0100
commitcc19c9b3c5e62c6009e66abb035a5e678210c550 (patch)
tree741ebb42a7e1556e902405a33ee9eb8544338bcf
parentccccedae0b0a77c98a0bccffb18cc0f0da7b94d7 (diff)
Added script for mounting VPPs into ODL
Change-Id: I34ada47e65e388e7343cbcff47501891e7cb0868 Signed-off-by: juraj.linkes <jlinkes@cisco.com>
-rwxr-xr-xscripts/mount_vpp_into_odl.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/mount_vpp_into_odl.sh b/scripts/mount_vpp_into_odl.sh
new file mode 100755
index 0000000..a5cf148
--- /dev/null
+++ b/scripts/mount_vpp_into_odl.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+display_usage() {
+ echo "Add VPP Mount into ODL."
+ echo "Usage:$0 [ODL Hostname or IP] [Mount Name of VPP in ODL] [VPP IP] \n"
+ exit 85
+}
+
+if [ $# -lt 3 ]
+then
+ display_usage
+exit 1
+fi
+
+odl_ip=$1
+vpp_host=$2
+vpp_ip=$3
+
+vpp_username=admin
+vpp_password=admin
+
+post_data='{"node" : [
+{"node-id":"'$vpp_host'",
+"netconf-node-topology:host":"'$vpp_ip'",
+"netconf-node-topology:port":"2831",
+"netconf-node-topology:tcp-only":false,
+"netconf-node-topology:keepalive-delay":0,
+"netconf-node-topology:username":"'$vpp_username'",
+"netconf-node-topology:password":"'$vpp_password'",
+"netconf-node-topology:connection-timeout-millis":10000,
+"netconf-node-topology:default-request-timeout-millis":10000,
+"netconf-node-topology:max-connection-attempts":10,
+"netconf-node-topology:between-attempts-timeout-millis":10000,
+"netconf-node-topology:schema-cache-directory":"hcmount"}
+]
+}
+'
+
+curl -u admin:admin -X POST -d "$post_data" -H 'Content-Type: application/json' http://$odl_ip:8081/restconf/config/network-topology:network-topology/network-topology:topology/topology-netconf/