Update all records for a domain.
492669
def update_record(cls, fqdn, name, type, value, ttl, content):
        """"""
        data = {
            "rrset_name": name,
            "rrset_type": type,
            "rrset_values": value,
        }
        if ttl:
            data['rrset_ttl'] = int(ttl)
        meta = cls.get_fqdn_info(fqdn)
        if content:
            url = meta['domain_records_href']
            kwargs = {'headers': {'Content-Type': 'text/plain'},
                      'data': content}
            return cls.json_put(url, **kwargs)

        url = '%s/domains/%s/records/%s/%s' % (cls.api_url, fqdn, name, type)
        return cls.json_put(url, data=json.dumps(data))
839758
def cli(env, zone_id, by_record, by_id, data, ttl):
    """"""
    manager = SoftLayer.DNSManager(env.client)
    zone_id = helpers.resolve_id(manager.resolve_ids, zone_id, name='zone')

    results = manager.get_records(zone_id, host=by_record)

    for result in results:
        if by_id and str(result['id']) != by_id:
            continue
        result['data'] = data or result['data']
        result['ttl'] = ttl or result['ttl']
        manager.edit_record(result)
1187184
def update_ptr_record(self, device, record, domain_name, data=None,
            ttl=None, comment=None):
        
        return self._manager.update_ptr_record(device, record, domain_name,
                data=data, ttl=ttl, comment=comment)
373971
private void updateDomain(Long domainId, String name, String authorityType, String ttl, boolean reverse) throws GloboDnsException {
		if (domainId == null) {
			throw new GloboDnsException("Domain id cannot be null");
		}
		
		Domain domain = new Domain();
		if (name != null)
			domain.getDomainAttributes().setName(name);
		if (authorityType != null)
			domain.getDomainAttributes().setAuthorityType(authorityType);
		if (ttl != null)
			domain.getDomainAttributes().setTTL(ttl);
		
		GloboDnsRoot<Domain> globoDnsRoot = this.put("/domains/" + domainId + ".json" + (reverse ? "?reverse=true" : ""), domain, false);
		if (globoDnsRoot == null) {
			throw new GloboDnsException("Invalid response");
		}
		return;
	}
188437
def _update_record(self, identifier, rtype=None, name=None, content=None):
        
        if self.protocol == 'rpc':
            return self.rpc_helper.update_record(identifier, rtype, name, content)

        data = {}
        if rtype:
            data['rrset_type'] = rtype
        if name:
            data['rrset_name'] = self._relative_name(name)
        if content:
            if isinstance(content, (list, tuple, set)):
                data['rrset_values'] = list(content)
            else:
                data['rrset_values'] = [content]
        if rtype is not None:
            # replace the records of a specific rtype
            url = '/domains/{0}/records/{1}/{2}'.format(self.domain_id,
                                                        identifier or self._relative_name(
                                                            name),
                                                        rtype)
            self._put(url, data)
        else:
            # replace all records with a matching name
            url = '/domains/{0}/records/{1}'.format(self.domain_id,
                                                    identifier or self._relative_name(name))
            self._put(url, {'items': [data]})
        LOGGER.debug('update_record: %s', True)
        return True
248055
def update_domain_queues(self):
        '''
        
        '''
        for key in self.domain_config:
            final_key = "{name}:{domain}:queue".format(
                    name=self.spider.name,
                    domain=key)
            # we already have a throttled queue for this domain, update it to new settings
            if final_key in self.queue_dict:
                self.queue_dict[final_key][0].window = float(self.domain_config[key]['window'])
                self.logger.debug("Updated queue {q} with new config"
                                  .format(q=final_key))
                # if scale is applied, scale back; otherwise use updated hits
                if 'scale' in self.domain_config[key]:
                    # round to int
                    hits = int(self.domain_config[key]['hits'] * self.fit_scale(
                               self.domain_config[key]['scale']))
                    self.queue_dict[final_key][0].limit = float(hits)
                else:
                    self.queue_dict[final_key][0].limit = float(self.domain_config[key]['hits'])
611280
def update(self,record,**kw):
        """"""
        vals = self._make_sql_params(kw)
        sql = "UPDATE %s SET %s WHERE rowid=?" %(self.name,
            ",".join(vals))
        self.cursor.execute(sql,kw.values()+[record['__id__']])
246540
def update_record(self, zeroconf, now, record):
        """"""
        if record.type == _TYPE_PTR and record.name == self.type:
            expired = record.is_expired(now)
            try:
                oldrecord = self.services[record.alias.lower()]
                if not expired:
                    oldrecord.reset_ttl(record)
                else:
                    del(self.services[record.alias.lower()])
                    callback = lambda x: self.listener.remove_service(x,
                            self.type, record.alias)
                    self.list.append(callback)
                    return
            except:
                if not expired:
                    self.services[record.alias.lower()] = record
                    callback = lambda x: self.listener.add_service(x,
                            self.type, record.alias)
                    self.list.append(callback)

            expires = record.get_expiration_time(75)
            if expires < self.next_time:
                self.next_time = expires
