#NEWLINE# def list_zones( self ) : #NEWLINE# #INDENT# '\n        Return a list of zones.\n\n        :return: ``list`` of :class:`Zone`\n        ' #NEWLINE# schema_params = SCHEMA_BUILDER_MAP . get ( 'list_zones' ) #NEWLINE# attributes = schema_params . get ( 'attributes' ) #NEWLINE# schema = api_schema_builder ( schema_params . get ( 'urn_nid' ) , schema_params . get ( 'method' ) , attributes ) #NEWLINE# params = { #NEWLINE# #INDENT# 'apiuser' : self . key , #NEWLINE# 'apikey' : self . secret , #NEWLINE# #UNINDENT# } #NEWLINE# urn = schema . getchildren ( ) [ 0 ] #NEWLINE# for child in urn : #NEWLINE# #INDENT# key = child . tag . split ( ':' ) [ 2 ] #NEWLINE# if ( key in attributes ) : #NEWLINE# #INDENT# child . text = str ( params . get ( key ) ) #NEWLINE# #UNINDENT# #UNINDENT# req_data = tostring ( schema ) #NEWLINE# action = '/services/dns/listZones.php' #NEWLINE# params = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# headers = { #NEWLINE# #INDENT# 'SOAPAction' : 'urn:listZoneswsdl#listZones' , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . connection . request ( action = action , params = params , data = req_data , method = 'POST' , headers = headers ) #NEWLINE# zones = [ ] #NEWLINE# for data in response . objects : #NEWLINE# #INDENT# zone = self . get_zone ( data . get ( 'id' ) ) #NEWLINE# zones . append ( zone ) #NEWLINE# #UNINDENT# return zones