CloudDNS doesn't expose the domain's ttl in the list api.
439797
private Zone zipWithSOA(Zone next) {
    Record soa = api.recordsByNameAndType(Integer.parseInt(next.id()), next.name(), "SOA").get(0);
    return Zone.create(next.id(), next.name(), soa.ttl, next.email());
  }
1054420
def vulns_list(self, service_id=None, service_port=None, hostfilter=None):
        
        return self.send.service_vulns_list(service_id, service_port, hostfilter)
348426
def route_filters_list_all(**kwargs):
    '''
    

    '''
    result = {}
    netconn = __utils__['azurearm.get_client']('network', **kwargs)
    try:
        filters = __utils__['azurearm.paged_object_to_list'](netconn.route_filters.list())

        for route_filter in filters:
            result[route_filter['name']] = route_filter
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('network', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
72003
def update(self, ttl=values.unset):
        
        return self._proxy.update(ttl=ttl, )
786757
def _list_records(self, rtype=None, name=None, content=None):
        """"""
        records = []
        paginator = RecordSetPaginator(self.r53_client, self.domain_id)
        for record in paginator.all_record_sets():
            if rtype is not None and record['Type'] != rtype:
                continue
            if name is not None and record['Name'] != self._fqdn_name(name):
                continue
            if record.get('AliasTarget', None) is not None:
                record_content = [record['AliasTarget'].get('DNSName', None)]
            if record.get('ResourceRecords', None) is not None:
                record_content = [self._format_content(record['Type'], value['Value']) for value
                                  in record['ResourceRecords']]
            if content is not None and content not in record_content:
                continue
            LOGGER.debug('record: %s', record)
            records.append({
                'type': record['Type'],
                'name': self._full_name(record['Name']),
                'ttl': record.get('TTL', None),
                'content': record_content[0] if len(record_content) == 1 else record_content,
            })
        LOGGER.debug('list_records: %s', records)
        return records
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));
        });
    }
1373147
def _set_fqdn(self):
        """"""
        results = self._search(
            'cn=config',
            '(objectClass=*)',
            ['nsslapd-localhost'],
            scope=ldap.SCOPE_BASE
        )
        if not results and type(results) is not list:
            r = None
        else:
            dn, attrs = results[0]
            r = attrs['nsslapd-localhost'][0].decode('utf-8')
        self._fqdn = r
        log.debug('FQDN: %s' % self._fqdn)
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)
464616
def list_nodes(call=None):
    '''
    

    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_nodes function must be called '
            'with -f or --function.'
        )

    providers = __opts__.get('providers', {})

    ret = {}
    providers_to_check = [_f for _f in [cfg.get('libvirt') for cfg in six.itervalues(providers)] if _f]
    for provider in providers_to_check:
        conn = __get_conn(provider['url'])
        domains = conn.listAllDomains()
        for domain in domains:
            data = {
                'id': domain.UUIDString(),
                'image': '',
                'size': '',
                'state': VIRT_STATE_NAME_MAP[domain.state()[0]],
                'private_ips': [],
                'public_ips': get_domain_ips(domain, libvirt.VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE)}
            # TODO: Annoyingly name is not guaranteed to be unique, but the id will not work in other places
            ret[domain.name()] = data

    return ret
848014
def get_primary_domain(self):
        
        try:
            domain = self.domains.get(is_primary=True)
            return domain
        except get_tenant_domain_model().DoesNotExist:
            return None
1328814
private static long getNetworkAddressCacheTtlNanos(boolean isAndroid) {
    if (isAndroid) {
      // on Android, ignore dns cache.
      return 0;
    }

    String cacheTtlPropertyValue = System.getProperty(NETWORKADDRESS_CACHE_TTL_PROPERTY);
    long cacheTtl = DEFAULT_NETWORK_CACHE_TTL_SECONDS;
    if (cacheTtlPropertyValue != null) {
      try {
        cacheTtl = Long.parseLong(cacheTtlPropertyValue);
      } catch (NumberFormatException e) {
        logger.log(
            Level.WARNING,
            "Property({0}) valid is not valid number format({1}), fall back to default({2})",
            new Object[] {NETWORKADDRESS_CACHE_TTL_PROPERTY, cacheTtlPropertyValue, cacheTtl});
      }
    }
    return cacheTtl > 0 ? TimeUnit.SECONDS.toNanos(cacheTtl) : cacheTtl;
  }
309002
def check_dns_txt(domain, prefix, code):
    
    token = '{}={}'.format(prefix, code)
    try:
        for rr in dns.resolver.query(domain, 'TXT'):
            if token in rr.to_text():
                return True
    except:
        logger.debug('', exc_info=True)
    return False
584056
def reverse_dns_sna(ipaddress):
    """"""

    r = requests.get("http://api.statdns.com/x/%s" % ipaddress)

    if r.status_code == 200:
        names = []

        for item in r.json()['answer']:
            name = str(item['rdata']).strip(".")
            names.append(name)

        return names
    elif r.json()['code'] == 503:
        # NXDOMAIN - no PTR record
        return None
985158
def setup_dns(endpoint):
    """"""
    print("Setting up DNS...")

    yass = Yass(CWD)
    target = endpoint.lower()

    sitename = yass.sitename
    if not sitename:
        raise ValueError("Missing site name")

    endpoint = yass.config.get("hosting.%s" % target)
    if not endpoint:
        raise ValueError(
            "%s endpoint is missing in the hosting config" % target.upper())

    if target == "s3":
        p = publisher.S3Website(sitename=sitename,
                                aws_access_key_id=endpoint.get("aws_access_key_id"),
                                aws_secret_access_key=endpoint.get("aws_secret_access_key"),
                                region=endpoint.get("aws_region"))

        print("Setting AWS Route53 for: %s ..." % p.sitename)
        p.setup_dns()
        print("")
        print("Yass! Route53 setup successfully!")
        print("You can now visit the site at :")
        print(p.sitename_endpoint)
    footer()
1088561
def public_ip_addresses_list_all(**kwargs):
    '''
    

    '''
    result = {}
    netconn = __utils__['azurearm.get_client']('network', **kwargs)
    try:
        pub_ips = __utils__['azurearm.paged_object_to_list'](netconn.public_ip_addresses.list_all())

        for ip in pub_ips:
            result[ip['name']] = ip
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('network', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
118133
def _get_nameservers(domain):
        
        nameservers = []
        rdtypes_ns = ['SOA', 'NS']
        rdtypes_ip = ['A', 'AAAA']
        for rdtype_ns in rdtypes_ns:
            for rdata_ns in Provider._dns_lookup(domain, rdtype_ns):
                for rdtype_ip in rdtypes_ip:
                    for rdata_ip in Provider._dns_lookup(rdata_ns.to_text().split(' ')[0],
                                                         rdtype_ip):
                        if rdata_ip.to_text() not in nameservers:
                            nameservers.append(rdata_ip.to_text())
        LOGGER.debug('DNS Lookup => %s IN NS %s', domain, ' '.join(nameservers))
        return nameservers
731341
def show_company(domain):
    '''
    
    '''
    data = __utils__['http.query'](
        '{0}/companies/domain/{1}'.format(_base_url(), domain),
        status=True,
        decode=True,
        decode_type='json',
        header_dict={
            'tppl-api-key': _api_key(),
        },
    )
    status = data['status']
    if six.text_type(status).startswith('4') or six.text_type(status).startswith('5'):
        raise CommandExecutionError(
            'There was an API error: {0}'.format(data['error'])
        )
    return data.get('dict', {})