273834
def update_record(self, common_name, **fields):
        """"""

        record = self.get_record(common_name)
        if fields is not None:
            for field, value in fields:
                record[field] = value
        self.save()
        return record
1349622
def update(self, id):
        """"""
        # url('DataStores', id=ID)
        content = request.environ['wsgi.input'].read(int(request.environ['CONTENT_LENGTH']))
        content = content.decode('utf8')
        content = simplejson.loads(content)        
        result = meta.Session.query(DataStore).get(id)
        result.name = content['name']
        result.type = content['type']
        result.ogrstring = content['ogrstring']
        meta.Session.commit()
        response.status = 201
1299707
@Trace(dispatcher = true)
	public void updateRecord(Long recordId, Long domainId, String name, String content) throws GloboDnsException {
		NewRelic.setTransactionName(null, "/globodns/updateRecord");
		if (recordId == null) {
			throw new GloboDnsException("Record id cannot be null");
		}
		
		Record record = new Record();
		if (domainId != null)
			record.getGenericRecordAttributes().setDomainId(domainId);
		if (name != null)
			record.getGenericRecordAttributes().setName(name);
		if (content != null)
			record.getGenericRecordAttributes().setContent(content);
		
		GloboDnsRoot<Record> globoDnsRoot = this.put("/records/" + recordId + ".json", record, false);
		if (globoDnsRoot == null) {
			throw new GloboDnsException("Invalid response");
		}
		return;
	}
949603
def create_or_update_record(self, dns_type, name, content, **kwargs):
        
        try:
            return self.update_record(dns_type, name, content, **kwargs)
        except RecordNotFound:
            return self.create_record(dns_type, name, content, **kwargs)
153519
protected function updateRecord()
    {
        $sql = 'UPDATE '.$this->fq_name;
        $sets = '';
        $where = '1=1';
        $set_args = array();
        $where_args = array();
        $table_def = $this->getDefinition();
        foreach($this->instance as $column => $value) {
            if (in_array($column, $this->unique)) {
                $where .= ' AND '.$this->connection->identifierEscape($column).' = ?';
                $where_args[] = $value;
            } else {
                if (isset($this->columns[$column]['increment']) && $this->columns[$column]['increment']) {
                    continue;
                } else if (!isset($table_def[$column])) {
                    // underlying table is missing this column
                    continue;
                }
                $sets .= ' '.$this->connection->identifierEscape($column).' = ?,';
                $set_args[] = $value;
            }
        }
        $sets = substr($sets,0,strlen($sets)-1);

        $sql .= ' SET '.$sets.' WHERE '.$where;
        $all_args = $set_args;
        foreach ($where_args as $a) {
            $all_args[] = $a;
        }
        $prep = $this->connection->prepare($sql);
        $result = $this->connection->execute($prep, $all_args);

        if ($result) {
            $this->record_changed = false;
        }

        return $result ? true : false;
    }
292039
def update(gandi, address, dest_add, dest_del):
    """"""
    source, domain = address

    if not dest_add and not dest_del:
        gandi.echo('Nothing to update: you must provide destinations to '
                   'update, use --dest-add/-a or -dest-del/-d parameters.')
        return

    result = gandi.forward.update(domain, source, dest_add, dest_del)

    return result
1241137
def _update_record(self, record_id, name, address, ttl):
        """"""
        data = json.dumps({'record': {'name': name,
                                      'content': address,
                                      'ttl': ttl}})
        headers = {'Content-Type': 'application/json'}
        request = self._session.put(self._baseurl + '/%d' % record_id,
                                    data=data, headers=headers)
        if not request.ok:
            raise RuntimeError('Failed to update record: %s - %s' %
                               (self._format_hostname(name), request.json()))
        record = request.json()
        if 'record' not in record or 'id' not in record['record']:
            raise RuntimeError('Invalid record JSON format: %s - %s' %
                               (self._format_hostname(name), request.json()))
        return record['record']
447027
def query_dns(cls, domains, records):
        
        results = {k: set() for k in records}
        for record in records:
            for domain in domains:
                try:
                    answers = cls.resolver.query(domain, record)
                    for answer in answers:
                        # Add value to record type
                        results.get(record).add(answer)
                except (resolver.NoAnswer, resolver.NXDOMAIN, resolver.NoNameservers):
                    # Type of record doesn't fit domain or no answer from ns
                    continue

        return {k: v for k, v in results.items() if v}
554997
def domain_records(self, domain_id):
        
        json = self.request('/domains/%s/records' % domain_id, method='GET')
        status = json.get('status')
        if status == 'OK':
            records_json = json.get('records', [])
            records = [Record.from_json(record) for record in records_json]
            return records
        else:
            message = json.get('message')
            raise DOPException('[%s]: %s' % (status, message))