summaryrefslogtreecommitdiffstats
path: root/base/common/python/pki/account.py
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2014-10-27 09:37:48 -0400
committerAde Lee <alee@redhat.com>2014-10-27 14:26:39 -0400
commit8d8e33bc282d8ceae4ea9da4546c9c7d25984fd9 (patch)
tree8332a9230ba521b80b02572c5c893f8db67247b6 /base/common/python/pki/account.py
parentae9494b4af8e4b9f39e7d478b1f95f5d40f55add (diff)
downloadpki-8d8e33bc282d8ceae4ea9da4546c9c7d25984fd9.tar.gz
pki-8d8e33bc282d8ceae4ea9da4546c9c7d25984fd9.tar.xz
pki-8d8e33bc282d8ceae4ea9da4546c9c7d25984fd9.zip
Updates to some python client classes for prettier API docs.
Added missing .rst annotations and missing docstrings. Added log file for sphinx runs.
Diffstat (limited to 'base/common/python/pki/account.py')
-rw-r--r--base/common/python/pki/account.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/base/common/python/pki/account.py b/base/common/python/pki/account.py
index 0916ec7cc..c8c7cd78b 100644
--- a/base/common/python/pki/account.py
+++ b/base/common/python/pki/account.py
@@ -22,14 +22,44 @@ import pki
class AccountClient:
+ """
+ Class used to associate an authentication session variable with a
+ connection.
+
+ To use this class:
+ * set the authentication credentials with the connection,
+ * create an AccountClient and then call login().
+ * further operations in this session will use the same authentication
+ credentials without re-authentication.
+ * call logout() to invalidate the session.
+ """
def __init__(self, connection):
+ """
+ Creates an AccountClient for the connection.
+
+ :param connection: connection to be associated with the AccountClient
+ :type connection: pki.PKIConnection
+ :returns: AccountClient
+ """
self.connection = connection
@pki.handle_exceptions()
def login(self):
+ """
+ Login to account REST interface. If login is successful,
+ an authentication session variable is associated with the connection.
+
+ :returns: None
+ """
self.connection.get('/rest/account/login')
@pki.handle_exceptions()
def logout(self):
+ """
+ Logs out of the session. Authentication session variables are
+ invalidated for the connection
+
+ :returns: None
+ """
self.connection.get('/rest/account/logout')