ó FRTc@sĀddlmZddlZddlZddlZddlZddlmZddlm Z ddl Zddl m Z ddl mZddlmZmZdZd efd „ƒYZdS( i’’’’(t exceptionN(tAWSAuthConnection(thandler(tResourceRecordSets(tZone(tsixturllibs %(name)s %(caller_ref)s %(comment)s tRoute53Connectionc BseZdZdZdZdddddeddeddd„ Zd„Zdddd„Z ddd„Z d „Z d „Z ddd „Z d „Zd Zdd„Zddd„Zd„Zddddd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(sroute53.amazonaws.coms 2013-04-01s-https://route53.amazonaws.com/doc/2013-04-01/ic CsJtt|ƒj|||t|||d|d|d| d| d| ƒdS(Ntdebugtsecurity_tokentvalidate_certsthttps_connection_factoryt profile_name(tsuperRt__init__tTrue( tselftaws_access_key_idtaws_secret_access_keytporttproxyt proxy_portthostRR R R R ((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pyR?scCsdgS(Ntroute53((R((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pyt_required_auth_capabilityMstc Cs§|rg}xVtj|ƒD]E\}}|dkr:qn|j|dtjjt|ƒƒƒqW|ddj|ƒ7}nt t |ƒj ||||d|j ƒS(Nt=t?t&t retry_handler( Rt iteritemstNonetappendRtparsetquotetstrtjoinR Rt make_requestt_retry_handler( Rtactiontpaththeaderstdatatparamstpairstkeytval((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pyR%Ps +c Cs(i}|ri|d6}n|jdd|jd|ƒ}|jƒ}tjj|ƒ|jdkr„tj|j|j |ƒ‚ntj j dddd ƒ}tj j |d ƒ}|j|ƒ|rß|d dj|ƒnxBd |d kr#|d d }|d d}|j||ƒ}qāW|S(sA 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 tmarkertGETs/%s/hostedzoneR+i,t list_markert HostedZonest item_markert HostedZonetListHostedZonesResponset NextMarker(R4N(R%tVersiontreadtbototlogRtstatusRtDNSServerErrortreasont jsonresponsetElementt XmlHandlerRR!textendtget_all_hosted_zones( Rt start_markert zone_listR+tresponsetbodytetht next_marker((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pyRB^s,       cCsÆd|j|f}|jd|ƒ}|jƒ}tjj|ƒ|jdkrntj|j|j |ƒ‚ntj j ddddƒ}tj j |d ƒ}|j|ƒ|S( s· Get detailed information about a particular Hosted Zone. :type hosted_zone_id: str :param hosted_zone_id: The unique identifier for the Hosted Zone s/%s/hostedzone/%sR0i,R1t NameServersR3t NameServer(RKN(R7R%R8R9R:RR;RR<R=R>R?R@RR!(Rthosted_zone_idturiRERFRGRH((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pytget_hosted_zone~s     cCst|ddkr|d7}n|jƒ}xD|ddD]4}|d|kr8|j|djdƒdƒSq8WdS( sŃ Get detailed information about a particular Hosted Zone. :type hosted_zone_name: str :param hosted_zone_name: The fully qualified domain name for the Hosted Zone i’’’’t.R5R2tNametIdt/N(RBRNtsplit(Rthosted_zone_nametall_hosted_zonestzone((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pytget_hosted_zone_by_name”s   c Cs|dkr!ttjƒƒ}ni|d6|d6|d6|jd6}t|}d|j}|jd|idd6|ƒ}|jƒ}t j j |ƒ|j d krčt j jd d d dƒ} t j j| dƒ} | j|ƒ| Stj|j |j|ƒ‚dS(sĻ Create a new Hosted Zone. Returns a Python data structure with information about the newly created Hosted Zone. :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. :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. :type comment: str :param comment: Any comments you want to include about the hosted zone. tnamet caller_reftcommenttxmlnss/%s/hostedzonetPOSTstext/xmls Content-TypeiÉR1RJR3RKN(s NameServer(RR#tuuidtuuid4t XMLNameSpacetHZXMLR7R%R8R9R:RR;R>R?R@R!RR<R=( Rt domain_nameRYRZR+txml_bodyRMRERFRGRH((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pytcreate_hosted_zone„s*          cCs£d|j|f}|jd|ƒ}|jƒ}tjj|ƒ|jdkrntj|j|j |ƒ‚ntj j ƒ}tj j |dƒ}|j|ƒ|S(s› Delete the hosted zone specified by the given id. :type hosted_zone_id: str :param hosted_zone_id: The hosted zone's id s/%s/hostedzone/%stDELETEiČiĢ(iČiĢN(R7R%R8R9R:RR;RR<R=R>R?R@RR!(RRLRMRERFRGRH((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pytdelete_hosted_zoneŲs    s— %(caller_ref)s %(health_check)s c Csż|d kr!ttjƒƒ}nd|j}i|jd6|d6|jƒd6}|j|}|jd|idd6|ƒ}|j ƒ}t j j |ƒ|j dkrŽt jjƒ}t jj|d ƒ} | j|ƒ|Stj|j |j|ƒ‚d S( sģ Create a new Health Check :type health_check: HealthCheck :param health_check: HealthCheck object :type caller_ref: str :param caller_ref: A unique string that identifies the request and that allows failed CreateHealthCheckRequest 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. s/%s/healthcheckR[RYt health_checkR\stext/xmls Content-TypeiÉN(RR#R]R^R7R_tto_xmlt POSTHCXMLBodyR%R8R9R:RR;R>R?R@R!RR<R=( RRfRYRMR+RbRERFRGRH((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pytcreate_health_checkōs       c Csźi}|d k r||dR?R@R!( RRjR/R+RMRERFRGRH((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pytget_list_health_checkss"         cCs£d|j|f}|jd|ƒ}|jƒ}tjj|ƒ|jdkrntj|j|j |ƒ‚ntj j ƒ}tj j |dƒ}|j|ƒ|S(s Delete a health check :type health_check_id: str :param health_check_id: ID of the health check to delete s/%s/healthcheck/%sRdiČiĢ(iČiĢN(R7R%R8R9R:RR;RR<R=R>R?R@RR!(Rthealth_check_idRMRERFRGRH((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pytdelete_health_check5s    c CsŌi|d6|d6|d6|d6}d|j|f}|jd|d|ƒ}|jƒ} tjj| ƒ|jdkr–tj|j|j | ƒ‚nt d |d |ƒ} t j | |ƒ} t jj| | ƒ| S( s’ Retrieve the Resource Record Sets defined for this Hosted Zone. Returns the raw XML data returned by the Route53 call. :type hosted_zone_id: str :param hosted_zone_id: The unique identifier for the Hosted Zone :type type: str :param type: The type of resource record set to begin the record listing from. Valid choices are: * 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 ttypeRXt identifierRjs/%s/hostedzone/%s/rrsetR0R+i,t connectionRL(R7R%R8R9R:RR;RR<R=RRR@txmltsaxt parseString( RRLRpRXRqRjR+RMRERFtrsRH((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pytget_all_rrsetsLs4   cCs°d|j|f}|jd|idd6|ƒ}|jƒ}tjj|ƒ|jdkr{tj|j|j |ƒ‚ntj j ƒ}tj j |dƒ}|j|ƒ|S(sß Create or change the authoritative DNS information for this Hosted Zone. Returns a Python data structure with information about the set of changes, including the Change ID. :type hosted_zone_id: str :param hosted_zone_id: The unique identifier for the Hosted Zone :type xml_body: str :param xml_body: The list of changes to be made, defined in the XML schema defined by the Route53 service. s/%s/hostedzone/%s/rrsetR\stext/xmls Content-Typei,N(R7R%R8R9R:RR;RR<R=R>R?R@RR!(RRLRbRMRERFRGRH((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pyt change_rrsetss       cCs£d|j|f}|jd|ƒ}|jƒ}tjj|ƒ|jdkrntj|j|j |ƒ‚ntj j ƒ}tj j |dƒ}|j|ƒ|S(sƒ Get information about a proposed set of changes, as submitted by the change_rrsets method. Returns a Python data structure with status information about the changes. :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. s /%s/change/%sR0i,N(R7R%R8R9R:RR;RR<R=R>R?R@RR!(Rt change_idRMRERFRGRH((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pyt get_change­s     cCs$|j|ƒ}t||ddƒS(s” Create a new Hosted Zone. Returns a Zone object for the newly created Hosted Zone. :type name: str :param 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. tCreateHostedZoneResponseR4(RcR(RRXRV((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pyt create_zoneĘscCs=|j|ƒ}x'|jƒD]}||jkr|SqWdS(sö Returns a Zone object for the specified Hosted Zone. :param 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. N(t_make_qualifiedt get_zonesRX(RRXRV((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pytget_zoneŲscCs4|jƒ}g|ddD]}t||ƒ^qS(sø Returns a list of Zone objects, one for each of the Hosted Zones defined for the AWS account. :rtype: list :returns: A list of Zone objects. R5R2(RBR(RtzonesRV((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pyR~ås cCs¦t|ƒtttgkrng}xF|D]>}|rY|ddk rY|jd|ƒq(|j|ƒq(W|S|jƒ}|rž|ddk ržd|}n|SdS(s„ Ensure passed domain names end in a period (.) character. This will usually make a domain fully qualified. i’’’’ROs%s.N(RptlistttupletsetR tstrip(Rtvaluetnew_listtrecord((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pyR}ņs   cCsŃd}tjjd|jƒ|jdkrĶ|jdƒ}|rĶd|krVd}nd|krkd}n|Sd||f}ttjƒd|tjj dd d ƒƒ}|d 7}|||f}qĶn|S( NsSaw HTTP status: %sitCodetPriorRequestNotCompletet Throttlings%s, retry attempt %sitBototmax_retry_delayi<i( RR9R:RR;t getheadertmintrandomtconfigtget(RREtit next_sleepR;tcodeterrortmsg((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pyR&s$      N(t__name__t __module__t DefaultHostR7R_RRRRR%RBRNRWRcReRhRiRmRoRwRxRzR|RR~R}R&(((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pyR5s8     3  " B    (t boto.route53RRR]txml.saxRsR9tboto.connectionRRtboto.jsonresponsetboto.route53.recordRtboto.route53.zoneRt boto.compatRRR`R(((sD/opt/freeware/lib/python2.7/site-packages/boto/route53/connection.pyts