#NEWLINE# def create_record( self , name , zone , type , data , extra = None ) : #NEWLINE# #INDENT# "\n        Create a new record.\n\n        :param name: Record name without the domain name (e.g. www).\n                     Note: If you want to create a record for a base domain\n                     name, you should specify empty string ('') for this\n                     argument.\n        :type  name: ``str``\n\n        :param zone: Zone where the requested record is created.\n        :type  zone: :class:`Zone`\n\n        :param type: DNS record type (A, AAAA, ...).\n        :type  type: :class:`RecordType`\n\n        :param data: Data for the record (depends on the record type).\n        :type  data: ``str``\n\n        :param extra: Extra attributes (driver specific). (optional)\n        :type extra: ``dict``\n\n        :rtype: :class:`Record`\n        " #NEWLINE# r_json = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'data' : data , #NEWLINE# 'record_type' : type , #NEWLINE# #UNINDENT# } #NEWLINE# if ( extra is not None ) : #NEWLINE# #INDENT# r_json . update ( extra ) #NEWLINE# #UNINDENT# r_data = json . dumps ( { #NEWLINE# #INDENT# 'zone_record' : r_json , #NEWLINE# #UNINDENT# } ) #NEWLINE# try : #NEWLINE# #INDENT# response = self . connection . request ( ( '/zones/%s/records' % zone . id ) , method = 'POST' , data = r_data ) #NEWLINE# #UNINDENT# except BaseHTTPError : #NEWLINE# #INDENT# e = sys . exc_info ( ) [ 1 ] #NEWLINE# raise PointDNSException ( value = e . message , http_code = e . code , driver = type ) #NEWLINE# #UNINDENT# record = self . _to_record ( response . object , zone = zone ) #NEWLINE# return record