pyrax
Python Bindings for the Rackspace Cloud
|
A resource represents a particular instance of an object (server, flavor, etc). More...
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) |
A resource represents a particular instance of an object (server, flavor, etc).
This is pretty much just a bag for attributes.
def __init__ | ( | self, | |
manager, | |||
info, | |||
key = None , |
|||
loaded = False |
|||
) |
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 | ) |
Deletes the object.
Reimplemented in CloudDatabaseUser, CloudDatabaseDatabase, CloudNetwork, CloudBlockStorageSnapshot, and CloudDNSRecord.
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.
get_details = True [static] |
Reimplemented in CloudDatabaseFlavor, CloudDatabaseUser, and CloudDatabaseDatabase.
HUMAN_ID = False [static] |
Reimplemented in CloudNetwork.
string NAME_ATTR = "name" [static] |
loaded = property(_get_loaded, _set_loaded) [static] |