qinling/tools/clear_resources.sh
Lingxian Kong 4272c94a08 Add functional tests for execution
Partially implements: blueprint qinling-functional-tests
Change-Id: I448fd148c6d046412a459ec933ca1e88ddfa9cad
2017-09-20 16:25:06 +12:00

38 lines
794 B
Bash

#!/usr/bin/env
set -e
function delete_resources(){
# Delete jobs
ids=$(openstack job list -f yaml -c Id | awk '{print $3}')
for id in $ids
do
openstack job delete $id
done
# Delete executions
ids=$(openstack function execution list -f yaml -c Id | awk '{print $3}')
for id in $ids
do
openstack function execution delete $id
done
# Delete functions
ids=$(openstack function list -f yaml -c Id | awk '{print $3}')
for id in $ids
do
openstack function delete $id
done
if [ "$1" = "admin" ]
then
# Delete runtimes
ids=$(openstack runtime list -f yaml -c Id | awk '{print $3}')
for id in $ids
do
openstack runtime delete $id
done
fi
}
delete_resources