Skip to content

Instantly share code, notes, and snippets.

@icanhazdevops
Last active December 21, 2015 07:58
Show Gist options
  • Save icanhazdevops/6274418 to your computer and use it in GitHub Desktop.
Save icanhazdevops/6274418 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import os
import sys
import time
import pyrax
from os.path import expanduser
home = expanduser("~")
pyrax.set_setting("identity_type", "rackspace")
creds_file = os.path.expanduser("~/.rackspace_cloud_credentials")
pyrax.set_credential_file(creds_file)
#Set the ttl you want
ttl_time=300
dns = pyrax.cloud_dns
domains = dns.list()
for domain in domains:
domain.update(ttl=ttl_time)
print "Updating:", domain.name , "to ttl of" , ttl_time
records = domain.list_records()
for record in records:
print "Updating:", record.name , "to ttl of" , ttl_time
record.update(ttl=ttl_time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment