pyrax
Python Bindings for the Rackspace Cloud
Packages | Classes | Functions | Variables
pyrax Namespace Reference

Packages

namespace  base_identity
namespace  cf_wrapper
namespace  client
namespace  cloudblockstorage
namespace  clouddatabases
namespace  clouddns
namespace  cloudloadbalancers
namespace  cloudnetworks
namespace  exceptions
namespace  identity
namespace  manager
namespace  resource
namespace  service_catalog
namespace  utils
namespace  version

Classes

class  Settings
 Holds and manages the settings for pyrax. More...

Functions

def get_environment
 Returns the name of the current environment.
def set_environment
 Change your configuration environment.
def list_environments
 Returns a list of all defined environments.
def get_setting
 Returns the config setting for the specified key.
def set_setting
 Changes the value of the specified key in the current environment, or in another environment if specified.
def set_default_region
 Changes the default_region setting.
def auth_with_token
 If you already have a valid token and either a tenant ID or name, you can call this to configure the identity and available services.
def set_credentials
 Set the credentials directly, and then try to authenticate.
def set_credential_file
 Read in the credentials from the supplied file path, and then try to authenticate.
def keyring_auth
 Use the password stored within the keyring to authenticate.
def authenticate
 Generally you will not need to call this directly; passing in your credentials via set_credentials() and set_credential_file() will call authenticate() on the identity object by default.
def plug_hole_in_swiftclient_auth
 This is necessary because swiftclient has an issue when a token expires and it needs to re-authenticate against Rackspace auth.
def clear_credentials
 De-authenticate by clearing all the names back to None.
def connect_to_services
 Establishes authenticated connections to the various cloud APIs.
def connect_to_cloudservers
 Creates a client for working with cloud servers.
def connect_to_cloudfiles
 Creates a client for working with cloud files.
def connect_to_cloud_databases
 Creates a client for working with cloud databases.
def connect_to_cloud_loadbalancers
 Creates a client for working with cloud loadbalancers.
def connect_to_cloud_blockstorage
 Creates a client for working with cloud blockstorage.
def connect_to_cloud_dns
 Creates a client for working with cloud dns.
def connect_to_cloud_networks
 Creates a client for working with cloud networks.
def get_http_debug
def set_http_debug
def get_encoding
 Returns the unicode encoding type.

Variables

 keyring = None
tuple callstack = inspect.stack()
 in_setup = False
 cloudservers = None
 cloudfiles = None
 cloud_loadbalancers = None
 cloud_databases = None
 cloud_blockstorage = None
 cloud_dns = None
 cloud_networks = None
string default_region = "DFW"
string default_encoding = "utf-8"
dictionary settings = {}
string _environment = "default"
 identity = None
string USER_AGENT = "pyrax/%s"
 _http_debug = False
tuple regions = tuple()
tuple services = tuple()
dictionary _client_classes
tuple config_file = os.path.expanduser("~/.pyrax.cfg")
tuple debug = get_setting("http_debug")

Function Documentation

def pyrax.auth_with_token (   token,
  tenant_id = None,
  tenant_name = None,
  region = None 
)

If you already have a valid token and either a tenant ID or name, you can call this to configure the identity and available services.

def pyrax.authenticate (   connect = True)

Generally you will not need to call this directly; passing in your credentials via set_credentials() and set_credential_file() will call authenticate() on the identity object by default.

But for situations where you set your credentials manually or otherwise need finer control over the authentication sequence, this method will call the identity object's authenticate() method, and an AuthenticationFailed exception will be raised if your credentials have not been properly set first.

Normally after successful authentication, connections to the various services will be made. However, passing False to the `connect` parameter will skip the service connection step.

De-authenticate by clearing all the names back to None.

def pyrax.connect_to_cloud_blockstorage (   region = None)

Creates a client for working with cloud blockstorage.

def pyrax.connect_to_cloud_databases (   region = None)

