Everett Toews

Helping you shave narwhals

How I get a Token from the Rackspace Open Cloud from the Command Line

17 Aug 2012

On Mac OS X

$ TOKEN=`curl -s -X POST https://identity.api.rackspacecloud.com/v2.0/tokens -d '{"auth": {"passwordCredentials": {"username":"MY_USERNAME", "password":"MY_PASSWORD"}}}' -H "Content-type: application/json" | python -c 'import json,sys; response=json.loads(sys.stdin.read()); print response["access"]["token"]["id"]'`
$ echo $TOKEN
9d1dc8da-d306-4e39-b9c2-f39a127341f1
view raw token.sh hosted with ❤ by GitHub