apply checkstyle check during build for neutron-mapper
[groupbasedpolicy.git] / demos / vpp-demo / register_vpp_node.sh
1 #!/bin/bash
2
3 display_usage() {
4   echo "Add VPP Mount into ODL."
5   echo "Usage:$0 [ODL Hostname or IP:port] [Mount Name of VPP in ODL] [VPP Hostname or IP] \n"
6   exit 85
7 }
8
9 if [  $# -lt 3 ]
10 then
11   display_usage
12 exit 1
13 fi
14
15 odl_ip=$1
16 vpp_host=$2
17 vpp_ip=$3
18
19 vpp_username=admin
20 vpp_password=admin
21
22 post_data='{"node" : [
23 {"node-id":"'$vpp_host'",
24 "netconf-node-topology:host":"'$vpp_ip'",
25 "netconf-node-topology:port":"2831",
26 "netconf-node-topology:tcp-only":false,
27 "netconf-node-topology:keepalive-delay":0,
28 "netconf-node-topology:username":"'$vpp_username'",
29 "netconf-node-topology:password":"'$vpp_password'",
30 "netconf-node-topology:connection-timeout-millis":10000,
31 "netconf-node-topology:default-request-timeout-millis":10000,
32 "netconf-node-topology:max-connection-attempts":10,
33 "netconf-node-topology:between-attempts-timeout-millis":10000,
34 "netconf-node-topology:schema-cache-directory":"hcmount"}
35 ]
36 }
37 '
38
39 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