Ceilometer API how to get Authorization Token

asked 2015-03-19 09:29:42 -0600

Heenal gravatar image

updated 2015-03-26 08:49:24 -0600

Hi, I am new to openstack, trying to use Ceilometer python API to pull some data from a testbed server but I cannot get the authorization token

I used the following command

curl -i 'http://HOST:8774/' -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d/tokens auth": {"tenantName": "project", "passwordCredentials": {"username": "user", "password": "password"}}}'

But it does not give me anything,

curl -X GET -H "X-Auth-Token:$MY_TOKEN" http://HOST:8774/tokens

also does not give me any token?

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2015-03-27 00:33:14 -0600

Praveen N gravatar image

Hi, To get Keystone Authentication token, you can give a try by creating a script as below:

TOKEN=`curl -s -d '{"auth":{"passwordCredentials": {"username": "user1", "password": "yourpassword"},"tenantName": "demo"}}' -H "Content-type: application/json" http://$HOST_IP:5000/v2.0/tokens | python -c "import sys; import json; tok = json.loads(sys.stdin.read()); print tok['access']['token']['id'];"`
echo $TOKEN

Execute this script.

edit flag offensive delete link more


@Praveen, thanks for the script. Can you also tell how i can make a call to ceilometer now that i have my token? I basically want to try curl https://ceilometer:8777

sanjana gravatar imagesanjana ( 2016-06-16 05:48:54 -0600 )edit

answered 2015-03-24 11:48:04 -0600

Is this a manual install of openstack? did you ever create the endpoint like this. What is the output of the following command 'keystone endpoint-list'

keystone endpoint-list

$ keystone endpoint-create --region RegionOne \
                           --service_id $CEILOMETER_SERVICE \
                           --publicurl "http://$SERVICE_HOST:8777/" \
                           --adminurl "http://$SERVICE_HOST:8777/" \
                           --internalurl "http://$SERVICE_HOST:8777/"
edit flag offensive delete link more


yes I some how got the end point and now i cannot get the authorization token,,... :(

Heenal gravatar imageHeenal ( 2015-03-26 08:42:02 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-03-19 08:54:14 -0600

Seen: 747 times

Last updated: Mar 27 '15