#!/bin/bash | |
if [ "$#" -eq 2 ]; then | |
echo "" | |
curl -i --header "Content-type: application/json" --request POST -u onos:rocks --data '{ | |
"dpns": [ | |
{ | |
"dpn-id": "'$2'", | |
"dpn-name": "site1-anchor1", | |
"dpn-groups": [ | |
"foo" | |
], | |
"node-id": "node'$2'", | |
"network-id": "network'$2'", | |
"control-protocol": "p4-dpn-control-protocol", | |
"abstract": false | |
} | |
] | |
}' 'http://'$1':8181/onos/restconf/data/ietf-dmm-fpcagent:tenants/tenant=default/fpc-topology' | |
echo "" | |
else | |
echo "usage: "$0" <ONOS IP addr> <P4 device ID>" | |
fi |