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

Managers interact with a particular type of API (servers, databases, dns, etc.) and provide CRUD operations for them. More...

Inheritance diagram for BaseManager:
CloudDatabaseManager CloudDatabaseUserManager CloudDNSManager CloudLoadBalancerManager CloudNetworkManager

List of all members.

Public Member Functions

def __init__
def list
 Gets a list of all items.
def get
 Gets a specific item.
def create
 Subclasses need to implement the _create_body() method to return a dict that will be used for the API request body.
def delete
 Deletes the specified item.
def action
 Several API calls are lumped under the 'action' API.
def find
 Finds a single item with attributes matching ``**kwargs``.
def findall
 Finds all items with attributes matching ``**kwargs``.
def add_hook
def run_hooks

Public Attributes

 api

Static Public Attributes

 resource_class = None
 response_key = None
 plural_response_key = None
 uri_base = None

Detailed Description

Managers interact with a particular type of API (servers, databases, dns, etc.) and provide CRUD operations for them.


Constructor & Destructor Documentation

def __init__ (   self,
  api,
  resource_class = None,
  response_key = None,
  plural_response_key = None,
  uri_base = None 
)

Reimplemented in CloudDNSManager.


Member Function Documentation

def action (   self,
  item,
  action_type,
  body = {} 
)

Several API calls are lumped under the 'action' API.

This is the generic handler for such calls.

def add_hook (   cls,
  hook_type,
  hook_func 
)
def create (   self,
  name,
  return_none = False,
  return_raw = False,
  return_response = False,
  args,
  kwargs 
)

Subclasses need to implement the _create_body() method to return a dict that will be used for the API request body.

def delete (   self,
  item 
)

Deletes the specified item.

def find (   self,
  kwargs 
)

Finds a single item with attributes matching ``**kwargs``.

This isn't very efficient: it loads the entire list then filters on the Python side.

def findall (   self,
  kwargs 
)

Finds all items with attributes matching ``**kwargs``.

This isn't very efficient: it loads the entire list then filters on the Python side.

Reimplemented in CloudDNSManager.

def get (   self,
  item 
)

Gets a specific item.

Reimplemented in CloudDatabaseManager.

def list (   self,
  limit = None,
  marker = None 
)

Gets a list of all items.

Reimplemented in CloudDNSManager.

def run_hooks (   cls,
  hook_type,
  args,
  kwargs 
)

Member Data Documentation

api
plural_response_key = None [static]
resource_class = None [static]
response_key = None [static]
uri_base = None [static]

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