+usage() {
+ echo "Usage: $0 [ -n <number of VMs {2-15}> ][ -s <stack name> ][ -m <manifest> ][ -r ][ -q ] <env>" 1>&2;
+
+ echo "n: Set the number of VM's that will be installed. This number must be between 2 and 15" 1>&2;
+ echo "s: Set the name to be used for stack. This name will be used for naming of resources" 1>&2;
+ echo "m: The docker manifest to apply; must be either \"docker-manifest-staging.csv\" or \"docker-manifest.csv\"." 1>&2;
+ echo "r: Delete all resources relating to ONAP within enviroment." 1>&2;
+ echo "q: Quiet Delete of all ONAP resources." 1>&2;
+
+ exit 1;
+}
+
+
+while getopts ":n:s:m:rq" o; do
+ case "${o}" in
+ n)
+ if [[ ${OPTARG} =~ ^[0-9]+$ ]];then
+ if [ ${OPTARG} -ge 2 -a ${OPTARG} -le 15 ]; then
+ vm_num=${OPTARG}
+ else
+ usage
+ fi
+ else
+ usage
+ fi
+ ;;
+ s)
+ if [[ ! ${OPTARG} =~ ^[0-9]+$ ]];then
+ stack_name=${OPTARG}
+ else
+ usage
+ fi
+ ;;
+ m)
+ if [ -f $WORKSPACE/version-manifest/src/main/resources/${OPTARG} ]; then
+ docker_manifest=${OPTARG}
+ else
+ usage
+ fi
+ ;;
+ 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
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+shift $((OPTIND-1))
+