blob: 15da4f5dff6044989adec61ca2a8448e2e20d28d [file] [log] [blame]
slowra65d87f2018-01-21 20:40:55 +02001#!/bin/bash
2
Carmelo Cascone957c4442018-02-02 20:27:18 -08003if [ "$#" -eq 2 ]; then
slowra65d87f2018-01-21 20:40:55 +02004 echo ""
5 curl -i --header "Content-type: application/json" --request POST -u onos:rocks --data '{
6 "dpns": [
7 {
Carmelo Cascone957c4442018-02-02 20:27:18 -08008 "dpn-id": "'$2'",
slowra65d87f2018-01-21 20:40:55 +02009 "dpn-name": "site1-anchor1",
10 "dpn-groups": [
11 "foo"
12 ],
Carmelo Cascone957c4442018-02-02 20:27:18 -080013 "node-id": "node'$2'",
14 "network-id": "network'$2'",
slowra65d87f2018-01-21 20:40:55 +020015 "control-protocol": "p4-dpn-control-protocol",
16 "abstract": false
17 }
18 ]
Carmelo Cascone957c4442018-02-02 20:27:18 -080019 }' 'http://'$1':8181/onos/restconf/data/ietf-dmm-fpcagent:tenants/tenant=default/fpc-topology'
slowra65d87f2018-01-21 20:40:55 +020020 echo ""
21else
Carmelo Cascone957c4442018-02-02 20:27:18 -080022 echo "usage: "$0" <ONOS IP addr> <P4 device ID>"
slowra65d87f2018-01-21 20:40:55 +020023fi