blob: 94ceddc686bd21ab500b392b05f40dbcf68689a9 [file] [log] [blame]
Dimitrios Mavrommatis45eb6d62017-12-03 22:07:36 -08001#!/bin/bash
Dimitrios Mavrommatisa9df5962017-12-05 15:11:04 -08002
3if [ "$#" -eq 1 ]; then
4 echo ""
5 curl -i --header "Content-type: application/json" --request POST -u onos:rocks --data '{
6 "dpns": [
7 {
8 "dpn-id": '$1',
9 "dpn-name": "site1-anchor1",
10 "dpn-groups": [
11 "foo"
12 ],
13 "node-id": "node'$1'",
Dimitrios Mavrommatis2b9f5f82017-12-07 16:23:13 -080014 "network-id": "network'$1'",
Dimitrios Mavrommatis6d4d5ce2017-12-13 11:35:55 -080015 "control-protocol": "zmq-dpn-control-protocol",
16 "abstract": false
Dimitrios Mavrommatisa9df5962017-12-05 15:11:04 -080017 }
18 ]
slowrdde30ad2017-12-21 14:16:04 -050019 }' 'http://192.168.105.14:8181/onos/restconf/data/ietf-dmm-fpcagent:tenants/tenant=default/fpc-topology'
Dimitrios Mavrommatisa9df5962017-12-05 15:11:04 -080020 ./getTenants.sh
21 echo ""
Dimitrios Mavrommatis7c0ff012017-12-07 00:25:58 -080022elif [ "$#" -eq 2 ]; then
23 echo ""
24 curl -i --header "Content-type: application/json" --request POST -u onos:rocks --data '{
25 "dpns": [
26 {
27 "dpn-id": '$1',
28 "dpn-name": "site1-anchor1",
29 "dpn-groups": [
30 "foo"
31 ],
32 "node-id": "node'$1'",
Dimitrios Mavrommatis2b9f5f82017-12-07 16:23:13 -080033 "network-id": "network'$1'",
Dimitrios Mavrommatis6d4d5ce2017-12-13 11:35:55 -080034 "control-protocol": "zmq-dpn-control-protocol",
35 "abstract": false
Dimitrios Mavrommatis7c0ff012017-12-07 00:25:58 -080036 }
37 ]
slowrdde30ad2017-12-21 14:16:04 -050038 }' 'http://192.168.105.14:8181/onos/restconf/data/ietf-dmm-fpcagent:tenants/tenant='$2'/fpc-topology'
Dimitrios Mavrommatis7c0ff012017-12-07 00:25:58 -080039 ./getTenants.sh
40 echo ""
Dimitrios Mavrommatisa9df5962017-12-05 15:11:04 -080041else
Dimitrios Mavrommatis7c0ff012017-12-07 00:25:58 -080042 echo "usage: "$0" dpnId (tenantId)"
43fi