summaryrefslogtreecommitdiffstats
path: root/scripts/uninstall.sh
diff options
context:
space:
mode:
authorVijay Venkatesh Kumar <vv770d@att.com>2020-03-03 15:09:39 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-03 15:09:39 +0000
commit491105a0e6d2cf27a1f7b8397935c1ea62078ccc (patch)
tree8da1b9e93a81804a226be3e7eba6714aceb29ae0 /scripts/uninstall.sh
parentbac353ff11378f9ad5040ba43550d182b3687400 (diff)
parenta25c92363d1fdb3b3f9fc91203912febc19ed3c0 (diff)
Merge "Load blueprint into DCAE inventory at boot"1.10.0
Diffstat (limited to 'scripts/uninstall.sh')
-rwxr-xr-xscripts/uninstall.sh22
1 files changed, 20 insertions, 2 deletions
diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh
index 71f8161..30dc2bf 100755
--- a/scripts/uninstall.sh
+++ b/scripts/uninstall.sh
@@ -20,6 +20,14 @@
set -x
set +e
+# TLS setup
+CACERT="/certs/cacert.pem"
+CURLTLS=""
+if [ $CMPROTO = "https" ]
+then
+ CURLTLS="--cacert $CACERT"
+fi
+
# Leave the Consul cluster
/opt/consul/bin/consul leave
@@ -30,7 +38,17 @@ set +e
# jq gives us the just the deployment ids (e.g., "config_binding_service"), one per line
#
# xargs -I lets us run the cfy uninstall command once for each deployment id extracted by jq
-
-curl -Ss --user admin:$CMPASS -H "Tenant: default_tenant" "$CMADDR/api/v3.1/deployments?_include=id" \
+curl -Ss --user admin:$CMPASS -H "Tenant: default_tenant" ${CURLTLS} "$CMPROTO://$CMADDR:$CMPORT/api/v3.1/deployments?_include=id" \
| /bin/jq .items[].id \
| xargs -I % sh -c 'cfy uninstall %'
+
+# Delete blueprints (in case the uninstall didn't get them)
+curl -Ss --user admin:$CMPASS -H "Tenant: default_tenant" ${CURLTLS} "$CMPROTO://$CMADDR:$CMPORT/api/v3.1/blueprints?_include=id" \
+| /bin/jq .items[].id \
+| xargs -I % sh -c 'cfy blueprints delete %'
+
+# Delete plugins
+curl -Ss --user admin:$CMPASS -H "Tenant: default_tenant" ${CURLTLS} "$CMPROTO://$CMADDR:$CMPORT/api/v3.1/plugins?_include=id" \
+| /bin/jq .items[].id \
+| xargs -I % sh -c 'cfy plugins delete %'
+