Sends Add_DNS_Record request
488584
def _request_add_dns_record(self, record):
        """"""
        return self._request_internal("Add_DNS_Record",
                                      domain=self.domain,
                                      record=record)
1301426
def create(gandi, fqdn, name, type, value, ttl):
    
    domains = gandi.dns.list()
    domains = [domain['fqdn'] for domain in domains]
    if fqdn not in domains:
        gandi.echo('Sorry domain %s does not exist' % fqdn)
        gandi.echo('Please use one of the following: %s' % ', '.join(domains))
        return

    result = gandi.dns.add_record(fqdn, name, type, value, ttl)
    gandi.echo(result['message'])
466486
def switch_add_record(self, userid, interface, port=None,
                          switch=None, comments=None):
        """"""
        with get_network_conn() as conn:
            conn.execute("INSERT INTO switch VALUES (?, ?, ?, ?, ?)",
                         (userid, interface, switch, port, comments))
            LOG.debug("New record in the switch table: user %s, "
                      "nic %s, port %s" %
                      (userid, interface, port))
729390
def _get_post_data_to_create_dns_entry(self, rtype, name, content, identifier=None):
        
        is_update = identifier is not None
        if is_update:
            records = self._list_records_internal(identifier=identifier)
            assert len(records) == 1, 'ID is not unique or does not exist'
            record = records[0]
            LOGGER.debug('Create post data to update record: %s', record)

        data = {
            'id': str(identifier) if is_update else '',
            'action': 'save',
            'name': name,
            'type': rtype,
            'content': content,
            'prio': str(record['priority']) if is_update else '10',
            'ttl': str(record['ttl']) if is_update else '360',
            'commit': ''
        }
        ttl = self._get_lexicon_option('ttl')
        if ttl and ttl > 360:
            data['ttl'] = str(ttl)

        prio = self._get_lexicon_option('priority')
        if prio and prio > 0:
            data['prio'] = str(prio)

        return data
1015193
def records(cls, fqdn, sort_by=None, text=False):
        """"""
        meta = cls.get_fqdn_info(fqdn)
        url = meta['domain_records_href']
        kwargs = {}
        if text:
            kwargs = {'headers': {'Accept': 'text/plain'}}
        return cls.json_get(cls.get_sort_url(url, sort_by), **kwargs)
1146137
def record_set_details(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/setDetails' % object_id, input_params, always_retry=always_retry, **kwargs)
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)
766267
def get_record(self, dns_record_type, host):
        """"""
        record_list = self._entries
        for record in record_list:
            if record._record_type == dns_record_type \
                    and record.host == host:
                return record
        return False
598710
def set_address(addr):
    """"""
    # Send DNLOAD with first byte=0x21 and page address
    buf = struct.pack("<BI", 0x21, addr)
    __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 0, __DFU_INTERFACE, buf, __TIMEOUT)

    # Execute last command
    if get_status() != __DFU_STATE_DFU_DOWNLOAD_BUSY:
        raise Exception("DFU: set address failed")

    # Check command state
    if get_status() != __DFU_STATE_DFU_DOWNLOAD_IDLE:
        raise Exception("DFU: set address failed")
709860
def recordAndPropagate(self, request: Request, clientName):
        
        self.requests.add(request)
        self.propagate(request, clientName)
        self.tryForwarding(request)
707673
def add(self, ipaddr=None, proto=None, port=None, fields=None):
        
        return self.send.service_add(ipaddr, proto, port, fields)
1261482
def create_record(self, dns_type, name, content, **kwargs):
        
        data = {
            'type': dns_type,
            'name': name,
            'content': content
        }
        if kwargs.get('ttl') and kwargs['ttl'] != 1:
            data['ttl'] = kwargs['ttl']
        if kwargs.get('proxied') is True:
            data['proxied'] = True
        else:
            data['proxied'] = False
        content = self.request(
            self.api_url + self.zone['id'] + '/dns_records',
            'post',
            data=data
        )
        print('DNS record successfully created')
        return content['result']
935874
def append(self, request, response):
        """"""
        request = self._before_record_request(request)
        if not request:
            return
        # Deepcopy is here because mutation of `response` will corrupt the
        # real response.
        response = copy.deepcopy(response)
        response = self._before_record_response(response)
        if response is None:
            return
        self.data.append((request, response))
        self.dirty = True
336316
def update_ptr_record(self, device, record, domain_name, data=None,
            ttl=None, comment=None):
        
        device_type = self._resolve_device_type(device)
        href, svc_name = self._get_ptr_details(device, device_type)
        try:
            rec_id = record.id
        except AttributeError:
            rec_id = record
        rec = {"name": domain_name,
              "id": rec_id,
              "type": "PTR",
              "data": data,
            }
        if ttl is not None:
            # Minimum TTL is 300 seconds
            rec["ttl"] = max(300, ttl)
        if comment is not None:
            # Maximum comment length is 160 chars
            rec["comment"] = comment[:160]
        body = {"recordsList": {
                    "records": [rec]},
                "link": {
                    "content": "",
                    "href": href,
                    "rel": svc_name,
                }}
        uri = "/rdns"
        try:
            resp, resp_body = self._async_call(uri, body=body, method="PUT",
                    has_response=False, error_class=exc.PTRRecordUpdateFailed)
        except exc.EndpointNotFound as e:
            raise exc.InvalidPTRRecord("The record domain/IP address "
                    "information is not valid for this device.")
        return resp_body.get("status") == "COMPLETED"
567451
function sendRecord (recordName, record, socketWrapper) {
  socketWrapper.sendMessage(RECORD, C.ACTIONS.READ, [recordName, record._v, record._d])
}
1338429
def _log_send(self, logrecord):
        """"""
        for field, value in self.__log_extensions:
            setattr(logrecord, field, value)
        self.__send_to_frontend({"band": "log", "payload": logrecord})
364122
def record_add_tags(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/addTags' % object_id, input_params, always_retry=always_retry, **kwargs)