Retrieves the most recent VT info for a set of domains.

        Args:
            domains: list of string domains.
        Returns:
            A dict with the domain as key and the VT report as value.
18420
def get_domain_reports(self, domains):
        
        api_name = 'virustotal-domain-reports'

        (all_responses, domains) = self._bulk_cache_lookup(api_name, domains)
        responses = self._request_reports("domain", domains, 'domain/report')

        for domain, response in zip(domains, responses):
            if self._cache:
                self._cache.cache_value(api_name, domain, response)
            all_responses[domain] = response

        return all_responses
1351979
def get_domains(self):
        
        # Domains are fixed and actually only one per REST api.
        if self._domains is None:
            self._domains = self._get_elements('domains', Domain)
        return self._domains
334097
def _parse_domain_id(self, config):
        
        match = re.search(r'domain-id (.+)$', config)
        value = match.group(1) if match else None
        return dict(domain_id=value)
1333582
def domains(request):
    
    url = ''
    query = '*:*&facet=true&facet.limit=-1&facet.pivot=domain_name,service_id&wt=json&indent=true&rows=0'
    if settings.SEARCH_TYPE == 'elasticsearch':
        url = '%s/select?q=%s' % (settings.SEARCH_URL, query)
    if settings.SEARCH_TYPE == 'solr':
        url = '%s/solr/hypermap/select?q=%s' % (settings.SEARCH_URL, query)
    LOGGER.debug(url)
    response = urllib2.urlopen(url)
    data = response.read().replace('\n', '')
    # stats
    layers_count = Layer.objects.all().count()
    services_count = Service.objects.all().count()
    template = loader.get_template('aggregator/index.html')
    context = RequestContext(request, {
        'data': data,
        'layers_count': layers_count,
        'services_count': services_count,
    })
    return HttpResponse(template.render(context))
192854
def list_subdomains(self, domain, limit=None, offset=None):
        
        return domain.list_subdomains(limit=limit, offset=offset)
1073190
def get_user_identity_ids_by_domain_id(self, domain_id):
        
        query_parameters = {}
        if domain_id is not None:
            query_parameters['domainId'] = self._serialize.query('domain_id', domain_id, 'str')
        response = self._send(http_method='GET',
                              location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7',
                              version='5.0',
                              query_parameters=query_parameters)
        return self._deserialize('[str]', self._unwrap_collection(response))
1040475
def domain_list(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_operator_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    return cloud.list_domains(**kwargs)
751857
def get_mx_records(domain):
        

        DNS.DiscoverNameServers()
        request = DNS.Request()
        response = request.req(name=domain, qtype=DNS.Type.MX)

        mx_records = []
        for answer in response.answers:
            mx_records.append(MXRecord(priority=answer['data'][0], exchange=answer['data'][1], domain=domain))

        return sorted(mx_records, key=lambda record: record.priority)
913858
def list_domains_by_service(self, service_id):
		""""""
		content = self._fetch("/service/%s/domain" % service_id, method="GET")
		return map(lambda x: FastlyDomain(self, x), content)
1066032
public static List<Domain> getRunningDomains(Connect libvirt) {
        try {
            List<Domain> domains = new ArrayList<>();
            int[] ids = libvirt.listDomains();
            for (int id : ids) {
                domains.add(libvirt.domainLookupByID(id));
            }
            return domains;
        } catch (LibvirtException e) {
            throw new LibvirtRuntimeException("Unable to list defined domains", e);
        }
    }
375892
def search_records(self, domain, record_type, name=None, data=None):
        
        search_params = []
        if name:
            search_params.append("name=%s" % name)
        if data:
            search_params.append("data=%s" % data)
        query_string = "&".join(search_params)
        dom_id = utils.get_id(domain)
        uri = "/domains/%s/records?type=%s" % (dom_id, record_type)
        if query_string:
            uri = "%s&%s" % (uri, query_string)
        resp, body = self._retry_get(uri)
        records = body.get("records", [])
        self._reset_paging("record", body)
        rec_paging = self._paging.get("record", {})
        while rec_paging.get("next_uri"):
            resp, body = self._retry_get(rec_paging.get("next_uri"))
            self._reset_paging("record", body)
            records.extend(body.get("records", []))
        for record in records:
            record["domain_id"] = dom_id
        return [CloudDNSRecord(self, record, loaded=False)
                for record in records if record]
1117363
def _get_domain_text_of_authoritative_zone(self):
        """"""
        # We are logged in, so get the domain list
        from bs4 import BeautifulSoup
        zones_response = self.session.get(self.URLS['domain_list'])
        self._log('Zone', zones_response)
        assert zones_response.status_code == 200, \
            'Could not retrieve domain list due to a network error.'

        html = BeautifulSoup(zones_response.content, 'html.parser')
        self._log('Zone', html)
        domain_table = html.find('table', {'id': 'cp_domain_table'})
        assert domain_table is not None, 'Could not find domain table'

        # (Sub)domains can either be managed in their own zones or by the
        # zones of their parent (sub)domains. Iterate over all subdomains
        # (starting with the deepest one) and see if there is an own zone
        # for it.
        domain = self.domain or ''
        domain_text = None
        subdomains = domain.split('.')
        while True:
            domain = '.'.join(subdomains)
            LOGGER.debug('Check if %s has own zone', domain)
            domain_text = domain_table.find(string=domain)
            if domain_text is not None or len(subdomains) < 3:
                break
            subdomains.pop(0)

        # Update domain to equal the zone's domain. This is important if we are
        # handling a subdomain that has no zone of itself. If we do not do
        # this, self._relative_name will strip also a part of the subdomain
        # away.
        self.domain = domain
        assert domain_text is not None, \
            'The domain does not exist on Easyname.'
        return domain_text
619099
def list_subdomains(self, domain, limit=None, offset=None):
        
        # The commented-out uri is the official API, but it is
        # horribly slow.
#        uri = "/domains/%s/subdomains" % utils.get_id(domain)
        uri = "/domains?name=%s" % domain.name
        page_qs = self._get_pagination_qs(limit, offset)
        if page_qs:
            uri = "%s&%s" % (uri, page_qs[1:])
        return self._list_subdomains(uri, domain.id)
281857
def fetch(self):
        
        return self.domain._record(self.doapi_manager.request(self.url)\
                                                             ["domain_record"])
1168608
def get_messages(self, domain):
        
        if domain not in self.domains:
            raise ValueError('Invalid domain: {0}'.format(domain))

        if domain not in self.messages or 'all' not in self.messages[domain]:
            self._process_domain(domain)

        return self.messages[domain]['all']
327762
def get_domains(custom_headers:nil)
      response = get_domains_async(custom_headers:custom_headers).value!
      response.body unless response.nil?
    end
799617
def records(self, domain, params=None):
        ''' 
        '''
        params = update_params(params, {'domain': domain})
        return self.request('/v1/dns/records', params, 'GET')