Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(792)

Unified Diff: boto/route53/connection.py

Issue 8386013: Merging in latest boto. (Closed) Base URL: svn://svn.chromium.org/boto
Patch Set: Redoing vendor drop by deleting and then merging. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « boto/roboto/param.py ('k') | boto/route53/record.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: boto/route53/connection.py
diff --git a/boto/route53/connection.py b/boto/route53/connection.py
index bbd218ca935a4181963cd28de23979d7dd58ad52..7c3f1b88c336961bf4c2dcc80ae0e008c72873b0 100644
--- a/boto/route53/connection.py
+++ b/boto/route53/connection.py
@@ -45,10 +45,14 @@ HZXML = """<?xml version="1.0" encoding="UTF-8"?>
#boto.set_stream_logger('dns')
class Route53Connection(AWSAuthConnection):
-
DefaultHost = 'route53.amazonaws.com'
- Version = '2010-10-01'
- XMLNameSpace = 'https://route53.amazonaws.com/doc/2010-10-01/'
+ """The default Route53 API endpoint to connect to."""
+
+ Version = '2011-05-05'
+ """Route53 API version."""
+
+ XMLNameSpace = 'https://route53.amazonaws.com/doc/2011-05-05/'
+ """XML schema for this Route53 API version."""
def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
port=None, proxy=None, proxy_port=None,
@@ -71,12 +75,20 @@ class Route53Connection(AWSAuthConnection):
# Hosted Zones
- def get_all_hosted_zones(self):
+ def get_all_hosted_zones(self, start_marker=None, zone_list=None):
"""
Returns a Python data structure with information about all
Hosted Zones defined for the AWS account.
+
+ :param int start_marker: start marker to pass when fetching additional
+ results after a truncated list
+ :param list zone_list: a HostedZones list to prepend to results
"""
- response = self.make_request('GET', '/%s/hostedzone' % self.Version)
+ params = {}
+ if start_marker:
+ params = {'marker': start_marker}
+ response = self.make_request('GET', '/%s/hostedzone' % self.Version,
+ params=params)
body = response.read()
boto.log.debug(body)
if response.status >= 300:
@@ -87,8 +99,14 @@ class Route53Connection(AWSAuthConnection):
item_marker=('HostedZone',))
h = boto.jsonresponse.XmlHandler(e, None)
h.parse(body)
+ if zone_list:
+ e['ListHostedZonesResponse']['HostedZones'].extend(zone_list)
+ while e['ListHostedZonesResponse'].has_key('NextMarker'):
+ next_marker = e['ListHostedZonesResponse']['NextMarker']
+ zone_list = e['ListHostedZonesResponse']['HostedZones']
+ e = self.get_all_hosted_zones(next_marker, zone_list)
return e
-
+
def get_hosted_zone(self, hosted_zone_id):
"""
Get detailed information about a particular Hosted Zone.
@@ -118,28 +136,25 @@ class Route53Connection(AWSAuthConnection):
:type domain_name: str
:param domain_name: The name of the domain. This should be a
- fully-specified domain, and should end with
- a final period as the last label indication.
- If you omit the final period, Amazon Route 53
- assumes the domain is relative to the root.
- This is the name you have registered with your
- DNS registrar. It is also the name you will
- delegate from your registrar to the Amazon
- Route 53 delegation servers returned in
- response to this request.A list of strings
- with the image IDs wanted
+ fully-specified domain, and should end with a final period
+ as the last label indication. If you omit the final period,
+ Amazon Route 53 assumes the domain is relative to the root.
+ This is the name you have registered with your DNS registrar.
+ It is also the name you will delegate from your registrar to
+ the Amazon Route 53 delegation servers returned in
+ response to this request.A list of strings with the image
+ IDs wanted.
:type caller_ref: str
:param caller_ref: A unique string that identifies the request
- and that allows failed CreateHostedZone requests
- to be retried without the risk of executing the
- operation twice.
- If you don't provide a value for this, boto will
- generate a Type 4 UUID and use that.
+ and that allows failed CreateHostedZone requests to be retried
+ without the risk of executing the operation twice. If you don't
+ provide a value for this, boto will generate a Type 4 UUID and
+ use that.
:type comment: str
- :param comment: Any comments you want to include about the hosted
- zone.
+ :param comment: Any comments you want to include about the hosted
+ zone.
"""
if caller_ref is None:
@@ -182,7 +197,7 @@ class Route53Connection(AWSAuthConnection):
# Resource Record Sets
def get_all_rrsets(self, hosted_zone_id, type=None,
- name=None, maxitems=None):
+ name=None, identifier=None, maxitems=None):
"""
Retrieve the Resource Record Sets defined for this Hosted Zone.
Returns the raw XML data returned by the Route53 call.
@@ -192,29 +207,50 @@ class Route53Connection(AWSAuthConnection):
:type type: str
:param type: The type of resource record set to begin the record
- listing from. Valid choices are:
+ listing from. Valid choices are:
- * A
- * AAAA
- * CNAME
- * MX
- * NS
- * PTR
- * SOA
- * SPF
- * SRV
- * TXT
+ * A
+ * AAAA
+ * CNAME
+ * MX
+ * NS
+ * PTR
+ * SOA
+ * SPF
+ * SRV
+ * TXT
+
+ Valid values for weighted resource record sets:
+
+ * A
+ * AAAA
+ * CNAME
+ * TXT
+
+ Valid values for Zone Apex Aliases:
+
+ * A
+ * AAAA
:type name: str
:param name: The first name in the lexicographic ordering of domain
names to be retrieved
+ :type identifier: str
+ :param identifier: In a hosted zone that includes weighted resource
+ record sets (multiple resource record sets with the same DNS
+ name and type that are differentiated only by SetIdentifier),
+ if results were truncated for a given DNS name and type,
+ the value of SetIdentifier for the next resource record
+ set that has the current DNS name and type
+
:type maxitems: int
:param maxitems: The maximum number of records
"""
from boto.route53.record import ResourceRecordSets
- params = {'type': type, 'name': name, 'maxitems': maxitems}
+ params = {'type': type, 'name': name,
+ 'Identifier': identifier, 'maxitems': maxitems}
uri = '/%s/hostedzone/%s/rrset' % (self.Version, hosted_zone_id)
response = self.make_request('GET', uri, params=params)
body = response.read()
@@ -240,7 +276,7 @@ class Route53Connection(AWSAuthConnection):
:type xml_body: str
:param xml_body: The list of changes to be made, defined in the
- XML schema defined by the Route53 service.
+ XML schema defined by the Route53 service.
"""
uri = '/%s/hostedzone/%s/rrset' % (self.Version, hosted_zone_id)
@@ -267,8 +303,7 @@ class Route53Connection(AWSAuthConnection):
:type change_id: str
:param change_id: The unique identifier for the set of changes.
- This ID is returned in the response to the
- change_rrsets method.
+ This ID is returned in the response to the change_rrsets method.
"""
uri = '/%s/change/%s' % (self.Version, change_id)
« no previous file with comments | « boto/roboto/param.py ('k') | boto/route53/record.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698