Ask Your Question

Revision history [back]

See http://docs.openstack.org/developer/python-keystoneclient/using-api-v2.html
Using the V2 client API
It requires minimal python writing skills. It works for me.

See http://docs.openstack.org/developer/python-keystoneclient/using-api-v2.html
Using the V2 client API
It requires minimal python writing skills. It works for me.

[root@CentOS71Server ~(keystone_admin)]# python
Python 2.7.5 (default, Jun 24 2015, 00:41:19) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from keystoneclient.v2_0 import client
>>> token = '9b8343175a9740389d6c6b35b36937be'
>>> endpoint = 'http://192.168.1.92:35357/v2.0'
>>> keystone = client.Client(token=token, endpoint=endpoint)
>>> keystone.tenants.list()
[<Tenant {u'enabled': True, u'description': u'default tenant', u'name': u'demo', u'id': u'3d3251ded8f740eeb7897709a33199ff'}>, <Tenant {u'enabled': True, u'description': u'admin tenant', u'name': u'admin', u'id': u'51d4917adf41417a9f9b36ea6066ce2b'}>, <Tenant {u'enabled': True, u'description': u'Tenant for the openstack services', u'name': u'services', u'id': u'd7264f247c8a4f679cc50bec846742e5'}>]

For token value see your /etc/keystone/keystone.conf. It's right in the top.