Bases: object
A class that handles the auth and token caching for Rackspace Cloud accounts. It only uses api key for auth. You will be prompted for creds if a .cloudAccount.yml file doesn’t exist. Create the object to initially validate. Any time an api request is needed, call validate() to verify the token.
Variables: cloudAccount – List containing the following creds username – Cloud username(string) key – Cloud api key(string) token – Cloud cached token(string) expires – Cloud token expiration time(string) tenant – Cloud tenant id
cloudAccountUK – List containing the following UK creds username – Cloud UK username(string) key – Cloud UK api key(string) token – Cloud UK token(string) expires – Cloud UK token expiration time(string) tenant – Cloud tenant id
endpoints – Dictionary containing US and UK Auth endpoints
pd – Current working directory
Public Functions: __init__ – Object initialization validate – Validates current token stored in cloudAccount.
Private Functions: _auth – Authenticate using cloudAccount credentials and endpoints _updateResults – Dumps account and endpoints to file _logResults – _logError –
Checks expires time to current time and re-auths if needed.
Arguments: force – Force token re-auth if needed(bool).
Returns: True or False indicating an existing valid cached token or re-auth success.