Skip to content

Instantly share code, notes, and snippets.

@sshnaidm
Created August 3, 2014 21:36
Show Gist options
  • Save sshnaidm/8104ef942e608d2490cb to your computer and use it in GitHub Desktop.
Save sshnaidm/8104ef942e608d2490cb to your computer and use it in GitHub Desktop.
get token from openstack with curl
TOKEN=`curl -s -X POST http://172.16.0.1:35357/v2.0/tokens -d '{"auth": {"passwordCredentials": {"username":"admin", "password":"devstack"}, "tenantName":"admin"}}' -H "Content-type: application/json" | python -c 'import json,sys; response=json.loads(sys.stdin.read()); print response["access"]["token"]["id"]'`;
curl -s http://172.16.0.1:35357/v2.0/users -H "X-Auth-Token: "$TOKEN""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment