rackspace/python-clouddns — pull request #11 by rackerhacker (2012-04-10 04:57:22+00:00)
Title: Adding domain import from BIND zone file support.

This could probably be cleaned up a little. Here's a good way to test it:

#!/usr/bin/python
from clouddns import connection

bind_zone_file = """tootytoootoooooot.com. 3600 IN SOA ns.rackspace.com. sample@rackspace.com. 1308874739 3600 3600 3600 3600
tootytoootoooooot.com. 86400 IN A 110.11.12.16
tootytoootoooooot.com. 3600 IN MX 5 mail2.tootytoootoooooot.com.
www.tootytoootoooooot.com. 5400 IN CNAME tootytoootoooooot.com."""

raxdns = connection.Connection('username', 'apikey')

#domain = raxdns.get_domain(name='tootytoootoooooot.com')
#raxdns.delete_domain(domain.id)

print raxdns.import_domain(bind_zone_file)