Committed by
Gerrit Code Review
Add ability to delete config to onos-netcfg.
-v (verbose) flag to print errors. refer to nodes with numbers rather than having to use $OCX variables Change-Id: Id57367d91b81d1b64bc098bdb367b86b0dcd3310
Showing
1 changed file
with
10 additions
and
3 deletions
... | @@ -5,11 +5,18 @@ | ... | @@ -5,11 +5,18 @@ |
5 | 5 | ||
6 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 | 6 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
7 | . $ONOS_ROOT/tools/build/envDefaults | 7 | . $ONOS_ROOT/tools/build/envDefaults |
8 | +. $ONOS_ROOT/tools/test/bin/find-node.sh | ||
8 | 9 | ||
9 | -node="${1:-$OCI}" | 10 | +fail="--fail" |
11 | +[ "$1" == "-v" ] && shift && fail="" | ||
12 | + | ||
13 | +node=$(find_node $1) | ||
10 | file="${2:-$ONOS_ROOT/tools/test/topos/oe-linear-3.json}" | 14 | file="${2:-$ONOS_ROOT/tools/test/topos/oe-linear-3.json}" |
11 | url="${3}" | 15 | url="${3}" |
12 | 16 | ||
13 | -curl --fail -sSL --user $ONOS_WEB_USER:$ONOS_WEB_PASS \ | 17 | +method="POST" |
14 | - -X POST -H 'Content-Type:application/json' \ | 18 | +[ $file == "delete" ] && method="DELETE" |
19 | + | ||
20 | +curl $fail -sSL --user $ONOS_WEB_USER:$ONOS_WEB_PASS \ | ||
21 | + -X $method -H 'Content-Type:application/json' \ | ||
15 | http://$node:8181/onos/v1/network/configuration/${url} -d@$file | 22 | http://$node:8181/onos/v1/network/configuration/${url} -d@$file | ... | ... |
-
Please register or login to post a comment