|
pyrax
Python Bindings for the Rackspace Cloud
|
This class handles all of the authentication requirements for working with the Rackspace Cloud. More...
Public Member Functions | |
| def | __init__ |
| def | auth_endpoint |
| def | set_credentials |
| Sets the username and api_key directly. | |
| def | set_credential_file |
| Reads in the credentials from the supplied file. | |
| def | authenticate |
| Using the supplied credentials, connects to the specified authentication endpoint and attempts to log in. | |
| def | unauthenticate |
| Clears all authentication information. | |
| def | get_token |
| Returns the auth token, if it is valid. | |
Public Attributes | |
| username | |
| api_key | |
| token | |
| expires | |
| tenant_id | |
| tenant_name | |
| services | |
| user | |
Static Public Attributes | |
| string | us_auth_endpoint = "https://identity.api.rackspacecloud.com/v2.0/" |
| string | uk_auth_endpoint = "https://lon.identity.api.rackspacecloud.com/v2.0/" |
| string | username = "" |
| string | api_key = "" |
| string | token = "" |
| string | expires = "" |
| string | tenant_id = "" |
| string | tenant_name = "" |
| authenticated = False | |
| dictionary | services = {} |
This class handles all of the authentication requirements for working with the Rackspace Cloud.
| def __init__ | ( | self, | |
username = None, |
|||
api_key = None, |
|||
token = None, |
|||
credential_file = None, |
|||
region = None |
|||
| ) |
| def auth_endpoint | ( | self | ) |
| def authenticate | ( | self | ) |
Using the supplied credentials, connects to the specified authentication endpoint and attempts to log in.
If successful, records the token information.
| def get_token | ( | self, | |
force = False |
|||
| ) |
Returns the auth token, if it is valid.
If not, calls the auth endpoint to get a new token. Passing 'True' to 'force' will force a call for a new token, even if there already is a valid token.
| def set_credential_file | ( | self, | |
| credential_file, | |||
region = None, |
|||
authenticate = False |
|||
| ) |
Reads in the credentials from the supplied file.
It should be a standard config file in the format:
[rackspace_cloud] username = myusername api_key = 1234567890abcdef
| def set_credentials | ( | self, | |
| username, | |||
| api_key, | |||
region = None, |
|||
authenticate = False |
|||
| ) |
Sets the username and api_key directly.
| def unauthenticate | ( | self | ) |
Clears all authentication information.
string api_key = "" [static] |
authenticated = False [static] |
string expires = "" [static] |
dictionary services = {} [static] |
string tenant_id = "" [static] |
string tenant_name = "" [static] |
string token = "" [static] |
string uk_auth_endpoint = "https://lon.identity.api.rackspacecloud.com/v2.0/" [static] |
string us_auth_endpoint = "https://identity.api.rackspacecloud.com/v2.0/" [static] |
string username = "" [static] |
1.7.6.1