Last active
December 21, 2015 07:58
-
-
Save icanhazdevops/6274418 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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