From 8d8e33bc282d8ceae4ea9da4546c9c7d25984fd9 Mon Sep 17 00:00:00 2001 From: Ade Lee Date: Mon, 27 Oct 2014 09:37:48 -0400 Subject: Updates to some python client classes for prettier API docs. Added missing .rst annotations and missing docstrings. Added log file for sphinx runs. --- base/common/python/pki/account.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'base/common/python/pki/account.py') 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') -- cgit