API cookbook: delete Delphix self-service template
This API cookbook recipe describes how to delete a template in Delphix Self-Service
The following script is for educational and demonstration purposes only and is not supported by Delphix
This script can be downloaded by selecting deleteTemplate.sh
Delete Delphix Self-Service Template
CODE
#!/bin/bash
#
# sample script to delete a bookmark on a Jet Stream container.
#
# Please set the following variables to suit your purposes.
# set this to the FQDN or IP address of the Delphix Engine
DE="ars-dlpx-6010.dlpxdc.co"
# set this to the Delphix admin user name
DELPHIX_ADMIN="admin"
# set this to the password for the Delphix admin user
DELPHIX_PASS="delphix"
# reference of template you want to delete
TEMPLATE_REF="JS_DATA_TEMPLATE-1"
#
# create our session
curl -s -X POST -k --data @- http://${DE}/resources/json/delphix/session \
-c ~/cookies.txt -H "Content-Type: application/json" <<EOF
{
"type": "APISession",
"version": {
"type": "APIVersion",
"major": 1,
"minor": 6,
"micro": 2
}
}
EOF
echo
#
# authenticate to the DE
curl -s -X POST -k --data @- http://${DE}/resources/json/delphix/login \
-b ~/cookies.txt -c ~/cookies.txt -H "Content-Type: application/json" <<EOF
{
"type": "LoginRequest",
"username": "${DELPHIX_ADMIN}",
"password": "${DELPHIX_PASS}"
}
EOF
echo
#
# delete the bookmark
curl -s -X DELETE -k http://${DE}/resources/json/delphix/jetstream/template/${TEMPLATE_REF} \
-b ~/cookies.txt -H "Content-Type: application/json"
echo