Custom Search

Monday, May 5, 2014

Different way to connect to OpenStack Keystoneclient

1)
keystoneclient: with token
================== 

import keystoneclient
from keystoneclient.v3 import client
keystone = client.Client(token="tokentoken", endpoint="http://127.0.0.1:35357/v3")
keystone.projects.list()
keystone.roles.list(name="admin")

2)
keystoneclient: with username and password
=============================

import keystoneclient
from keystoneclient.v3 import client
keystone = client.Client(username="saju", password="saju", endpoint="http://127.0.0.1:35357/v3")
keystone.projects.list()
keystone.roles.list(name="admin")

3)
CLI: with token
=============== 

#keystone --os-token tokentoken --os-endpoint http://controller:35357/v2.0 --debug user-list

* We should provide  --os-token and --os-endpoint.





4)
CLI: with username, password and tenant name
==================================

* We should provide  --os-username, --os-password, --os-tenant-name and --os-auth-url.
 





5)
CLI: with token from username, password and tenant
===================================

##Get Token
#keystone --os-username admin --os-password admin --os-tenant-name admin --os-auth-url http://controller:35357/v2.0 --debug token-get

##Make "user-list" request with new token
#keystone --os-token your_token --os-endpoint http://controller:35357/v2.0 --debug user-list









No comments:

Post a Comment