blob: 489083f7824eeb85400d1d34767fc0555c09b87c [file] [log] [blame]
Thomas Vachuskadcadc2b2014-10-29 12:03:29 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# ONOS topology configuration uploader.
4# -----------------------------------------------------------------------------
5
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8
Thomas Vachuska85314292014-11-14 17:52:12 -08009node="${1:-$OCI}"
Thomas Vachuskadcadc2b2014-10-29 12:03:29 -070010file="${2:-$ONOS_ROOT/tools/test/topos/oe-linear-3.json}"
Ayaka Koshibed88b81d2015-09-17 17:52:27 -070011url="${3:-config/topology}"
Thomas Vachuskadcadc2b2014-10-29 12:03:29 -070012
Thomas Vachuska3c831fa2015-08-17 18:44:15 -070013curl -sS --fail -L --user $ONOS_WEB_USER:$ONOS_WEB_PASS \
14 -X POST -H 'Content-Type:application/json' \
Ayaka Koshibed88b81d2015-09-17 17:52:27 -070015 http://$node:8181/onos/v1/${url} -d@$file