summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSteve Martinelli <stevemar@ca.ibm.com>2014-07-22 16:10:41 -0400
committerSteve Martinelli <stevemar@ca.ibm.com>2014-07-24 21:34:28 -0400
commitae8f46ed483857edc7cbe25113130530fc509353 (patch)
tree7f52dafd9cf48035337adef579f6f27de687e5e8 /doc
parentc9ae9d1fa267653c1779a9a17613bd287f1297a3 (diff)
downloadpython-keystoneclient-ae8f46ed483857edc7cbe25113130530fc509353.tar.gz
Add an example of using v3 client with sessions
Added a bit more information to the 'using-api-v3' section, about using sessions instead of passing in arguments. This overlaps with what is documented in 'using-sessions' but I think it's still handy as most folks will likely go here first. Change-Id: I352bda49e01362d3a5da9a79ceb34748552ef9ec
Diffstat (limited to 'doc')
-rw-r--r--doc/source/using-api-v3.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/source/using-api-v3.rst b/doc/source/using-api-v3.rst
index 814f16f..1327446 100644
--- a/doc/source/using-api-v3.rst
+++ b/doc/source/using-api-v3.rst
@@ -111,3 +111,23 @@ domain name), to obtain a scoped token::
... user_domain_name=user_domain_name,
... project_name=project_name,
... project_domain_name=project_domain_name)
+
+Using Sessions
+==============
+
+It's also possible to instantiate a :py:class:`keystoneclient.v3.client.Client`
+class by using :py:class:`keystoneclient.session.Session`.::
+
+ >>> from keystoneclient.auth.identity import v3
+ >>> from keystoneclient import session
+ >>> from keystoneclient.v3 import client
+ >>> auth = v3.Password(auth_url='https://my.keystone.com:5000/v3',
+ ... user_id='myuserid',
+ ... password='mypassword',
+ ... project_id='myprojectid')
+ >>> sess = session.Session(auth=auth)
+ >>> keystone = client.Client(session=sess)
+
+For more information on Sessions refer to: `Using Sessions`_.
+
+.. _`Using Sessions`: using-sessions.html