#!/bin/bash -x

full_deletion=false

usage() { echo "Usage: $0 [-n <string>] [-r]" 1>&2; exit 1; }

while getopts ":rqn:" o; do
    case "${o}" in

        r)
            echo "The following command will delete all information relating to onap within your enviroment"
            read -p "Are you certain this is what you want? (type y to confirm):" answer

            if [ $answer = "y" ] || [ $answer = "Y" ] || [ $answer = "yes" ] || [ $answer = "Yes"]; then
                echo "This may delete the work of other colleages within the same enviroment"
                read -p "Are you certain this is what you want? (type y to confirm):" answer2

                if [ $answer2 = "y" ] || [ $answer2 = "Y" ] || [ $answer2 = "yes" ] || [ $answer2 = "Yes"]; then
                    full_deletion=true
                else
                    echo "Ending program"
                    exit 1
                fi
            else
                echo "Ending program"
                exit 1
            fi
            ;;
        q)
            full_deletion=true
            ;;
        n)
            install_name=${OPTARG}
            ;;

        *)
            usage
            ;;
    esac
done
shift $((OPTIND-1))

if [ -z "$WORKSPACE" ]; then
    export WORKSPACE=`git rev-parse --show-toplevel`
fi

source $WORKSPACE/test/ete/scripts/install_openstack_cli.sh

if [ "$full_deletion" = true ];then
    echo "Commencing delete, press CRTL-C to stop"
    sleep 10

    # delete all instances
    SERVERS=$(openstack server list -c ID -f value --project $OS_PROJECT_ID)
    if [ $? -ne 0 ]; then
        # only admin roles support --project parameter, so retry without it if the above returns an error
        SERVERS=$(openstack server list -c ID -f value)
    fi
    if [ ! -z "$SERVERS" ]; then
        openstack server delete $SERVERS
        sleep 1
    fi

    # miscellaneous cleanup
    FLOATING_IPS=$(openstack floating ip list -c ID -f value --project $OS_PROJECT_ID)
    if [ ! -z "$FLOATING_IPS" ]; then
        openstack floating ip delete $FLOATING_IPS
        sleep 1
    fi

    ROUTERS=$(openstack router list -c ID -f value --project $OS_PROJECT_ID)
    echo $ROUTERS
    for ROUTER in $ROUTERS; do
        echo $ROUTER;
        PORTS=$(openstack router show $ROUTER  -c "interfaces_info" -f "value" | jq -r '.[].port_id')
        for PORT in $PORTS; do
            openstack router remove port $ROUTER $PORT
        done
        openstack router delete $ROUTER
    done
    sleep 1

    PORTS=$(openstack port list -f value -c ID --project $OS_PROJECT_ID)
    if [ ! -z "$PORTS" ]; then
        openstack port delete $PORTS
        sleep 1
    fi
    VOLUMES=$(openstack volume list -f value -c ID --project $OS_PROJECT_ID)
    if [ ! -z "$VOLUMES" ]; then
        openstack volume delete $VOLUMES
        sleep 1
    fi


    # Delete all existing stacks
    STACKS=$(openstack stack list -c "Stack Name" -f value)

    if [ ! -z "${STACKS}" ]; then
        openstack stack delete -y $STACKS
        for STACK in ${STACKS}; do
            until [ "DELETE_IN_PROGRESS" != "$(openstack stack show -c stack_status -f value $STACK)" ]; do
                sleep 2
            done
        done
    else
        echo "No existing stacks to delete."
    fi

else
    #Restrained teardown
    echo "Restrained teardown"

    STACK=$install_name

    STATUS=$(openstack stack check $STACK 2>&1)

    if [ "Stack not found: $install_name" != "$STATUS" ]; then
        openstack stack delete $STACK

        until [ "DELETE_IN_PROGRESS" != "$(openstack stack show -c stack_status -f value $STACK)" ]; do
        sleep 2
        done
    else
        echo "No existing stack with the name $install_name."
    fi
fi
