#NEWLINE# def delete_zone( self , zone ) : #NEWLINE# #INDENT# '\n        Delete a zone.\n\n        Note: This will delete all the records belonging to this zone.\n\n        :param zone: Zone to delete.\n        :type  zone: :class:`Zone`\n\n        :rtype: ``bool``\n        ' #NEWLINE# schema_params = SCHEMA_BUILDER_MAP . get ( 'delete_zone' ) #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# 'zonename' : zone . id , #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 ( child ) ) #NEWLINE# #UNINDENT# #UNINDENT# req_data = tostring ( schema ) #NEWLINE# action = '/services/dns/deleteZone.php?' #NEWLINE# headers = { #NEWLINE# #INDENT# 'SOAPAction' : 'urn:deleteZonewsdl#deleteZone' , #NEWLINE# #UNINDENT# } #NEWLINE# try : #NEWLINE# #INDENT# response = self . connection . request ( action = action , data = req_data , method = 'POST' , headers = headers ) #NEWLINE# #UNINDENT# except DurableDNSException : #NEWLINE# #INDENT# e = sys . exc_info ( ) [ 1 ] #NEWLINE# if ( 'Zone does not exist' in e . message ) : #NEWLINE# #INDENT# raise ZoneDoesNotExistError ( zone_id = zone . id , driver = self , value = e . message ) #NEWLINE# #UNINDENT# raise e #NEWLINE# #UNINDENT# return ( response . status in [ httplib . OK ] )