summaryrefslogtreecommitdiff
path: root/bin/route53
diff options
context:
space:
mode:
authorChris Moyer <kopertop@MacPro.local>2011-02-02 11:06:55 -0500
committerChris Moyer <kopertop@MacPro.local>2011-02-02 11:06:55 -0500
commit89a69e651f0614651e720183f0e9116d4c7165be (patch)
treec09fe7f62e7f70eecec061b64233b04722bb9978 /bin/route53
parentfc797d41a782299d8ace20da2867793f9888d81e (diff)
downloadboto-89a69e651f0614651e720183f0e9116d4c7165be.tar.gz
Fixed up route53 command line script to include a delete method and
properly print out zone info on creation
Diffstat (limited to 'bin/route53')
-rwxr-xr-xbin/route5313
1 files changed, 11 insertions, 2 deletions
diff --git a/bin/route53 b/bin/route53
index ed1f48df..58e113a1 100755
--- a/bin/route53
+++ b/bin/route53
@@ -15,8 +15,16 @@ def _print_zone_info(zoneinfo):
def create(conn, hostname, caller_reference=None, comment=''):
+ """Create a hosted zone, returning the nameservers"""
response = conn.create_hosted_zone(hostname, caller_reference, comment)
- _print_zone_info(response['CreateHostedZoneResponse'])
+ print "Pending, please add the following Name Servers:"
+ for ns in response.NameServers:
+ print "\t", ns
+
+def delete_zone(conn, hosted_zone_id):
+ """Delete a hosted zone by ID"""
+ response = conn.delete_hosted_zone(hosted_zone_id)
+ print response
def ls(conn):
"""List all hosted zones"""
@@ -25,6 +33,7 @@ def ls(conn):
_print_zone_info(zoneinfo)
def get(conn, hosted_zone_id, type=None, name=None, maxitems=None):
+ """Get all the records for a single zone"""
response = conn.get_all_rrsets(hosted_zone_id, type, name, maxitems=maxitems)
print '%-20s %-20s %-20s %s' % ("Name", "Type", "TTL", "Value(s)")
for record in response:
@@ -32,7 +41,7 @@ def get(conn, hosted_zone_id, type=None, name=None, maxitems=None):
def add_record(conn, hosted_zone_id, name, type, value, ttl=600, comment=""):
- """Add a new record"""
+ """Add a new record to a zone"""
from boto.route53.record import ResourceRecordSets
changes = ResourceRecordSets(conn, hosted_zone_id, comment)
change = changes.add_change("CREATE", name, type, ttl)