Get a list of domains
    
    Each domain is an attribute dict with name, site_id and settings
555332
def domain_sites():
    

    if not hasattr(env,'domains'):
        sites = _get_django_sites()
        site_ids = sites.keys()
        site_ids.sort()
        domains = []
        
        for id in site_ids:

            for file in _sitesettings_files():
                domain = _AttributeDict({})

                if file == 'settings.py':
                    domain.name = sites[id]
                else: #prefix indicates subdomain
                    subdomain = file[:-12].replace('_','.')
                    domain.name = ''.join([subdomain,sites[id]])

                domain.settings = file
                domain.site_id = id
                domains.append(domain)
                
        env.domains = domains
        if env.domains: env.root_domain = env.domains[0].name
        else:
            domain.name = _root_domain(); domain.site_id = 1; domain.settings='settings.py'
            env.domains = [domain]
            
    return env.domains
606821
def site_properties(self):
        
        props = {}
        prop_keys = set()
        for site in self:
            prop_keys.update(site.properties.keys())

        for k in prop_keys:
            props[k] = [site.properties.get(k, None) for site in self]
        return props
179726
def available_domains(self):
        
        if not hasattr(self, '_available_domains'):
            url = 'http://{0}/request/domains/format/json/'.format(
                self.api_domain)
            req = requests.get(url)
            domains = req.json()
            setattr(self, '_available_domains', domains)
        return self._available_domains
742428
def get_domainaliases(self, domainid, page=None):
        """"""
        opts = {}
        if page:
            opts['page'] = page
        return self.api_call(
            ENDPOINTS['domainaliases']['list'],
            dict(domainid=domainid), **opts)
974142
def list_domains(self, service_id, version_number):
		""""""
		content = self._fetch("/service/%s/version/%d/domain" % (service_id, version_number))
		return map(lambda x: FastlyDomain(self, x), content)
398710
function getRecordSetsAndDomains(result, callback) {
      HostedZoneId = result.HostedZones.find(i=>i.Name === `${domain}.`).Id
      parallel({
        apis(callback) {
          gateway.getDomainNames({
            limit: 500,
          }, callback)
        },
        records(callback) {
          route53.listResourceRecordSets({
            HostedZoneId,
          }, callback)
        }
      }, callback)
    }
56607
def list(domain=nil)
      if domain
        @mailgun.response = Mailgun::Base.fire(:get, @mailgun.api_url + "/domains/#{domain}")
      else
        @mailgun.response = Mailgun::Base.fire(:get, @mailgun.api_url + "/domains")["items"] || []
      end
    end
1089894
def query_domain(self, domain, typenames, domainquerytype='list', count=False):
        

        objects = self._get_repo_filter(Layer.objects)

        if domainquerytype == 'range':
            return [tuple(objects.aggregate(Min(domain), Max(domain)).values())]
        else:
            if count:
                return [(d[domain], d['%s__count' % domain])
                        for d in objects.values(domain).annotate(Count(domain))]
            else:
                return objects.values_list(domain).distinct()
1179957
def get_all_subdomains(offset=None, count=None, min_sequence=None, db_path=None, zonefiles_dir=None):
    
    opts = get_blockstack_opts()
    if not is_subdomains_enabled(opts):
        return []

    if db_path is None:
        db_path = opts['subdomaindb_path']

    if zonefiles_dir is None:
        zonefiles_dir = opts['zonefiles']

    db = SubdomainDB(db_path, zonefiles_dir)
    return db.get_all_subdomains(offset=offset, count=count, min_sequence=None)
949532
def show_domain(self, domain_id):
        
        json = self.request('/domains/%s' % domain_id, method='GET')
        status = json.get('status')
        if status == 'OK':
            domain_json = json.get('domain')
            domain = Domain.from_json(domain_json)
            return domain
        else:
            message = json.get('message')
            raise DOPException('[%s]: %s' % (status, message))
1367556
async def query(
            cls, *,
            hostnames: typing.Iterable[str] = None,
            domains: typing.Iterable[str] = None,
            zones: typing.Iterable[str] = None,
            macs: typing.Iterable[str] = None,
            system_ids: typing.Iterable[str] = None,
            agent_name: str = None,
            level: typing.Union[Level, int, str] = None,
            before: int = None,
            after: int = None,
            limit: int = None,
            owner: typing.Union[User, str] = None):
        """"""

        if before is not None and after is not None:
            raise ValueError("Specify either `before` or `after`, not both.")

        params = {}

        if hostnames is not None:
            params["hostname"] = list(hostnames)
        if domains is not None:
            params["domain"] = list(domains)
        if zones is not None:
            params["zone"] = list(zones)
        if macs is not None:
            params["mac_address"] = list(macs)
        if system_ids is not None:
            params["id"] = list(system_ids)
        if agent_name is not None:
            params["agent_name"] = [agent_name]
        if level is not None:
            level = Level.normalise(level)
            params["level"] = [level.name]
        if before is not None:
            params["before"] = ["{:d}".format(before)]
        if after is not None:
            params["after"] = ["{:d}".format(after)]
        if limit is not None:
            params["limit"] = ["{:d}".format(limit)]
        if owner is not None:
            if isinstance(owner, User):
                params["owner"] = [owner.username]
            elif isinstance(owner, str):
                params["owner"] = [owner]
            else:
                raise TypeError(
                    "owner must be either User or str, not %s" % (
                        type(owner).__name__))

        data = await cls._handler.query(**params)
        return cls(data)
793329
def domain_tag(self, domains):
        
        api_name = 'opendns-domain_tag'
        fmt_url_path = u'domains/{0}/latest_tags'
        return self._multi_get(api_name, fmt_url_path, domains)
1049944
def list_tags(DomainName=None, ARN=None,
           region=None, key=None, keyid=None, profile=None):
    '''
    

    '''

    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        if ARN is None:
            if DomainName is None:
                raise SaltInvocationError('One (but not both) of ARN or '
                         'domain must be specified.')
            domaindata = status(DomainName=DomainName,
                            region=region, key=key, keyid=keyid,
                            profile=profile)
            if not domaindata or 'domain' not in domaindata:
                log.warning('Domain tags not updated')
                return {'tagged': False}
            ARN = domaindata.get('domain', {}).get('ARN')
        elif DomainName is not None:
            raise SaltInvocationError('One (but not both) of ARN or '
                         'domain must be specified.')
        ret = conn.list_tags(ARN=ARN)
        log.warning(ret)
        tlist = ret.get('TagList', [])
        tagdict = {}
        for tag in tlist:
            tagdict[tag.get('Key')] = tag.get('Value')
        return {'tags': tagdict}
    except ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}
639835
def domain_get(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_operator_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    return cloud.get_domain(**kwargs)
1060168
def on_site(self, site_id=None):
        
        if settings.PAGES_USE_SITE_ID:
            if not site_id:
                site_id = settings.SITE_ID
            return self.get_queryset().filter(sites=site_id)
        return self.all()
192854
def list_subdomains(self, domain, limit=None, offset=None):
        
        return domain.list_subdomains(limit=limit, offset=offset)
1174048
def on_site(self, site_id=None):
        
        if settings.PAGE_USE_SITE_ID:
            if not site_id:
                site_id = settings.SITE_ID
            return self.filter(sites=site_id)
        return self.all()