Creates a client for working with cloud databases.

def pyrax.connect_to_cloud_dns (   region = None)

Creates a client for working with cloud dns.

def pyrax.connect_to_cloud_loadbalancers (   region = None)

Creates a client for working with cloud loadbalancers.

def pyrax.connect_to_cloud_networks (   region = None)

Creates a client for working with cloud networks.

def pyrax.connect_to_cloudfiles (   region = None,
  public = True 
)

Creates a client for working with cloud files.

The default is to connect to the public URL; if you need to work with the ServiceNet connection, pass False to the 'public' parameter.

def pyrax.connect_to_cloudservers (   region = None,
  kwargs 
)

Creates a client for working with cloud servers.

Returns a list of all base images; excludes any images created by this account.

Returns a list of all images created by this account; in other words, it excludes all the base images.

def pyrax.connect_to_services (   region = None)

Establishes authenticated connections to the various cloud APIs.

Returns the unicode encoding type.

Returns the name of the current environment.

def pyrax.get_setting (   key,
  env = None 
)

Returns the config setting for the specified key.

If no environment is specified, returns the setting for the current environment.

def pyrax.keyring_auth (   username = None,
  region = None,
  authenticate = True 
)

Use the password stored within the keyring to authenticate.

If a username is supplied, that name is used; otherwise, the keyring_username value from the config file is used.

If there is no username defined, or if the keyring module is not installed, or there is no password set for the given username, the appropriate errors will be raised.

If the region is passed, it will authenticate against the proper endpoint for that region, and set the default region for connections.

Returns a list of all defined environments.

def pyrax.plug_hole_in_swiftclient_auth (   clt,
  url 
)

This is necessary because swiftclient has an issue when a token expires and it needs to re-authenticate against Rackspace auth.

It is a temporary workaround until we can fix swiftclient.

def pyrax.set_credential_file (   cred_file,
  region = None,
  authenticate = True 
)

Read in the credentials from the supplied file path, and then try to authenticate.

The file should be a standard config file in one of the following formats:

For Keystone authentication: [keystone] username = myusername password = 1234567890abcdef tenant_id = abcdef1234567890

For Rackspace authentication: [rackspace_cloud] username = myusername api_key = 1234567890abcdef

If the region is passed, it will authenticate against the proper endpoint for that region, and set the default region for connections.

def pyrax.set_credentials (   username,
  api_key = None,
  password = None,
  region = None,
  tenant_id = None,
  authenticate = True 
)

Set the credentials directly, and then try to authenticate.

If the region is passed, it will authenticate against the proper endpoint for that region, and set the default region for connections.

def pyrax.set_default_region (   region)

Changes the default_region setting.

def pyrax.set_environment (   env)

Change your configuration environment.

An EnvironmentNotFound exception is raised if you pass in an undefined environment name.

def pyrax.set_http_debug (   val)
def pyrax.set_setting (   key,
  val,
  env = None 
)

Changes the value of the specified key in the current environment, or in another environment if specified.


Variable Documentation

dictionary _client_classes
Initial value:
00001 {
00002         "database": CloudDatabaseClient,
00003         "load_balancer": CloudLoadBalancerClient,
00004         "volume": CloudBlockStorageClient,
00005         "dns": CloudDNSClient,
00006         "compute:network": CloudNetworkClient,
00007         }
string _environment = "default"
_http_debug = False
tuple callstack = inspect.stack()
cloud_dns = None
cloudfiles = None
cloudservers = None
tuple config_file = os.path.expanduser("~/.pyrax.cfg")
tuple debug = get_setting("http_debug")
string default_encoding = "utf-8"
string default_region = "DFW"
identity = None
in_setup = False
keyring = None
tuple regions = tuple()
tuple services = tuple()
tuple settings = {}
string USER_AGENT = "pyrax/%s"
 All Classes Namespaces Files Functions Variables Properties