Hi,
I am new to using REST. I am confortable using delphix CLI to sutomate. However , can't see what is wrong with my rest program.
Here is the code :
---------------------------------------------------------------------------------------------------------------
#!/bin/ksh
# Create API session
echo "Initiate Session "
curl -s -S -X POST -k --data @-
http://10.64.148.77/resources/json/delphix/session \
-c ~/cookies.txt -H "Content-Type: application/json" <<EOF
{
"type": "APISession",
"version": {
"type": "APIVersion",
"major": 1,
"minor": 7,
"micro": 0
}
}
EOF
echo "Initiated Session"
# login
curl -s -S -X POST -k --data @-
http://10.64.148.77/resources/json/delphix/login \
-b ~/cookies.txt -H "Content-Type: application/json" <<EOF
{
"type": "LoginRequest",
"username": "amathe01",
"password": djsdlfjdo_23"
}
EOF
# List ENV
echo "\n\n List Env Information"
curl -S -X GET -k
http://10.64.148.77/resources/json/delphix/environment \
-b ~/cookies.txt -H "Content-Type: application/json"
---------------------------------------------------------------------------------------------------------
Problem:
------------
When executing the script it only executed the first CURL and returns to command prompt.
However, I can execute each command from the script on the command line and get the
expected output. What am I missing?
Here is the output :
Initiate Session
{"type":"OKResult","status":"OK","result":{"type":"APISession","version":{"type":"APIVersion","major":1,"minor":7,"micro":0},"locale":null,"client":null},"job":null,"action":null}
A second question. Is there way not to send clear test password to the login request? Delphix CLI provides an encryption mecahnism.
Thanks in advance !
#Virtualization