Get the Hosted Zone ID for a given domain.
350941
def get_hosted_zone_id_for_domain(self, domain):
        
        all_zones = self.get_all_zones()
        return self.get_best_match_zone(all_zones, domain)
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)
890484
def _extract_domain_id(string, regex):
        
        regex = re.compile(regex)
        match = regex.search(string)
        if not match:
            return False
        return str(match.group(1))
965654
def get_host(self, host):
        '''  '''

        if len(self.index) == 0:
            # Need to load index from cache
            self.load_index_from_cache()

        if not host in self.index:
            # try updating the cache
            self.do_api_calls_update_cache()
            if not host in self.index:
                # host might not exist anymore
                return {}

        (region, instance_id) = self.index[host]

        instance = self.get_instance(region, instance_id)
        return self.get_host_info_dict_from_instance(instance)
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)
    }
572743
public static function getXDomainUserId($domain_username, $domain)
	{
		$db = \App::get('db');

		if (empty($domain) || ($domain == 'hubzero'))
		{
			return $domain_username;
		}

		$query = 'SELECT uidNumber FROM #__xdomain_users,#__xdomains WHERE ' .
				 '#__xdomains.domain_id=#__xdomain_users.domain_id AND ' .
				 '#__xdomains.domain=' . $db->quote($domain) . ' AND ' .
				 '#__xdomain_users.domain_username=' . $db->quote($domain_username);
		$db->setQuery($query);

		$result = $db->loadObject();

		if (empty($result))
		{
			return false;
		}

		return $result->uidNumber;
	}
552929
def _get_binding_info(hostheader='', ipaddress='*', port=80):
    '''
    
    '''
    ret = r'{0}:{1}:{2}'.format(ipaddress, port, hostheader.replace(' ', ''))

    return ret
1225666
def parse_hosted_zones(self, hosted_zone, params):
        
        # When resuming upon throttling error, skip if already fetched
        hosted_zone_id = hosted_zone.pop('Id')
        hosted_zone['name'] = hosted_zone.pop('Name')
        api_client = params['api_client']
        record_sets = handle_truncated_response(api_client.list_resource_record_sets, {'HostedZoneId': hosted_zone_id}, ['ResourceRecordSets'])
        hosted_zone.update(record_sets)
        #print(str(record_sets))
        #record_sets = api_client.list_resource_record_sets()
        #hosted_zone['RecordSets'] = record_sets['Resourc']
        self.hosted_zones[hosted_zone_id] = hosted_zone
440747
async def get(self, zone_id: int, *, details: bool = False) -> dict:
        """"""
        endpoint = 'zone/{0}'.format(zone_id)
        if details:
            endpoint += '/properties'
        return await self._request('get', endpoint)
172043
def authenticate(self):
        """"""
        try:
            payload = self._api.domain.info(self._api_key, self._domain)
            self._zone_id = payload['zone_id']
            return payload['id']
        except xmlrpclib.Fault as err:
            raise Exception("Failed to authenticate: '{0}'".format(err))
177988
def get_host(self, domain_part):
        
        if self.map.host_matching:
            if domain_part is None:
                return self.server_name
            return to_unicode(domain_part, "ascii")
        subdomain = domain_part
        if subdomain is None:
            subdomain = self.subdomain
        else:
            subdomain = to_unicode(subdomain, "ascii")
        return (subdomain + u"." if subdomain else u"") + self.server_name
165363
public static function getXDomainId($domain)
	{
		$db = \App::get('db');

		if (empty($domain) || ($domain == 'hubzero'))
		{
			return false;
		}

		$query = 'SELECT domain_id FROM `#__xdomains` WHERE domain=' . $db->quote($domain) . ';';
		$db->setQuery($query);

		$result = $db->loadObject();

		if (empty($result))
		{
			return false;
		}

		return $result->domain_id;
	}
682170
def get_cookie_domain(self, app: 'Quart') -> Optional[str]:
        """"""
        if app.config['SESSION_COOKIE_DOMAIN'] is not None:
            return app.config['SESSION_COOKIE_DOMAIN']
        elif app.config['SERVER_NAME'] is not None:
            return '.' + app.config['SERVER_NAME'].rsplit(':', 1)[0]
        else:
            return None
1266851
def host2id(self, hostname):
        """"""
        for key, value in self.server_map.items():
            if value == hostname:
                return key
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)
814668
def get_domain(self):
        
        if hasattr(self, 'domain'):
            return Domain(self.rest_client.make_request(self.domain), self.rest_client)
1137610
def fetch_host_meta(domain)
      cached_value = get_cache(domain)
      return cached_value unless cached_value.nil?

      host_meta_url = "https://www.google.com/accounts/o8/.well-known/host-meta?hd=#{CGI::escape(domain)}"
      http_resp = OpenID.fetch(host_meta_url)
      if http_resp.code != "200" and http_resp.code != "206"
        return nil
      end
      matches = /Link: <(.*)>/.match( http_resp.body )
      if matches.nil?
        return nil
      end
      put_cache(domain, matches[1])
      return matches[1]
    end