pyrax
Python Bindings for the Rackspace Cloud
|
Public Member Functions | |
def | __init__ |
def | list |
Gets a list of all domains, or optionally a page of domains. | |
def | list_previous_page |
When paging through results, this will return the previous page, using the same limit. | |
def | list_next_page |
When paging through results, this will return the next page, using the same limit. | |
def | delete |
Deletes the specified domain and all of its resource records. | |
def | findall |
Finds all items with attributes matching ``**kwargs``. | |
def | changes_since |
Gets the changes for a domain since the specified date/datetime. | |
def | export_domain |
Provides the BIND (Berkeley Internet Name Domain) 9 formatted contents of the requested domain. | |
def | import_domain |
Takes a string in the BIND 9 format and creates a new domain. | |
def | update_domain |
Provides a way to modify the following attributes of a domain record: | |
def | list_subdomains |
Returns a list of all subdomains of the specified domain. | |
def | list_subdomains_previous_page |
When paging through subdomain results, this will return the previous page, using the same limit. | |
def | list_subdomains_next_page |
When paging through subdomain results, this will return the next page, using the same limit. | |
def | list_records |
Returns a list of all records configured for the specified domain. | |
def | list_records_previous_page |
When paging through record results, this will return the previous page, using the same limit. | |
def | list_records_next_page |
When paging through record results, this will return the next page, using the same limit. | |
def | search_records |
Returns a list of all records configured for the specified domain that match the supplied search criteria. | |
def | add_records |
Adds the records to this domain. | |
def | get_record |
Gets the full information for an existing record for this domain. | |
def | update_record |
Modifies an existing record for a domain. | |
def | delete_record |
Deletes an existing record for a domain. | |
def | list_ptr_records |
Returns a list of all PTR records configured for this device. | |
def | add_ptr_records |
Adds one or more PTR records to the specified device. | |
def | update_ptr_record |
Updates a PTR record with the supplied values. | |
def | delete_ptr_records |
Deletes the PTR records for the specified device. |
def __init__ | ( | self, | |
api, | |||
resource_class = None , |
|||
response_key = None , |
|||
plural_response_key = None , |
|||
uri_base = None |
|||
) |
Reimplemented from BaseManager.
def add_ptr_records | ( | self, | |
device, | |||
records | |||
) |
Adds one or more PTR records to the specified device.
def add_records | ( | self, | |
domain, | |||
records | |||
) |
Adds the records to this domain.
Each record should be a dict with the following keys:
def changes_since | ( | self, | |
domain, | |||
date_or_datetime | |||
) |
Gets the changes for a domain since the specified date/datetime.
The date can be one of:
It returns a list of dicts, whose keys depend on the specific change that was made. A simple example of such a change dict:
{u'accountId': 000000, u'action': u'update', u'changeDetails': [{u'field': u'serial_number', u'newValue': u'1354038941', u'originalValue': u'1354038940'}, {u'field': u'updated_at', u'newValue': u'Tue Nov 27 17:55:41 UTC 2012', u'originalValue': u'Tue Nov 27 17:55:40 UTC 2012'}], u'domain': u'example.com', u'targetId': 00000000, u'targetType': u'Domain'}
def delete | ( | self, | |
domain, | |||
delete_subdomains = False |
|||
) |
Deletes the specified domain and all of its resource records.
If the domain has subdomains, each subdomain will now become a root domain. If you wish to also delete any subdomains, pass True to 'delete_subdomains'.
def delete_ptr_records | ( | self, | |
device, | |||
ip_address = None |
|||
) |
Deletes the PTR records for the specified device.
If 'ip_address' is supplied, only the PTR records with that IP address will be deleted.
def delete_record | ( | self, | |
domain, | |||
record | |||
) |
Deletes an existing record for a domain.
def export_domain | ( | self, | |
domain | |||
) |
Provides the BIND (Berkeley Internet Name Domain) 9 formatted contents of the requested domain.
This call is for a single domain only, and as such, does not provide subdomain information.
Sample export: {u'accountId': 000000, u'contentType': u'BIND_9', u'contents': u'example.com..rackspace.com. ' 'foo@example.com. 1354202974 21600 3600 1814400 500' 'example.com..stabletransit.com.' 'example.com..stabletransit.com.', u'id': 1111111}
def findall | ( | self, | |
kwargs | |||
) |
Finds all items with attributes matching ``**kwargs``.
Normally this isn't very efficient, since the default action is to load the entire list and then filter on the Python side, but the DNS API provides a more efficient search option when filtering on name. So if the filter is on name, use that; otherwise, use the default.
Reimplemented from BaseManager.
def get_record | ( | self, | |
domain, | |||
record | |||
) |
Gets the full information for an existing record for this domain.
def import_domain | ( | self, | |
domain_data | |||
) |
Takes a string in the BIND 9 format and creates a new domain.
See the 'export_domain()' method for a description of the format.
def list | ( | self, | |
limit = None , |
|||
offset = None |
|||
) |
Gets a list of all domains, or optionally a page of domains.
Reimplemented from BaseManager.
def list_next_page | ( | self | ) |
When paging through results, this will return the next page, using the same limit.
If there are no more results, a NoMoreResults exception will be raised.
def list_previous_page | ( | self | ) |
When paging through results, this will return the previous page, using the same limit.
If there are no more results, a NoMoreResults exception will be raised.
def list_ptr_records | ( | self, | |
device | |||
) |
Returns a list of all PTR records configured for this device.
def list_records | ( | self, | |
domain, | |||
limit = None , |
|||
offset = None |
|||
) |
Returns a list of all records configured for the specified domain.
def list_records_next_page | ( | self | ) |
When paging through record results, this will return the next page, using the same limit.
If there are no more results, a NoMoreResults exception will be raised.
def list_records_previous_page | ( | self | ) |
When paging through record results, this will return the previous page, using the same limit.
If there are no more results, a NoMoreResults exception will be raised.
def list_subdomains | ( | self, | |
domain, | |||
limit = None , |
|||
offset = None |
|||
) |
Returns a list of all subdomains of the specified domain.
def list_subdomains_next_page | ( | self | ) |
When paging through subdomain results, this will return the next page, using the same limit.
If there are no more results, a NoMoreResults exception will be raised.
def list_subdomains_previous_page | ( | self | ) |
When paging through subdomain results, this will return the previous page, using the same limit.
If there are no more results, a NoMoreResults exception will be raised.
def search_records | ( | self, | |
domain, | |||
record_type, | |||
name = None , |
|||
data = None |
|||
) |
Returns a list of all records configured for the specified domain that match the supplied search criteria.
def update_domain | ( | self, | |
domain, | |||
emailAddress = None , |
|||
ttl = None , |
|||
comment = None |
|||
) |
Provides a way to modify the following attributes of a domain record:
def update_ptr_record | ( | self, | |
device, | |||
record, | |||
domain_name, | |||
data = None , |
|||
ttl = None , |
|||
comment = None |
|||
) |
Updates a PTR record with the supplied values.
def update_record | ( | self, | |
domain, | |||
record, | |||
data = None , |
|||
priority = None , |
|||
ttl = None , |
|||
comment = None |
|||
) |
Modifies an existing record for a domain.