summaryrefslogtreecommitdiff
path: root/keystoneclient/client.py
diff options
context:
space:
mode:
authorBrant Knudson <bknudson@us.ibm.com>2014-10-12 18:43:01 -0500
committerBrant Knudson <bknudson@us.ibm.com>2015-01-07 19:45:12 +0000
commit3568acb61732d1ce090b41e2c991307a257070db (patch)
treea9122d75c9d5111bec089b4f719e5a127e537885 /keystoneclient/client.py
parentb71a0a22c54e91a1c0058e4b29973df4154478f6 (diff)
downloadpython-keystoneclient-3568acb61732d1ce090b41e2c991307a257070db.tar.gz
Docstring usability improvements
The generated docs didn't provide enough information for a developer to get started using the API. This change enhances the documentation for the module so that a developer knows where to go to start (create a Client). Partial-Bug: #1330769 Change-Id: I907187d34ebf2c2e662ff7b9547b0ecaef008414
Diffstat (limited to 'keystoneclient/client.py')
-rw-r--r--keystoneclient/client.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/keystoneclient/client.py b/keystoneclient/client.py
index 8b6a6b0..f4b9f87 100644
--- a/keystoneclient/client.py
+++ b/keystoneclient/client.py
@@ -22,22 +22,27 @@ HTTPClient = httpclient.HTTPClient
def Client(version=None, unstable=False, session=None, **kwargs):
"""Factory function to create a new identity service client.
+ The returned client will be either a V3 or V2 client. Check the version
+ using the :py:attr:`~keystoneclient.v3.client.Client.version` property or
+ the instance's class (with instanceof).
+
:param tuple version: The required version of the identity API. If
specified the client will be selected such that the
major version is equivalent and an endpoint provides
at least the specified minor version. For example to
- specify the 3.1 API use (3, 1).
+ specify the 3.1 API use ``(3, 1)``.
:param bool unstable: Accept endpoints not marked as 'stable'. (optional)
- :param Session session: A session object to be used for communication. If
- one is not provided it will be constructed from the
- provided kwargs. (optional)
+ :param session: A session object to be used for communication. If one is
+ not provided it will be constructed from the provided
+ kwargs. (optional)
+ :type session: keystoneclient.session.Session
:param kwargs: Additional arguments are passed through to the client
that is being created.
- :returns: New keystone client object
- (keystoneclient.v2_0.Client or keystoneclient.v3.Client).
-
+ :returns: New keystone client object.
+ :rtype: :py:class:`keystoneclient.v3.client.Client` or
+ :py:class:`keystoneclient.v2_0.client.Client`
:raises keystoneclient.exceptions.DiscoveryFailure: if the server's
- response is invalid
+ response is invalid.
:raises keystoneclient.exceptions.VersionNotAvailable: if a suitable client
cannot be found.
"""