List domains manageable by REST API.
979678
def domain_list(gandi):
    """"""
    domains = gandi.dns.list()
    for domain in domains:
        gandi.echo(domain['fqdn'])

    return domains
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()
984743
def whois_domains(self, domains):
        
        api_name = 'opendns-whois-domain'
        fmt_url_path = u'whois/{0}'
        return self._multi_get(api_name, fmt_url_path, domains)
967848
def list_domain_cache():
    '''
    
    '''
    cache = salt.cache.Cache(__opts__, syspaths.CACHE_DIR)
    return cache.list('venafi/domains')
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
108934
def list(gandi, resource):
    """"""
    keys = gandi.dnssec.list(resource)
    gandi.pretty_echo(keys)

    return keys
743964
def get_deliveryservers(self, domainid, page=None):
        """"""
        opts = {}
        if page:
            opts['page'] = page
        return self.api_call(
            ENDPOINTS['deliveryservers']['list'],
            dict(domainid=domainid), **opts)
5331
def list_pages(location_id, opts = {})
      data, _status_code, _headers = list_pages_with_http_info(location_id, opts)
      return data
    end
867167
def list_domains(container_id=None):
    '''
    
    '''
    if container_id:
        url = '{0}/domain?{1}'.format(_base_url(), container_id)
    else:
        url = '{0}/domain'.format(_base_url())

    orgs = _paginate(url,
                     "domains",
                     method='GET',
                     decode=True,
                     decode_type='json',
                     header_dict={
                         'X-DC-DEVKEY': _api_key(),
                         'Content-Type': 'application/json',
                     }
    )

    ret = {'domains': orgs}
    return ret
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)
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))
1344931
def get_domains(self):
        
        if self.domains is None:
            self.domains = list(
                set(self.source.get_domains() + self.target.get_domains()))
        return self.domains
760004
function(domains, callback) {
        var self = this;

        var listOfDomains = [];
        _.each(domains, function(domain) {
            ['name', 'emailAddress'].forEach(function(required) {
                if (!domain[required]) throw new Error('details.' +
                    required + ' is a required argument.');
            });

            var newDomain = {
                name: domain.name,
                emailAddress: domain.emailAddress
            };

            if (domain.ttl && typeof(domain.ttl) === 'number' && domain.ttl >= 300) {
                newDomain.ttl = domain.ttl;
            }

            if (domain.comment) {
                newDomain.comment = domain.comment;
            }

            listOfDomains.push(newDomain);
        });


        var requestOptions = {
            uri: '/domains',
            method: 'POST',
            data: {
                domains: listOfDomains
            },
            endpoint: rackspace.Endpoints.CloudDns
        };

        self.authorizedRequest(requestOptions, function(err, res, body) {
            if (err || res.statusCode !== 202) {
                callback(err ? err : body);
                return;
            }

            callback(err, new rackspace.Status(self, body));
        });
    }
1031144
function getDomainList(data) {
  var domains = [];

  _.each(data.emails, function(emailObject) {
    domains.push(emailObject.value.split('@')[1]);
  });

  return domains;
}
615288
def list_address(self, domain):
        " "

        try:
            response = self.get('/REST/ARecord/%s/%s' % (
                self.zone, domain))
        except self.NotFoundError:
            return []

        # Return a generator with the addresses.
        addresses = response.content['data']
        return [Address.from_url(self, uri) for uri in addresses]
596091
def list(gandi, domain, limit):
    """"""
    options = {'items_per_page': limit}
    mailboxes = gandi.mail.list(domain, options)
    output_list(gandi, [mbox['login'] for mbox in mailboxes])
    return mailboxes
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