summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-07-30 01:49:21 +0000
committerGerrit Code Review <review@openstack.org>2014-07-30 01:49:21 +0000
commita5f0e3c53ca9013ab124cc33accc5a06266dc72c (patch)
tree28853b61d21c14ae1bbaa024e12ef817efd9d433 /doc
parentb487f946cd60a907174f550e08372d5907ca319f (diff)
parentae8f46ed483857edc7cbe25113130530fc509353 (diff)
downloadpython-keystoneclient-a5f0e3c53ca9013ab124cc33accc5a06266dc72c.tar.gz
Merge "Add an example of using v3 client with sessions"
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