Ray Milkey | bba7138 | 2015-08-26 13:09:23 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | #! usage: onos-create-intent target-onos-instance name point deviceId1 deviceId2 |
| 3 | #! onos-create-intent target-onos-instance name host hostId1 hostId2 |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | # Installs a new intent using the ONOS CLI |
| 6 | # ----------------------------------------------------------------------------- |
| 7 | |
| 8 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| 9 | . $ONOS_ROOT/tools/build/envDefaults |
| 10 | |
Jon Hall | fb6009d | 2017-02-15 16:01:17 -0800 | [diff] [blame^] | 11 | aux=/tmp/stc/stc-$$.log |
Ray Milkey | bba7138 | 2015-08-26 13:09:23 -0700 | [diff] [blame] | 12 | trap "rm -f $aux 2>/dev/null" EXIT |
| 13 | target=$1 |
| 14 | name=$2 |
| 15 | type=$3 |
| 16 | arg1=$4 |
| 17 | arg2=$5 |
Ray Milkey | 3bc0be1 | 2016-03-03 16:47:04 -0800 | [diff] [blame] | 18 | arg3=$6 |
| 19 | arg4=$7 |
| 20 | arg5=$8 |
Ray Milkey | bba7138 | 2015-08-26 13:09:23 -0700 | [diff] [blame] | 21 | |
| 22 | set -x |
| 23 | |
Jonathan Hart | 381f8d8 | 2016-08-31 10:24:12 -0700 | [diff] [blame] | 24 | onos -f $target "onos:add-${type}-intent" --key $name "${arg1}" "${arg2}" "${arg3}" "${arg4}" "${arg5}" |
Ray Milkey | bba7138 | 2015-08-26 13:09:23 -0700 | [diff] [blame] | 25 | |