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

A resource represents a particular instance of an object (server, flavor, etc). More...

Inheritance diagram for BaseResource:
Tenant User CloudBlockStorageSnapshot CloudBlockStorageVolume CloudBlockStorageVolumeType CloudDatabaseDatabase CloudDatabaseFlavor CloudDatabaseInstance CloudDatabaseUser CloudDNSDomain CloudDNSRecord CloudLoadBalancer CloudNetwork

List of all members.

Public Member Functions

def __init__
def human_id
 Subclasses may override this to provide a pretty ID which can be used for bash completion.
def __getattr__
 Many objects are lazy-loaded: only their most basic details are initially returned.
def __repr__
def get
 Gets the details for the object.
def delete
 Deletes the object.
def __eq__
 Two resource objects that represent the same entity in the cloud should be considered equal if they have the same ID.

Public Attributes

 manager
 id

Static Public Attributes

 HUMAN_ID = False
string NAME_ATTR = "name"
 get_details = True
 reload = get

Properties

 loaded = property(_get_loaded, _set_loaded)

Detailed Description

A resource represents a particular instance of an object (server, flavor, etc).

This is pretty much just a bag for attributes.


Constructor & Destructor Documentation

def __init__ (   self,
  manager,
  info,
  key = None,
  loaded = False 
)

Member Function Documentation

def __eq__ (   self,
  other 
)

Two resource objects that represent the same entity in the cloud should be considered equal if they have the same ID.

If they don't have IDs, but their attribute info matches, they are equal.

def __getattr__ (   self,
  key 
)

Many objects are lazy-loaded: only their most basic details are initially returned.

The first time any of the other attributes are referenced, a GET is made to get the full details for the object.

def __repr__ (   self)
def delete (   self)
def get (   self)

Gets the details for the object.

Reimplemented in CloudDatabaseInstance, CloudDNSRecord, and CloudNetwork.

def human_id (   self)

Subclasses may override this to provide a pretty ID which can be used for bash completion.


Member Data Documentation

get_details = True [static]
HUMAN_ID = False [static]
id

Reimplemented in CloudNetwork.

string NAME_ATTR = "name" [static]
reload = get [static]

Property Documentation

loaded = property(_get_loaded, _set_loaded) [static]

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