pyrax
Python Bindings for the Rackspace Cloud
 All Classes Namespaces Files Functions Variables Properties
Public Member Functions | Static Public Attributes
CloudDNSClient Class Reference

This is the primary class for interacting with Cloud DNS. More...

Inheritance diagram for CloudDNSClient:
BaseClient

List of all members.

Public Member Functions

def set_timeout
 Sets the amount of time that calls will wait for a response from the DNS system before timing out.
def set_delay
 Changes the interval that the program will pause in between attempts to see if a request has completed.
def list
 Returns a list of all resources.
def list_previous_page
 Returns the previous page of results.
def list_next_page
 Returns the next page of results.
def get_domain_iterator
 Returns an iterator that will return each available domain.
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 delete
 Deletes the specified domain and all of its resource records.
def list_subdomains
 Returns a list of all subdomains for the specified domain.
def get_subdomain_iterator
 Returns an iterator that will return each available subdomain for the specified domain.
def list_subdomains_previous_page
 Returns the previous page of subdomain results.
def list_subdomains_next_page
 Returns the next page of subdomain results.
def list_records
 Returns a list of all records configured for the specified domain.
def get_record_iterator
 Returns an iterator that will return each available DNS record for the specified domain.
def list_records_previous_page
 Returns the previous page of record results.
def list_records_next_page
 Returns the next page of record results.
def search_records
 Returns a list of all records configured for the specified domain that match the supplied search criteria.
def find_record
 Returns a single record for this domain that matches the supplied search criteria.
def add_records
 Adds the records to this domain.
def update_record
 Modifies an existing record for a domain.
def delete_record
 Deletes an existing record for this 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 get_absolute_limits
 Returns a dict with the absolute limits for the current account.
def get_rate_limits
 Returns a dict with the current rate limit information for domain and status requests.

Static Public Attributes

string name = "Cloud DNS"
 add_record = add_records

Detailed Description

This is the primary class for interacting with Cloud DNS.


Member Function Documentation

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:

  • type (required)
  • name (required)
  • data (required)
  • ttl (optional)
  • comment (optional)
  • priority (required for MX and SRV records; forbidden otherwise)
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:

  • a Python datetime object
  • a Python date object
  • a string in the format 'YYYY-MM-YY HH:MM:SS'
  • a string in the format 'YYYY-MM-YY'

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 this 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 find_record (   self,
  domain,
  record_type,
  name = None,
  data = None 
)

Returns a single record for this domain that matches the supplied search criteria.

If no record matches, a DomainRecordNotFound exception will be raised. If more than one matches, a DomainRecordNotUnique exception will be raised.

def get_absolute_limits (   self)

Returns a dict with the absolute limits for the current account.

def get_domain_iterator (   self)

Returns an iterator that will return each available domain.

If there are more than the limit of 100 domains, the iterator will continue to fetch domains from the API until all domains have been returned.

def get_rate_limits (   self)

Returns a dict with the current rate limit information for domain and status requests.

def get_record_iterator (   self,
  domain 
)

Returns an iterator that will return each available DNS record for the specified domain.

If there are more than the limit of 100 records, the iterator will continue to fetch records from the API until all records have been returned.

def get_subdomain_iterator (   self,
  domain,
  limit = None,
  offset = None 
)

Returns an iterator that will return each available subdomain for the specified domain.

If there are more than the limit of 100 subdomains, the iterator will continue to fetch subdomains from the API until all subdomains have been returned.

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 
)

Returns a list of all resources.

Reimplemented from BaseClient.

def list_next_page (   self)

Returns the next page of results.

def list_previous_page (   self)

Returns the previous page of results.

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)

Returns the next page of record results.

Returns the previous page of record results.

def list_subdomains (   self,
  domain,
  limit = None,
  offset = None 
)

Returns a list of all subdomains for the specified domain.

def list_subdomains_next_page (   self)

Returns the next page of subdomain results.

Returns the previous page of subdomain results.

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 set_delay (   self,
  delay 
)

Changes the interval that the program will pause in between attempts to see if a request has completed.

def set_timeout (   self,
  timeout 
)

Sets the amount of time that calls will wait for a response from the DNS system before timing out.

Setting the timeout to zero will cause execution to wait indefinitely until the call completes.

def update_domain (   self,
  domain,
  emailAddress = None,
  ttl = None,
  comment = None 
)

Provides a way to modify the following attributes of a domain record:

  • email address
  • ttl setting
  • comment
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.


Member Data Documentation

add_record = add_records [static]
string name = "Cloud DNS" [static]

Reimplemented from BaseClient.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Properties