#NEWLINE# def create_zone( self , domain , type = 'master' , ttl = None , extra = None ) : #NEWLINE# #INDENT# zone = ET . Element ( 'CreateHostedZoneRequest' , { #NEWLINE# #INDENT# 'xmlns' : NAMESPACE , #NEWLINE# #UNINDENT# } ) #NEWLINE# ET . SubElement ( zone , 'Name' ) . text = domain #NEWLINE# ET . SubElement ( zone , 'CallerReference' ) . text = str ( uuid . uuid4 ( ) ) #NEWLINE# if ( extra and ( 'Comment' in extra ) ) : #NEWLINE# #INDENT# hzg = ET . SubElement ( zone , 'HostedZoneConfig' ) #NEWLINE# ET . SubElement ( hzg , 'Comment' ) . text = extra [ 'Comment' ] #NEWLINE# #UNINDENT# uri = ( API_ROOT + 'hostedzone' ) #NEWLINE# data = ET . tostring ( zone ) #NEWLINE# rsp = self . connection . request ( uri , method = 'POST' , data = data ) . object #NEWLINE# elem = findall ( element = rsp , xpath = 'HostedZone' , namespace = NAMESPACE ) [ 0 ] #NEWLINE# return self . _to_zone ( elem = elem )