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

This class represents a DNS domain. More...

Inheritance diagram for CloudDNSDomain:
BaseResource

List of all members.

Public Member Functions

def delete
 Deletes this domain and all of its resource records.
def changes_since
 Gets the changes for this domain since the specified date/datetime.
def export
 Provides the BIND (Berkeley Internet Name Domain) 9 formatted contents of the requested domain.
def update
 Provides a way to modify the following attributes of a domain entry:
def list_subdomains
 Returns a list of all subdomains for this domain.
def list_records
 Returns a list of all records configured for this domain.
def search_records
 Returns a list of all records configured for this 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 get_record
 Gets the full information for an existing record for this domain.
def update_record
 Modifies an existing record for this domain.
def delete_record
 Deletes an existing record for this domain.

Static Public Attributes

 add_record = add_records

Detailed Description

This class represents a DNS domain.


Member Function Documentation

def add_records (   self,
  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,
  date_or_datetime 
)

Gets the changes for this 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,
  delete_subdomains = False 
)

Deletes this domain and all of its resource records.

If this 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_record (   self,
  record 
)

Deletes an existing record for this domain.

def export (   self)

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,
  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_record (   self,
  record 
)

Gets the full information for an existing record for this domain.

def list_records (   self,
  limit = None,
  offset = None 
)

Returns a list of all records configured for this domain.

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

Returns a list of all subdomains for this domain.

def search_records (   self,
  record_type,
  name = None,
  data = None 
)

Returns a list of all records configured for this domain that match the supplied search criteria.

def update (   self,
  emailAddress = None,
  ttl = None,
  comment = None 
)

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

  • email address
  • ttl setting
  • comment
def update_record (   self,
  record,
  data = None,
  priority = None,
  ttl = None,
  comment = None 
)

Modifies an existing record for this domain.


Member Data Documentation

add_record = add_records [static]

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