pyrax
Python Bindings for the Rackspace Cloud
|
The base class for all pyrax clients. More...
Public Member Functions | |
def | __init__ |
def | list |
Returns a list of all resources. | |
def | get |
Gets a specific resource. | |
def | create |
Creates a new resource. | |
def | delete |
Deletes a specific resource. | |
def | find |
Finds a single item with attributes matching ``**kwargs``. | |
def | findall |
Finds all items with attributes matching ``**kwargs``. | |
def | unauthenticate |
Clears all of our authentication information. | |
def | get_timings |
Returns a list of all execution timings. | |
def | reset_timings |
Clears the timing history. | |
def | http_log_req |
When self.http_log_debug is True, outputs the equivalent `curl` command for the API request being made. | |
def | http_log_resp |
When self.http_log_debug is True, outputs the response received from the API request. | |
def | request |
Formats the request into a dict representing the headers and body that will be used to make the API call. | |
def | method_get |
Method used to make GET requests. | |
def | method_post |
Method used to make POST requests. | |
def | method_put |
Method used to make PUT requests. | |
def | method_delete |
Method used to make DELETE requests. | |
def | authenticate |
Handles all aspects of authentication against the cloud provider. | |
def | projectid |
The older parts of this code used 'projectid'; this wraps that reference. | |
Public Attributes | |
version | |
region_name | |
endpoint_type | |
service_type | |
service_name | |
management_url | |
timings | |
verify_ssl | |
http_log_debug | |
times | |
force_exception_to_status_code | |
disable_ssl_certificate_validation | |
Static Public Attributes | |
user_agent = None | |
string | name = "base" |
The base class for all pyrax clients.
def __init__ | ( | self, | |
region_name = None , |
|||
endpoint_type = "publicURL" , |
|||
management_url = None , |
|||
service_type = None , |
|||
service_name = None , |
|||
timings = False , |
|||
verify_ssl = True , |
|||
http_log_debug = False , |
|||
timeout = None |
|||
) |
def authenticate | ( | self | ) |
Handles all aspects of authentication against the cloud provider.
Currently this has only been tested with Rackspace auth; if you wish to use this library with a different OpenStack provider, you may have to modify this method. Please post your findings on GitHub so that others can benefit.
def create | ( | self, | |
args, | |||
kwargs | |||
) |
Creates a new resource.
def delete | ( | self, | |
item | |||
) |
Deletes a specific resource.
Reimplemented in CloudNetworkClient.
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.
def get | ( | self, | |
item | |||
) |
Gets a specific resource.
def get_timings | ( | self | ) |
Returns a list of all execution timings.
def http_log_req | ( | self, | |
args, | |||
kwargs | |||
) |
When self.http_log_debug is True, outputs the equivalent `curl` command for the API request being made.
def http_log_resp | ( | self, | |
resp, | |||
body | |||
) |
When self.http_log_debug is True, outputs the response received from the API request.
def list | ( | self, | |
limit = None , |
|||
marker = None |
|||
) |
Returns a list of all resources.
Reimplemented in CloudDNSClient.
def method_delete | ( | self, | |
uri, | |||
kwargs | |||
) |
Method used to make DELETE requests.
def method_get | ( | self, | |
uri, | |||
kwargs | |||
) |
Method used to make GET requests.
def method_post | ( | self, | |
uri, | |||
kwargs | |||
) |
Method used to make POST requests.
def method_put | ( | self, | |
uri, | |||
kwargs | |||
) |
Method used to make PUT requests.
def projectid | ( | self | ) |
The older parts of this code used 'projectid'; this wraps that reference.
def request | ( | self, | |
args, | |||
kwargs | |||
) |
Formats the request into a dict representing the headers and body that will be used to make the API call.
def reset_timings | ( | self | ) |
Clears the timing history.
def unauthenticate | ( | self | ) |
Clears all of our authentication information.
string name = "base" [static] |
Reimplemented in CloudLoadBalancerClient, CloudDNSClient, CloudDatabaseClient, CloudBlockStorageClient, and CloudNetworkClient.
user_agent = None [static] |