'Update an existing record.
:param record: Record to update.
:type  record: :class:`Record`
:param name: Record name without the domain name (e.g. www).
Note: If you want to create a record for a base domain
name, you should specify empty string (\'\') for this
argument.
: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):

    new_record = self._format_record(name, type, data, extra)
    self.connection.request(('/v1/domains/%s/records/%s/%s' % (record.zone.domain, record.type, record.name)), method='PUT', data=json.dumps([new_record]))
    id = self._get_id_of_record(name, type)
    return Record(id=id, name=name, type=type, data=data, zone=record.zone, driver=self, ttl=new_record['ttl'], extra=extra)
