// GetAllHosts returns all the host objects in this datacenter of VC
973358
func (dc *Datacenter) GetAllHosts(ctx context.Context) ([]types.ManagedObjectReference, error) {
	finder := getFinder(dc)
	hostSystems, err := finder.HostSystemList(ctx, "*")
	if err != nil {
		klog.Errorf("Failed to get all hostSystems. err: %+v", err)
		return nil, err
	}
	var hostMors []types.ManagedObjectReference
	for _, hs := range hostSystems {
		hostMors = append(hostMors, hs.Reference())
	}
	return hostMors, nil
}
280727
func (api *API) HostsGetByHostGroupIds(ids []string) (res Hosts, err error) {
	return api.HostsGet(Params{"groupids": ids})
}
1030634
func (_class HostCrashdumpClass) GetAllRecords(sessionID SessionRef) (_retval map[HostCrashdumpRef]HostCrashdumpRecord, _err error) {
	_method := "host_crashdump.get_all_records"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertHostCrashdumpRefToHostCrashdumpRecordMapToGo(_method + " -> ", _result.Value)
	return
}
449267
func (cs Credentials) Hosts() []string {
	hosts := []string{}
	for host := range cs.m {
		hosts = append(hosts, host)
	}
	return hosts
}
279752
func (s *Server) GetHost(hostID string, reply *host.Host) error {
	response, err := s.f.GetHost(s.context(), hostID)
	if err != nil {
		return err
	}
	if response == nil {
		return facade.ErrHostDoesNotExist
	}
	*reply = *response
	return nil
}
1098105
func (_class HostMetricsClass) GetAllRecords(sessionID SessionRef) (_retval map[HostMetricsRef]HostMetricsRecord, _err error) {
	_method := "host_metrics.get_all_records"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertHostMetricsRefToHostMetricsRecordMapToGo(_method + " -> ", _result.Value)
	return
}
455684
func (_class VLANClass) GetAll(sessionID SessionRef) (_retval []VLANRef, _err error) {
	_method := "VLAN.get_all"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertVLANRefSetToGo(_method + " -> ", _result.Value)
	return
}
346334
func (f *Facade) GetHostStatuses(ctx datastore.Context, hostIDs []string, since time.Time) ([]host.HostStatus, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.GetHostStatuses"))
	if hostIDs == nil {
		return []host.HostStatus{}, nil
	}

	statuses := []host.HostStatus{}
	for _, id := range hostIDs {
		h, err := f.GetHost(ctx, id)
		if err != nil {
			continue
		}

		status := host.HostStatus{HostID: id, HostName: h.Name, MemoryUsage: service.Usage{}}
		active, err := f.zzk.IsHostActive(h.PoolID, h.ID)
		if err != nil {
			continue
		}
		status.Active = active

		expired, _ := f.hostRegistry.IsExpired(h.ID)
		status.Authenticated = !expired

		instances, err := f.GetHostInstances(ctx, since, id)
		if err != nil {
			continue
		}

		for _, i := range instances {
			status.MemoryUsage.Cur += i.MemoryUsage.Cur
			status.MemoryUsage.Max += i.MemoryUsage.Max
			status.MemoryUsage.Avg += i.MemoryUsage.Avg
		}

		statuses = append(statuses, status)
	}

	return statuses, nil
}
536042
func (c *Client) GetServers() []string {
	endpoints := c.servers.GetServers()
	res := make([]string, len(endpoints))
	for i := range endpoints {
		res[i] = endpoints[i].String()
	}
	sort.Strings(res)
	return res
}
1272346
func restGetHosts(w *rest.ResponseWriter, r *rest.Request, ctx *requestContext) {
	facade := ctx.getFacade()
	dataCtx := ctx.getDatastoreContext()
	hosts, err := facade.GetHosts(dataCtx)
	if err != nil {
		glog.Errorf("Could not get hosts: %v", err)
		restServerError(w, err)
		return
	}

	glog.V(2).Infof("Returning %d hosts", len(hosts))
	response := make(map[string]*host.Host)
	for i, host := range hosts {
		response[host.ID] = &hosts[i]
		if err := buildHostMonitoringProfile(&hosts[i]); err != nil {
			restServerError(w, err)
			return
		}
	}

	w.WriteJson(&response)
}
292508
func (f *Facade) GetHosts(ctx datastore.Context) ([]host.Host, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.GetHosts"))
	return f.hostStore.GetN(ctx, 10000)
}
1035701
func (r Network_LoadBalancer_Global_Account) GetHosts() (resp []datatypes.Network_LoadBalancer_Global_Host, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_LoadBalancer_Global_Account", "getHosts", nil, &r.Options, &resp)
	return
}
517054
func (_class HostCPUClass) GetAllRecords(sessionID SessionRef) (_retval map[HostCPURef]HostCPURecord, _err error) {
	_method := "host_cpu.get_all_records"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertHostCPURefToHostCPURecordMapToGo(_method + " -> ", _result.Value)
	return
}
24247
func (_class HostCrashdumpClass) GetAll(sessionID SessionRef) (_retval []HostCrashdumpRef, _err error) {
	_method := "host_crashdump.get_all"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertHostCrashdumpRefSetToGo(_method + " -> ", _result.Value)
	return
}
1226312
func (r Virtual_DedicatedHost) GetAllocationStatus() (resp datatypes.Container_Virtual_DedicatedHost_AllocationStatus, err error) {
	err = r.Session.DoRequest("SoftLayer_Virtual_DedicatedHost", "getAllocationStatus", nil, &r.Options, &resp)
	return
}
264020
func (_class NetworkSriovClass) GetAllRecords(sessionID SessionRef) (_retval map[NetworkSriovRef]NetworkSriovRecord, _err error) {
	_method := "network_sriov.get_all_records"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertNetworkSriovRefToNetworkSriovRecordMapToGo(_method + " -> ", _result.Value)
	return
}
394791
func (api *API) HostsGetByHostGroups(hostGroups HostGroups) (res Hosts, err error) {
	ids := make([]string, len(hostGroups))
	for i, id := range hostGroups {
		ids[i] = id.GroupId
	}
	return api.HostsGetByHostGroupIds(ids)
}