'Update an existing record.
:param record: Record to update.
:type  record: :class:`Record`
:param name: FQDN of the new record, for example "www.example.com".
:type  name: ``str``
:param type: DNS record type (A, AAAA, ...).
:type  type: :class:`RecordType`
:param data: Data for the record (depends on the record type).
:type  data: ``str``
:param extra: (optional) Extra attributes (driver specific).
:type  extra: ``dict``
:rtype: :class:`Record`'

def update_record(self, record, name, type, data, extra=None):

    action = ('%s/servers/%s/zones/%s' % (self.api_root, self.ex_server, record.zone.id))
    if ((extra is None) or (extra.get('ttl', None) is None)):
        raise ValueError('PowerDNS    requires    a    ttl    value    for    every    record')
    updated_record = {'content': data, 'disabled': False, 'name': name, 'ttl': extra['ttl'], 'type': type}
    payload = {'rrsets': [{'name': record.name, 'type': record.type, 'changetype': 'DELETE'}, {'name': name, 'type': type, 'changetype': 'REPLACE', 'records': [updated_record]}]}
    try:
        self.connection.request(action=action, data=json.dumps(payload), method='PATCH')
    except BaseHTTPError:
        e = sys.exc_info()[1]
        if ((e.code == httplib.UNPROCESSABLE_ENTITY) and e.message.startswith('Could    not    find    domain')):
            raise ZoneDoesNotExistError(zone_id=record.zone.id, driver=self, value=e.message)
        raise e
    return Record(id=None, name=name, data=data, type=type, zone=record.zone, driver=self, ttl=extra['ttl'])
