// Returns the matching VHost entry or nil if not found.
978049
func (s *Service) GetVirtualHost(application, vhostName string) *servicedefinition.VHost {
	if s.Endpoints != nil {
		//find the matching endpoint
		for i := range s.Endpoints {
			ep := &s.Endpoints[i]

			if ep.Application == application && ep.Purpose == "export" {
				vhostNameLower := strings.ToLower(vhostName)
				for _, vhost := range ep.VHostList {
					if strings.ToLower(vhost.Name) == vhostNameLower {
						return &vhost
					}
				}
			}
		}
	}

	return nil
}
493931
func (az *Cloud) GetVirtualMachineWithRetry(name types.NodeName) (compute.VirtualMachine, error) {
	var machine compute.VirtualMachine
	var retryErr error
	err := wait.ExponentialBackoff(az.requestBackoff(), func() (bool, error) {
		machine, retryErr = az.getVirtualMachine(name)
		if retryErr == cloudprovider.InstanceNotFound {
			return true, cloudprovider.InstanceNotFound
		}
		if retryErr != nil {
			klog.Errorf("GetVirtualMachineWithRetry(%s): backoff failure, will retry, err=%v", name, retryErr)
			return false, nil
		}
		klog.V(2).Infof("GetVirtualMachineWithRetry(%s): backoff success", name)
		return true, nil
	})
	if err == wait.ErrWaitTimeout {
		err = retryErr
	}
	return machine, err
}
1178149
func (r Hardware_SecurityModule750) GetPublicVlanByHostname(hostname *string) (resp datatypes.Network_Vlan, err error) {
	params := []interface{}{
		hostname,
	}
	err = r.Session.DoRequest("SoftLayer_Hardware_SecurityModule750", "getPublicVlanByHostname", params, &r.Options, &resp)
	return
}
555232
func (s *HostService) FindHostsForMigration(p *FindHostsForMigrationParams) (*FindHostsForMigrationResponse, error) {
	resp, err := s.cs.newRequest("findHostsForMigration", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r FindHostsForMigrationResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
1023446
func getHostsSlice(records []dns.SrvRecord) []string {
	var hosts []string
	for _, r := range records {
		hosts = append(hosts, r.Host)
	}
	return hosts
}
14438
func (s *ServiceCache) findHost(host string, port int, local bool) interface{} {
	hostCache := s.remoteHosts
	if local {
		hostCache = s.localHosts
	}

	entries, ok := hostCache[host]
	if !ok {
		return nil
	}
	for _, e := range entries {
		if e.ports.IsIncluded(port) {
			return e.data
		}
	}

	return nil
}
338529
func (r Virtual_Host) GetGuests() (resp []datatypes.Virtual_Guest, err error) {
	err = r.Session.DoRequest("SoftLayer_Virtual_Host", "getGuests", nil, &r.Options, &resp)
	return
}
899545
func MatchHost(req *http.Request, ereq *Request) (bool, error) {
	url := ereq.URLStruct
	if strings.EqualFold(url.Host, req.URL.Host) {
		return true, nil
	}
	return regexp.MatchString(url.Host, req.URL.Host)
}
1088317
func (_class HostCrashdumpClass) GetHost(sessionID SessionRef, self HostCrashdumpRef) (_retval HostRef, _err error) {
	_method := "host_crashdump.get_host"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertHostCrashdumpRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertHostRefToGo(_method + " -> ", _result.Value)
	return
}
742739
func (a Address) VHost() string {
	if idx := strings.Index(a.Original, "://"); idx > -1 {
		return a.Original[idx+3:]
	}
	return a.Original
}
1169543
func (p *propZone) GetVNCProxyHostName() string {
	if p.Zone == nil {
		return ""
	}

	return p.Zone.GetVNCProxyHostName()
}
1195802
func (p *standardHostPool) Get() HostPoolResponse {
	p.Lock()
	defer p.Unlock()
	host := p.getRoundRobin()
	return &standardHostPoolResponse{host: host, pool: p}
}
1181424
func getHostAddr(req *http.Request) string {
	if req.Host != "" {
		return req.Host
	}
	return req.URL.Host
}
244409
func (h *Hostsfile) LookupStaticHostV4(host string) []net.IP {
	return h.lookupStaticHost(h.hmap.byNameV4, host)
}
540394
func (r Scale_Asset_Virtual_Guest) GetVirtualGuestId() (resp int, err error) {
	err = r.Session.DoRequest("SoftLayer_Scale_Asset_Virtual_Guest", "getVirtualGuestId", nil, &r.Options, &resp)
	return
}
1152706
func (m MiddlewareFunc) HostMatches(tests ...regexp.Regexp) MiddlewareFunc {
	return func(h HandlerFunc) HandlerFunc {
		return func(c *Context) error {
			for _, test := range tests {
				if test.MatchString(c.Request().URL().Host) {
					return m(h)(c)
				}
			}
			return h(c)
		}
	}
}
178001
func (z *zkf) GetVHost(subdomain string) (string, string, error) {
	logger := plog.WithField("subdomain", subdomain)

	// get the root-based connection to check the public port
	conn, err := zzk.GetLocalConnection("/")
	if err != nil {
		logger.WithError(err).Debug("Could not acquire root-based connection to look up a public endpoint vhost")
		return "", "", err
	}

	// look for the vhost
	key := zkr.VHostKey{
		HostID:    "master",
		Subdomain: subdomain,
	}
	serviceID, application, err := zkr.GetVHost(conn, key)
	if err != nil {
		logger.WithError(err).Debug("Could not look up public endpoint vhost")
		return "", "", err
	}

	logger.Debug("Searched for public endpoint vhost")
	return serviceID, application, err
}