pyrax
Python Bindings for the Rackspace Cloud
|
Managers interact with a particular type of API (servers, databases, dns, etc.) and provide CRUD operations for them. More...
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 |
Managers interact with a particular type of API (servers, databases, dns, etc.) and provide CRUD operations for them.
def __init__ | ( | self, | |
api, | |||
resource_class = None , |
|||
response_key = None , |
|||
plural_response_key = None , |
|||
uri_base = None |
|||
) |
Reimplemented in ScalingGroupManager, and CloudDNSManager.
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, | |||
args, | |||
kwargs | |||
) |
Subclasses need to implement the _create_body() method to return a dict that will be used for the API request body.
For cases where no response is returned from the API on creation, pass `return_none=True` so that the _create method doesn't expect one.
For cases where you do not want the _create method to attempt to parse the response, but instead have it returned directly, pass `return_raw=True`.
For cases where the API returns information in the response and not the response_body, pass `return_response=True`.
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 | |||
) |
plural_response_key = None [static] |
resource_class = None [static] |
response_key = None [static] |
uri_base = None [static] |