blob: 91f91af39228add917db520681792d268bce8878 [file] [log] [blame]
Ray Milkeybba71382015-08-26 13:09:23 -07001#!/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 Hallfb6009d2017-02-15 16:01:17 -080011aux=/tmp/stc/stc-$$.log
Ray Milkeybba71382015-08-26 13:09:23 -070012trap "rm -f $aux 2>/dev/null" EXIT
13target=$1
14name=$2
15type=$3
16arg1=$4
17arg2=$5
Ray Milkey3bc0be12016-03-03 16:47:04 -080018arg3=$6
19arg4=$7
20arg5=$8
Ray Milkeybba71382015-08-26 13:09:23 -070021
22set -x
23
Ray Milkey481ec332018-03-09 13:47:23 -080024onos $target "onos:add-${type}-intent" --key $name "${arg1}" "${arg2}" "${arg3}" "${arg4}" "${arg5}"
Ray Milkeybba71382015-08-26 13:09:23 -070025