summaryrefslogtreecommitdiff
path: root/bin/route53
diff options
context:
space:
mode:
authorKenneth Falck <kennu@iki.fi>2011-05-25 21:27:55 +0300
committerKenneth Falck <kennu@iki.fi>2011-05-25 21:27:55 +0300
commitd68fd2719fffe0f5dcc3d6cda6c762e77e71b7dc (patch)
tree90778afb47b7ba35cd02112ea13067d6c54702c7 /bin/route53
parent1cc9a535752cabe3b38b926c35ed59ae868e0d1b (diff)
downloadboto-d68fd2719fffe0f5dcc3d6cda6c762e77e71b7dc.tar.gz
Added Alias Resource Record Sets support to Route 53
Diffstat (limited to 'bin/route53')
-rwxr-xr-xbin/route5318
1 files changed, 17 insertions, 1 deletions
diff --git a/bin/route53 b/bin/route53
index aef79d69..ae42541c 100755
--- a/bin/route53
+++ b/bin/route53
@@ -37,7 +37,7 @@ def get(conn, hosted_zone_id, type=None, name=None, maxitems=None):
response = conn.get_all_rrsets(hosted_zone_id, type, name, maxitems=maxitems)[:]
print '%-40s %-5s %-20s %s' % ("Name", "Type", "TTL", "Value(s)")
for record in response:
- print '%-40s %-5s %-20s %s' % (record.name, record.type, record.ttl, ",".join(record.resource_records))
+ print '%-40s %-5s %-20s %s' % (record.name, record.type, record.ttl, record.to_print())
def add_record(conn, hosted_zone_id, name, type, value, ttl=600, comment=""):
@@ -56,6 +56,22 @@ def del_record(conn, hosted_zone_id, name, type, value, ttl=600, comment=""):
change.add_value(value)
print changes.commit()
+def add_alias(conn, hosted_zone_id, name, type, alias_hosted_zone_id, alias_dns_name, comment=""):
+ """Add a new alias to a zone"""
+ from boto.route53.record import ResourceRecordSets
+ changes = ResourceRecordSets(conn, hosted_zone_id, comment)
+ change = changes.add_change("CREATE", name, type)
+ change.set_alias((alias_hosted_zone_id, alias_dns_name))
+ print changes.commit()
+
+def del_alias(conn, hosted_zone_id, name, type, alias_hosted_zone_id, alias_dns_name, comment=""):
+ """Delete an alias from a zone"""
+ from boto.route53.record import ResourceRecordSets
+ changes = ResourceRecordSets(conn, hosted_zone_id, comment)
+ change = changes.add_change("DELETE", name, type)
+ change.set_alias((alias_hosted_zone_id, alias_dns_name))
+ print changes.commit()
+
def change_record(conn, hosted_zone_id, name, type, values, ttl=600, comment=""):
"""Delete and then add a record to a zone"""
from boto.route53.record import ResourceRecordSets