#NEWLINE# def ex_create_multi_value_record( self , name , zone , type , data , extra = None ) : #NEWLINE# #INDENT# '\n        Create a record with multiple values with a single call.\n\n        :return: A list of created records.\n        :rtype: ``list`` of :class:`libcloud.dns.base.Record`\n        ' #NEWLINE# extra = ( extra or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# attrs = { #NEWLINE# #INDENT# 'xmlns' : NAMESPACE , #NEWLINE# #UNINDENT# } #NEWLINE# changeset = ET . Element ( 'ChangeResourceRecordSetsRequest' , attrs ) #NEWLINE# batch = ET . SubElement ( changeset , 'ChangeBatch' ) #NEWLINE# changes = ET . SubElement ( batch , 'Changes' ) #NEWLINE# change = ET . SubElement ( changes , 'Change' ) #NEWLINE# ET . SubElement ( change , 'Action' ) . text = 'CREATE' #NEWLINE# rrs = ET . SubElement ( change , 'ResourceRecordSet' ) #NEWLINE# ET . SubElement ( rrs , 'Name' ) . text = ( ( name + '.' ) + zone . domain ) #NEWLINE# ET . SubElement ( rrs , 'Type' ) . text = self . RECORD_TYPE_MAP [ type ] #NEWLINE# ET . SubElement ( rrs , 'TTL' ) . text = str ( extra . get ( 'ttl' , '0' ) ) #NEWLINE# rrecs = ET . SubElement ( rrs , 'ResourceRecords' ) #NEWLINE# values = [ value . strip ( ) for value in data . split ( '\n' ) if value . strip ( ) ] #NEWLINE# for value in values : #NEWLINE# #INDENT# rrec = ET . SubElement ( rrecs , 'ResourceRecord' ) #NEWLINE# ET . SubElement ( rrec , 'Value' ) . text = value #NEWLINE# #UNINDENT# uri = ( ( ( API_ROOT + 'hostedzone/' ) + zone . id ) + '/rrset' ) #NEWLINE# data = ET . tostring ( changeset ) #NEWLINE# self . connection . set_context ( { #NEWLINE# #INDENT# 'zone_id' : zone . id , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . connection . request ( uri , method = 'POST' , data = data ) #NEWLINE# id = ':' . join ( ( self . RECORD_TYPE_MAP [ type ] , name ) ) #NEWLINE# records = [ ] #NEWLINE# for value in values : #NEWLINE# #INDENT# record = Record ( id = id , name = name , type = type , data = value , zone = zone , driver = self , ttl = extra . get ( 'ttl' , None ) , extra = extra ) #NEWLINE# records . append ( record ) #NEWLINE# #UNINDENT# return records