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 |
Returns a list of resource objects. | |
def | head |
Makes a HEAD request on a specific item. | |
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`.
Reimplemented in ImageTasksManager, and ImageMemberManager.
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 QueueManager, and CloudDatabaseManager.
def head | ( | self, | |
item | |||
) |
Makes a HEAD request on a specific item.
def list | ( | self, | |
limit = None , |
|||
marker = None , |
|||
return_raw = False |
|||
) |
Returns a list of resource objects.
Pagination is supported through the optional 'marker' and 'limit' parameters.
Some APIs do not follow the typical pattern in their responses, and the BaseManager subclasses will have to parse the raw response to get the desired information. For those cases, pass 'return_raw=True', and the response and response_body will be returned unprocessed.
def run_hooks | ( | cls, | |
hook_type, | |||
args, | |||
kwargs | |||
) |
plural_response_key = None [static] |
Reimplemented in FakeImageManager, FakeDNSManager, and QueueMessageManager.
resource_class = None [static] |
Reimplemented in FakeImageManager, and FakeDNSManager.
response_key = None [static] |
Reimplemented in FakeDNSManager.
uri_base = None [static] |
Reimplemented in FakeDNSManager, and FakeDatabaseManager.