pyrax
Python Bindings for the Rackspace Cloud
 All Classes Namespaces Files Functions Variables Properties
Public Member Functions | Public Attributes | Static Public Attributes
Identity Class Reference

This class handles all of the authentication requirements for working with the Rackspace Cloud. More...

List of all members.

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 = {}

Detailed Description

This class handles all of the authentication requirements for working with the Rackspace Cloud.


Constructor & Destructor Documentation

def __init__ (   self,
  username = None,
  api_key = None,
  token = None,
  credential_file = None,
  region = None 
)

Member Function Documentation

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.


Member Data Documentation

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]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Properties