3 echo "Sending mapping from ${2} to ODL; operation: ${1}"
4 until [ "`curl -X POST "http://${ODL_IP}:${ODL_PORT}/restconf/operations/odl-mappingservice:${1}" \
5 -H "Content-Type: application/json" --data-binary "@${ODL_CONFIG_DIR}/${2}" \
6 -u ${ODL_USER}:${ODL_PASSWD} -s -o /dev/null -w "%{http_code}"`" == "200" ]
8 echo "Updating failed; trying again.."
12 function odl_clear_all {
13 echo "Deleting all ODL mappings.."
14 curl -X DELETE "http://${ODL_IP}:${ODL_PORT}/restconf/config/odl-mappingservice:mapping-database" \
15 -u ${ODL_USER}:${ODL_PASSWD}
16 # TODO how to delete operational mappings?
19 function check_odl_running {
20 if [ -z "`netstat -tunlp | grep 8181`" ] ; then
21 echo "ODL is not running!"