Retrieve records.

    Arguments:

        prs:  parser object of argparse
        conn: dictionary of connection information
778498
def parse_get(prs, conn):
    
    prs_get = prs.add_parser(
        'get', help='retrieve all zones or records with a specific zone')
    prs_get.add_argument('--domain', action='store',
                         help='specify domain FQDN')
    conn_options(prs_get, conn)
    set_option(prs_get, 'search')
    prs_get.set_defaults(func=get)
1190706
def parse(cls, conn):
        

        req = cls(conn)
        req_line = yield from conn.reader.readline()
        logger('HttpRequest').debug('req_line = %r', req_line)
        req._parse_req_line(req_line)

        header_line = yield from conn.reader.readline()
        while len(header_line) > 0 and header_line != b'\r\n':
            try:
                req._parse_header(header_line)
            except BadHttpHeaderError as e:
                # Tolerating 'minor' mistakes
                logger('HttpRequest').debug(traceback.format_exc())
            header_line = yield from conn.reader.readline()
        return req
873908
def get_log_records_access(f):
    """"""

    @functools.wraps(f)
    def wrapper(request, *args, **kwargs):
        if not django.conf.settings.PUBLIC_LOG_RECORDS:
            trusted(request)
        return f(request, *args, **kwargs)

    return wrapper
353287
def get_req_resp_record(self, resp_obj):
        
        def log_print(req_resp_dict, r_type):
            msg = "\n================== {} details ==================\n".format(r_type)
            for key, value in req_resp_dict[r_type].items():
                msg += "{:<16} : {}\n".format(key, repr(value))
            logger.log_debug(msg)

        req_resp_dict = {
            "request": {},
            "response": {}
        }

        # record actual request info
        req_resp_dict["request"]["url"] = resp_obj.request.url
        req_resp_dict["request"]["method"] = resp_obj.request.method
        req_resp_dict["request"]["headers"] = dict(resp_obj.request.headers)

        request_body = resp_obj.request.body
        if request_body:
            request_content_type = lower_dict_keys(
                req_resp_dict["request"]["headers"]
            ).get("content-type")
            if request_content_type and "multipart/form-data" in request_content_type:
                # upload file type
                req_resp_dict["request"]["body"] = "upload file stream (OMITTED)"
            else:
                req_resp_dict["request"]["body"] = request_body

        # log request details in debug mode
        log_print(req_resp_dict, "request")

        # record response info
        req_resp_dict["response"]["ok"] = resp_obj.ok
        req_resp_dict["response"]["url"] = resp_obj.url
        req_resp_dict["response"]["status_code"] = resp_obj.status_code
        req_resp_dict["response"]["reason"] = resp_obj.reason
        req_resp_dict["response"]["cookies"] = resp_obj.cookies or {}
        req_resp_dict["response"]["encoding"] = resp_obj.encoding
        resp_headers = dict(resp_obj.headers)
        req_resp_dict["response"]["headers"] = resp_headers

        lower_resp_headers = lower_dict_keys(resp_headers)
        content_type = lower_resp_headers.get("content-type", "")
        req_resp_dict["response"]["content_type"] = content_type

        if "image" in content_type:
            # response is image type, record bytes content only
            req_resp_dict["response"]["content"] = resp_obj.content
        else:
            try:
                # try to record json data
                req_resp_dict["response"]["json"] = resp_obj.json()
            except ValueError:
                # only record at most 512 text charactors
                resp_text = resp_obj.text
                req_resp_dict["response"]["text"] = omit_long_data(resp_text)

        # log response details in debug mode
        log_print(req_resp_dict, "response")

        return req_resp_dict
1126345
def _list_records(self, rtype=None, name=None, content=None):
        
        opts = {'domain': self._domain}
        if rtype is not None:
            opts['type'] = rtype.upper()
        if name is not None:
            opts['name'] = self._full_name(name)
        if content is not None:
            opts['content'] = content
        opts.update(self._auth)

        response = self._api.nameserver.info(opts)
        self._validate_response(
            response=response, message='Failed to get records')

        records = []
        if 'record' in response['resData']:
            for record in response['resData']['record']:
                processed_record = {
                    'type': record['type'],
                    'name': record['name'],
                    'ttl': record['ttl'],
                    'content': record['content'],
                    'id': record['id']
                }
                records.append(processed_record)

        return records
929604
def getConnectionStats(self):
        
        cur = self._conn.cursor()
        cur.execute("""SELECT datname,numbackends FROM pg_stat_database;""")
        rows = cur.fetchall()
        if rows:
            return dict(rows)
        else:
            return {}
22300
def get_record(self, domain, record):
        
        rec_id = utils.get_id(record)
        domain_id = utils.get_id(domain)
        uri = "/domains/%s/records/%s" % (domain_id, rec_id)
        resp, resp_body = self._retry_get(uri)
        resp_body["domain_id"] = domain_id
        return CloudDNSRecord(self, resp_body, loaded=False)
62274
def _parse_results(self, results, cached_records):
        
        parser = xml.sax.make_parser()
        handler = RecordsHandler(cached_records)
        parser.setContentHandler(handler)
        parser.parse(results)
        return handler.records
110138
def get(self,table, sys_id):
        
        record = self.api.get(table, sys_id)
        return record
290167
def _get_record(self):
        
        if not self.pk:
            raise AJAXError(400, _('Invalid request for record.'))

        try:
            return self.model.objects.get(pk=self.pk)
        except self.model.DoesNotExist:
            raise AJAXError(404, _('%s with id of "%s" not found.') % (
                self.model.__name__, self.pk))
260554
def get_connections(self, id, connection_name, **args):
        """"""
        return self.request(
            "{0}/{1}/{2}".format(self.version, id, connection_name), args
        )
89426
def records(self, data=None):
        
        if data:
            return self._session.post(
                self.__v1() + "/records", data=data).json()
        else:
            return self._session.get(self.__v1() + "/records").json()
935465
def _get_record(self, name):
        """"""
        request = self._session.get(self._baseurl, params={'name': name,
                                                           'type': 'A'})
        if not request.ok:
            raise RuntimeError('Failed to search record: %s - %s' %
                               (self._format_hostname(name), request.json()))
        records = request.json()
        if len(records) == 0:
            return
        record = records[0]
        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 int(record['record']['id'])
1175147
def records(self):
		''''''
		if self._records == None:
			self._records = self._get_records()
		return self._records
232828
def getRecords(rids, dbid = @dbid, fieldNames = nil)
      records = []
      if rids.length > 0
        query = ""
        rids.each{|rid| query << "{'3'.EX.'#{rid}'}OR"}
        query[-2] = "" 
        fieldNames ||= getFieldNames(dbid)
        iterateRecords(dbid,fieldNames,query){|r| records << r }
      end
      if block_given?
        records.each{|rec|yield rec}
      else
        records  
      end        
   end
356894
def parse_update_soa(prs, conn):
    
    prs_soa = prs.add_parser('soa', help='update SOA record')
    prs_soa.add_argument('--domain', action='store', required=True,
                         help='specify domain FQDN')
    prs_soa.add_argument('--mname', action='store',
                         help='specify MNAME of SOA record')
    prs_soa.add_argument('--rname', action='store',
                         help='specify RNAME of SOA record')
    prs_soa.add_argument('--refresh', action='store', type=int,
                         help='specify REFRESH of SOA record')
    prs_soa.add_argument('--retry', action='store', type=int,
                         help='specify RETRY of SOA record')
    prs_soa.add_argument('--expire', action='store', type=int,
                         help='specify EXPIRE of SOA record')
    prs_soa.add_argument('--minimum', action='store', type=int,
                         help='specify MINIMUM of SOA record')
    conn_options(prs_soa, conn)
    prs_soa.set_defaults(func=update_soa_serial)
1335478
public static dnsrecords_stats get(nitro_service service, String dnsrecordtype) throws Exception{
		dnsrecords_stats obj = new dnsrecords_stats();
		obj.set_dnsrecordtype(dnsrecordtype);
		dnsrecords_stats response = (dnsrecords_stats) obj.stat_resource(service);
		return response;
	}