Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to get list of all servers through token based authetication

I want to use token to get list of all serves, I know how to access severs list through username and password,

   from novaclient import client
   auth=v2.Password(auth_url="", username="admin", password="1234", tenant_id='020377f522324546b072af92862e6466')
    nova = client.Client(2, session=sess)   
    instances =nova.servers.list()

Above is based on user name and password, but not token based I tried following but not woking

  from novaclient import client
  token =session.get("auth_token") # I have created token and accessing through session 
  noav=client.Client(token=token, endpoint='') 
  instances =nova.servers.list()