// GetAllSensors retrieves the state of all sensors that the bridge is aware of.
489556
func (bridge *Bridge) GetAllSensors() ([]Sensor, error) {
	uri := fmt.Sprintf("/api/%s/sensors", bridge.Username)
	body, _, err := bridge.Get(uri)
	if err != nil {
		return []Sensor{}, err
	}

	// An index is at the top of every sensor in the array
	sensorList := map[string]Sensor{}
	err = json.Unmarshal(body, &sensorList)
	if err != nil {
		fmt.Print(err)
		return []Sensor{}, errors.New("Unable to marshal GetAllSensors response. ")
	}

	// Parse the index, add the sensor to the list, and return the array
	sensors := make([]Sensor, 0, len(sensorList))
	for index, sensor := range sensorList {
		sensor.Index, err = strconv.Atoi(index)
		if err != nil {
			return []Sensor{}, errors.New("Unable to convert sensor index to integer. ")
		}
		sensor.Bridge = bridge
		sensors = append(sensors, sensor)
	}
	return sensors, nil
}
900341
func (c CertificateStore) GetAllDomains() []string {

	allCerts := c.getDefaultCertificateDomains()

	// Get dynamic certificates
	if c.DynamicCerts != nil && c.DynamicCerts.Get() != nil {
		for domains := range c.DynamicCerts.Get().(map[string]*tls.Certificate) {
			allCerts = append(allCerts, domains)
		}
	}
	return allCerts
}
1236490
func (r *Client) GetAllDatasources() ([]Datasource, error) {
	var (
		raw  []byte
		ds   []Datasource
		code int
		err  error
	)
	if raw, code, err = r.get("api/datasources", nil); err != nil {
		return nil, err
	}
	if code != 200 {
		return nil, fmt.Errorf("HTTP error %d: returns %s", code, raw)
	}
	err = json.Unmarshal(raw, &ds)
	return ds, err
}
112399
func (state *ServicesState) GetListeners() []Listener {
	state.RLock()
	var listeners []Listener
	for _, listener := range state.listeners {
		listeners = append(listeners, listener)
	}
	state.RUnlock()

	return listeners
}
196389
func (is *InfoSyncer) GetAllServerInfo(ctx context.Context) (map[string]*ServerInfo, error) {
	allInfo := make(map[string]*ServerInfo)
	if is.etcdCli == nil {
		allInfo[is.info.ID] = is.info
		return allInfo, nil
	}
	allInfo, err := getInfo(ctx, is.etcdCli, ServerInformationPath, keyOpDefaultRetryCnt, keyOpDefaultTimeout, clientv3.WithPrefix())
	if err != nil {
		return nil, err
	}
	return allInfo, nil
}
133993
func (r Network_Monitor_Version1_Query_Host_Stratum) GetAllQueryTypes() (resp []datatypes.Network_Monitor_Version1_Query_Type, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_Monitor_Version1_Query_Host_Stratum", "getAllQueryTypes", nil, &r.Options, &resp)
	return
}
1316232
func getAllUnits(st *state.State, tag names.Tag) ([]string, error) {
	machine, err := st.Machine(tag.Id())
	if err != nil {
		return nil, err
	}
	// Start a watcher on machine's units, read the initial event and stop it.
	watch := machine.WatchUnits()
	defer watch.Stop()
	if units, ok := <-watch.Changes(); ok {
		return units, nil
	}
	return nil, fmt.Errorf("cannot obtain units of machine %q: %v", tag, watch.Err())
}
1099016
func (_class PVSServerClass) GetAllRecords(sessionID SessionRef) (_retval map[PVSServerRef]PVSServerRecord, _err error) {
	_method := "PVS_server.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 = convertPVSServerRefToPVSServerRecordMapToGo(_method + " -> ", _result.Value)
	return
}
1187797
func (b *allModelWatcherStateBacking) GetAll(all *multiwatcherStore) error {
	modelUUIDs, err := b.st.AllModelUUIDs()
	if err != nil {
		return errors.Annotate(err, "error loading models")
	}
	for _, modelUUID := range modelUUIDs {
		if err := b.loadAllWatcherEntitiesForModel(modelUUID, all); err != nil {
			return errors.Trace(err)
		}
	}
	return nil
}
1067416
func (svc *DynamoAccessor) GetAll(ctx context.Context,
	ctor NewObjectConstructor) ([]interface{}, error) {
	var getAllErr error

	results := make([]interface{}, 0)
	input := &dynamodb.ScanInput{
		TableName: aws.String(svc.dynamoTableName()),
	}
	scanHandler := func(output *dynamodb.ScanOutput, lastPage bool) bool {
		for _, eachItem := range output.Items {
			unmarshalTarget := ctor()
			unmarshalErr := dynamodbattribute.UnmarshalMap(eachItem, unmarshalTarget)
			if unmarshalErr != nil {
				getAllErr = unmarshalErr
				return false
			}
			results = append(results, unmarshalTarget)
		}
		return true
	}
	scanErr := svc.dynamoSvc(ctx).ScanPagesWithContext(ctx, input, scanHandler)
	if scanErr != nil {
		return nil, scanErr
	}
	if getAllErr != nil {
		return nil, getAllErr
	}
	return results, nil
}
613911
func (a *Alloc) GetAllocs(args *structs.AllocsGetRequest,
	reply *structs.AllocsGetResponse) error {
	if done, err := a.srv.forward("Alloc.GetAllocs", args, args, reply); done {
		return err
	}
	defer metrics.MeasureSince([]string{"nomad", "alloc", "get_allocs"}, time.Now())

	allocs := make([]*structs.Allocation, len(args.AllocIDs))

	// Setup the blocking query. We wait for at least one of the requested
	// allocations to be above the min query index. This guarantees that the
	// server has received that index.
	opts := blockingOptions{
		queryOpts: &args.QueryOptions,
		queryMeta: &reply.QueryMeta,
		run: func(ws memdb.WatchSet, state *state.StateStore) error {
			// Lookup the allocation
			thresholdMet := false
			maxIndex := uint64(0)
			for i, alloc := range args.AllocIDs {
				out, err := state.AllocByID(ws, alloc)
				if err != nil {
					return err
				}
				if out == nil {
					// We don't have the alloc yet
					thresholdMet = false
					break
				}

				// Store the pointer
				allocs[i] = out

				// Check if we have passed the minimum index
				if out.ModifyIndex > args.QueryOptions.MinQueryIndex {
					thresholdMet = true
				}

				if maxIndex < out.ModifyIndex {
					maxIndex = out.ModifyIndex
				}
			}

			// Setup the output
			if thresholdMet {
				reply.Allocs = allocs
				reply.Index = maxIndex
			} else {
				// Use the last index that affected the nodes table
				index, err := state.Index("allocs")
				if err != nil {
					return err
				}
				reply.Index = index
			}

			// Set the query response
			a.srv.setQueryMeta(&reply.QueryMeta)
			return nil
		},
	}
	return a.srv.blockingRPC(&opts)
}
1345986
func (f *Facade) GetAllServices(ctx datastore.Context) ([]service.Service, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.GetAllServices"))
	var (
		err  error
		svcs []service.Service
	)
	plog.Debug("Started Facade.GetAllServices")
	defer plog.Debug("Finished Facade.GetAllServices")

	svcs, err = f.getServices(ctx)
	if err != nil {
		return nil, err
	}
	return svcs, nil
}
790630
func (bridge *Bridge) GetSensorByIndex(index int) (Sensor, error) {
	// Send an http GET and inspect the response
	uri := fmt.Sprintf("/api/%s/sensors/%d", bridge.Username, index)
	body, _, err := bridge.Get(uri)
	if err != nil {
		return Sensor{}, err
	}
	if strings.Contains(string(body), "not available") {
		return Sensor{}, errors.New("Error: Sensor selection index out of bounds. ")
	}

	// Parse and load the response into the sensor array
	sensor := Sensor{}
	err = json.Unmarshal(body, &sensor)
	if err != nil {
		return Sensor{}, errors.New("Error: Unable to unmarshal light data. ")
	}
	sensor.Index = index
	sensor.Bridge = bridge
	return sensor, nil
}
936962
func (c *MemStore) AllControllers() (map[string]ControllerDetails, error) {
	c.mu.Lock()
	defer c.mu.Unlock()

	result := make(map[string]ControllerDetails)
	for name, details := range c.Controllers {
		result[name] = details
	}
	return result, nil
}
339383
func (_class VLANClass) GetAllRecords(sessionID SessionRef) (_retval map[VLANRef]VLANRecord, _err error) {
	_method := "VLAN.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 = convertVLANRefToVLANRecordMapToGo(_method + " -> ", _result.Value)
	return
}
1217937
func (q *EventuallyConsistentQuotaUsage) GetAllTypes(
	ctx context.Context, bgTolerance, blockTolerance time.Duration) (
	timestamp time.Time,
	usageBytes, archiveBytes, limitBytes,
	gitUsageBytes, gitArchiveBytes, gitLimitBytes int64, err error) {
	c := q.getCached()
	err = q.fetcher.Do(ctx, bgTolerance, blockTolerance, c.timestamp)
	if err != nil {
		return time.Time{}, -1, -1, -1, -1, -1, -1, err
	}

	c = q.getCached()
	return c.timestamp,
		c.usageBytes, c.archiveBytes, c.limitBytes,
		c.gitUsageBytes, c.gitArchiveBytes, c.gitLimitBytes, nil
}
401154
func (_class BondClass) GetAll(sessionID SessionRef) (_retval []BondRef, _err error) {
	_method := "Bond.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 = convertBondRefSetToGo(_method + " -> ", _result.Value)
	return
}