// Get info and attributes for each S.M.A.R.T. device
4087
func (m *Smart) getAttributes(acc telegraf.Accumulator, devices []string) {

	var wg sync.WaitGroup
	wg.Add(len(devices))

	for _, device := range devices {
		go gatherDisk(acc, m.UseSudo, m.Attributes, m.Path, m.Nocheck, device, &wg)
	}

	wg.Wait()
}
450943
func (d *domainClient) GetAttributes(ctx context.Context, args *GetAttributesArgs) (reply *GetAttributesReply, err error) {
	reply = new(GetAttributesReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "DOM.getAttributes", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "DOM.getAttributes", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "DOM", Op: "GetAttributes", Err: err}
	}
	return
}
515495
func (p *V2) GetDevices() ([]common.Device, error) {
	p.RLock()
	defer p.RUnlock()
	if len(p.devices) == 0 {
		return nil, common.ErrNotFound
	}
	devices := make([]common.Device, len(p.devices))
	i := 0
	for _, device := range p.devices {
		devices[i] = device
		i++
	}

	return devices, nil
}
1059237
func Info(deviceName string) ([]*DeviceInfo, error) {
	output, err := dmsetup(
		"info",
		"--columns",
		"--noheadings",
		"-o",
		"name,blkdevname,attr,major,minor,open,segments,events",
		"--separator",
		" ",
		deviceName)

	if err != nil {
		return nil, err
	}

	var (
		lines   = strings.Split(output, "\n")
		devices = make([]*DeviceInfo, len(lines))
	)

	for i, line := range lines {
		var (
			attr = ""
			info = &DeviceInfo{}
		)

		_, err := fmt.Sscan(line,
			&info.Name,
			&info.BlockDeviceName,
			&attr,
			&info.Major,
			&info.Minor,
			&info.OpenCount,
			&info.TargetCount,
			&info.EventNumber)

		if err != nil {
			return nil, errors.Wrapf(err, "failed to parse line %q", line)
		}

		// Parse attributes (see "man 8 dmsetup" for details)
		info.Suspended = strings.Contains(attr, "s")
		info.ReadOnly = strings.Contains(attr, "r")
		info.TableLive = strings.Contains(attr, "L")
		info.TableInactive = strings.Contains(attr, "I")

		devices[i] = info
	}

	return devices, nil
}
1012289
func (_m *DBClient) GetDeviceProfilesByManufacturer(man string) ([]models.DeviceProfile, error) {
	ret := _m.Called(man)

	var r0 []models.DeviceProfile
	if rf, ok := ret.Get(0).(func(string) []models.DeviceProfile); ok {
		r0 = rf(man)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]models.DeviceProfile)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(man)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
837959
func (fs *flushFS) getAttributes(id fuseops.InodeID) (
	attrs fuseops.InodeAttributes,
	err error) {
	switch id {
	case fuseops.RootInodeID:
		attrs = fs.rootAttributes()
		return

	case fooID:
		attrs = fs.fooAttributes()
		return

	case barID:
		attrs = fs.barAttributes()
		return

	default:
		err = fuse.ENOENT
		return
	}
}
391300
func (r Resource_Group) GetAttributes() (resp []datatypes.Resource_Group_Attribute, err error) {
	err = r.Session.DoRequest("SoftLayer_Resource_Group", "getAttributes", nil, &r.Options, &resp)
	return
}
98552
func (m *Mat64Instances) GetAttribute(a Attribute) (AttributeSpec, error) {
	for i, at := range m.attributes {
		if at.Equals(a) {
			return AttributeSpec{0, i, at}, nil
		}
	}
	return AttributeSpec{}, fmt.Errorf("Couldn't find a matching attribute")
}
1008392
func GetDevice(ordinal int) (device Device, err error) {
	Cordinal := C.int(ordinal)
	var Cdevice C.CUdevice
	err = result(C.cuDeviceGet(&Cdevice, Cordinal))
	device = Device(Cdevice)

	return
}
1082136
func (devices *DeviceSet) exportDeviceMetadata(hash string) (*deviceMetadata, error) {
	info, err := devices.lookupDeviceWithLock(hash)
	if err != nil {
		return nil, err
	}

	info.lock.Lock()
	defer info.lock.Unlock()

	metadata := &deviceMetadata{info.DeviceID, info.Size, info.Name()}
	return metadata, nil
}
1127688
func (_m *DBClient) GetDevicesByServiceId(sid string) ([]models.Device, error) {
	ret := _m.Called(sid)

	var r0 []models.Device
	if rf, ok := ret.Get(0).(func(string) []models.Device); ok {
		r0 = rf(sid)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]models.Device)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(sid)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
988237
func (c *Client) GetDevices() (devices []common.Device, err error) {
	return c.protocol.GetDevices()
}
1122168
func getAttributes(m interface{}) map[string]reflect.StructField {
	typ := reflect.TypeOf(m)
	// if a pointer to a struct is passed, get the type of the dereferenced object
	if typ.Kind() == reflect.Ptr {
		typ = typ.Elem()
	}

	// create an attribute data structure as a map of types keyed by a string.
	attrs := make(map[string]reflect.StructField)
	// Only structs are supported so return an empty result if the passed object
	// isn't a struct
	if typ.Kind() != reflect.Struct {
		fmt.Printf("%v type can't have attributes inspected\n", typ.Kind())
		return attrs
	}

	// loop through the struct's fields and set the map
	for i := 0; i < typ.NumField(); i++ {
		p := typ.Field(i)
		if !p.Anonymous {
			attrs[strings.ToLower(p.Name)] = p
		}
	}

	return attrs
}
359388
func (devices *DeviceSet) GetDeviceStatus(hash string) (*DevStatus, error) {
	info, err := devices.lookupDeviceWithLock(hash)
	if err != nil {
		return nil, err
	}

	info.lock.Lock()
	defer info.lock.Unlock()

	devices.Lock()
	defer devices.Unlock()

	status := &DevStatus{
		DeviceID:      info.DeviceID,
		Size:          info.Size,
		TransactionID: info.TransactionID,
	}

	if err := devices.activateDeviceIfNeeded(info, false); err != nil {
		return nil, fmt.Errorf("devmapper: Error activating devmapper device for '%s': %s", hash, err)
	}

	sizeInSectors, mappedSectors, highestMappedSector, err := devices.deviceStatus(info.DevName())

	if err != nil {
		return nil, err
	}

	status.SizeInSectors = sizeInSectors
	status.MappedSectors = mappedSectors
	status.HighestMappedSector = highestMappedSector

	return status, nil
}
53208
func Info(deviceID DeviceID) *DeviceInfo {
	info := C.Pm_GetDeviceInfo(C.PmDeviceID(deviceID))
	if info == nil {
		return nil
	}
	return &DeviceInfo{
		Interface:         C.GoString(info.interf),
		Name:              C.GoString(info.name),
		IsInputAvailable:  info.input > 0,
		IsOutputAvailable: info.output > 0,
		IsOpened:          info.opened > 0,
	}
}
317268
func (r Network_Gateway_Member) GetAttributes() (resp datatypes.Network_Gateway_Member_Attribute, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_Gateway_Member", "getAttributes", nil, &r.Options, &resp)
	return
}
372453
func (d *driver) NextDeviceInfo(
	ctx types.Context) (*types.NextDeviceInfo, error) {
	return s3fsUtils.NextDeviceInfo, nil
}