Skip to content

Instantly share code, notes, and snippets.

@gowatana
Created December 12, 2020 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gowatana/6464d3069687e33cffb301369acdbfa7 to your computer and use it in GitHub Desktop.
Save gowatana/6464d3069687e33cffb301369acdbfa7 to your computer and use it in GitHub Desktop.
#!/bin/bash
LOGIN_CONFIG=$1
K8S_UUID=$2
source $LOGIN_CONFIG
COOKIE=$(curl -k -s -D - \
-X POST \
-H "Content-Type: application/json" \
-u "$PRISM_USER:$PRISM_PASS" \
-d "{}" \
--url "https://$PC_ADDR:9440/api/nutanix/v3/clusters/list" | grep Set-Cookie: | sed "s/^Set-//" | sed "s/\;.*//")
eval curl -k -s \
-X DELETE \
-H \"Content-Type: application/json\" \
-H \"$COOKIE\" \
--url "https://$PC_ADDR:9440/karbon/acs/k8s/cluster/$K8S_UUID"
@gowatana
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment