diff options
author | Kenneth Falck <kennu@iki.fi> | 2011-05-25 21:27:55 +0300 |
---|---|---|
committer | Kenneth Falck <kennu@iki.fi> | 2011-05-25 21:27:55 +0300 |
commit | d68fd2719fffe0f5dcc3d6cda6c762e77e71b7dc (patch) | |
tree | 90778afb47b7ba35cd02112ea13067d6c54702c7 /bin/route53 | |
parent | 1cc9a535752cabe3b38b926c35ed59ae868e0d1b (diff) | |
download | boto-d68fd2719fffe0f5dcc3d6cda6c762e77e71b7dc.tar.gz |
Added Alias Resource Record Sets support to Route 53
Diffstat (limited to 'bin/route53')
-rwxr-xr-x | bin/route53 | 18 |
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 |