summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-10-19 20:09:20 +0000
committerGerrit Code Review <review@openstack.org>2018-10-19 20:09:20 +0000
commit06e36dde26ed29cbf61ff3bd621fe30803231f34 (patch)
treecdd75d20c366923efcfe08c6dc88bc46abcd9420 /doc
parentffabfba5a880b40cbe580757b6c3b17b717a0ad6 (diff)
parentb2e9caee38ca66147552a8f677468becf812e16e (diff)
downloadpython-keystoneclient-06e36dde26ed29cbf61ff3bd621fe30803231f34.tar.gz
Merge "Add Response class to return request-id to caller"
Diffstat (limited to 'doc')
-rw-r--r--doc/source/using-api-v3.rst25
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/source/using-api-v3.rst b/doc/source/using-api-v3.rst
index f0c82c5..4f305e8 100644
--- a/doc/source/using-api-v3.rst
+++ b/doc/source/using-api-v3.rst
@@ -102,6 +102,31 @@ For more information on Sessions refer to: `Using Sessions`_.
.. _`Using Sessions`: using-sessions.html
+Getting Metadata Responses
+==========================
+
+Instantiating :py:class:`keystoneclient.v3.client.Client` using
+`include_metadata=True` will cause manager response to return
+:py:class:`keystoneclient.base.Response` instead of just the data.
+The metadata property will be available directly to the
+:py:class:`keystoneclient.base.Response` and the response data will
+be available as property `data` to it.
+
+ >>> from keystoneauth1.identity import v3
+ >>> from keystoneauth1 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, include_metadata=True)
+ >>> resp = keystone.projects.list()
+ >>> resp.request_ids[0]
+ req-1234-5678-...
+ >>> resp.data
+ [<Project ...>, <Project ...>, ...]
+
Non-Session Authentication (deprecated)
=======================================