Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 11 lines (7 sloc) 413 Bytes
#!/bin/bash
# Import Settings
. settings
REQUEST="{\"auth\": {\"passwordCredentials\": {\"username\": \"$NOVA_USERNAME\", \"password\": \"$NOVA_API_KEY\"}}}"
RAW_TOKEN=`curl -s -d "$REQUEST" -H "Content-type: application/json" "http://$HOST_IP:5000/v2.0/tokens"`
TOKEN=`echo $RAW_TOKEN | python -c "import sys; import json; tok = json.loads(sys.stdin.read()); print tok['access']['token']['id'];"`
echo $TOKEN