def update_record(self, record, name, type, data, extra=None):
        zone = record.zone
        if extra is None:
            extra = record.extra
        else:
            extra_fields = ['aux', 'ttl']
            missing = set(extra_fields).difference(set(extra.keys()))
            for field in missing:
                extra[field] = record.extra.get(field)
        extra['ddns_enabled'] = 'N'
        schema_params = SCHEMA_BUILDER_MAP.get('update_record')
        attributes = schema_params.get('attributes')
        schema = api_schema_builder(schema_params.get('urn_nid'),
                                    schema_params.get('method'),
                                    attributes)
        params = {'apiuser': self.key, 'apikey': self.secret,
                  'zonename': zone.id, 'id': record.id, 'name': name,
                  'data': data}
        params.update(extra)
        urn = schema.getchildren()[0]
        for child in urn:
            key = child.tag.split(':')[2]
            if key in attributes:
                if isinstance(params.get(key), int):
                    child.text = "%d"
                else:
                    child.text = "%s"
        # We can't insert values directly in child.text because API raises
        # and exception for values that need to be integers. And tostring
        # method from ElementTree can't handle int values.
        skel = ensure_string(tostring(schema))  # Deal with PY3
        req_data = skel % (self.key, self.secret, zone.id, record.id, name,
                           extra.get('aux'), data, extra.get('ttl'),
                           extra.get('ddns_enabled'))
        action = '/services/dns/updateRecord.php?'
        headers = {"SOAPAction": "urn:updateRecordwsdl#updateRecord"}
        try:
            self.connection.request(action=action,
                                    data=req_data,
                                    method="POST",
                                    headers=headers)
        except DurableDNSException:
            e = sys.exc_info()[1]
            if 'Zone does not exist' in e.message:
                raise ZoneDoesNotExistError(zone_id=zone.id, driver=self,
                                            value=e.message)
            raise e

        record_item = {}
        record_item['id'] = record.id
        record_item['name'] = name
        record_item['type'] = type
        record_item['data'] = data
        record_item['ttl'] = extra.get('ttl')
        record_item['aux'] = extra.get('aux')
        record = self._to_record(record_item, zone)
        return record
Update an existing record.
dataset/ETHPy150Open apache/libcloud/libcloud/dns/drivers/durabledns.py/DurableDNSDriver.update_record