slowr | a65d87f | 2018-01-21 20:40:55 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Carmelo Cascone | 957c444 | 2018-02-02 20:27:18 -0800 | [diff] [blame] | 3 | if [ "$#" -eq 2 ]; then |
slowr | a65d87f | 2018-01-21 20:40:55 +0200 | [diff] [blame] | 4 | echo "" |
| 5 | curl -i --header "Content-type: application/json" --request POST -u onos:rocks --data '{ |
| 6 | "dpns": [ |
| 7 | { |
Carmelo Cascone | 957c444 | 2018-02-02 20:27:18 -0800 | [diff] [blame] | 8 | "dpn-id": "'$2'", |
slowr | a65d87f | 2018-01-21 20:40:55 +0200 | [diff] [blame] | 9 | "dpn-name": "site1-anchor1", |
| 10 | "dpn-groups": [ |
| 11 | "foo" |
| 12 | ], |
Carmelo Cascone | 957c444 | 2018-02-02 20:27:18 -0800 | [diff] [blame] | 13 | "node-id": "node'$2'", |
| 14 | "network-id": "network'$2'", |
slowr | a65d87f | 2018-01-21 20:40:55 +0200 | [diff] [blame] | 15 | "control-protocol": "p4-dpn-control-protocol", |
| 16 | "abstract": false |
| 17 | } |
| 18 | ] |
Carmelo Cascone | 957c444 | 2018-02-02 20:27:18 -0800 | [diff] [blame] | 19 | }' 'http://'$1':8181/onos/restconf/data/ietf-dmm-fpcagent:tenants/tenant=default/fpc-topology' |
slowr | a65d87f | 2018-01-21 20:40:55 +0200 | [diff] [blame] | 20 | echo "" |
| 21 | else |
Carmelo Cascone | 957c444 | 2018-02-02 20:27:18 -0800 | [diff] [blame] | 22 | echo "usage: "$0" <ONOS IP addr> <P4 device ID>" |
slowr | a65d87f | 2018-01-21 20:40:55 +0200 | [diff] [blame] | 23 | fi |