// GetDeviceProfilesByCommandId provides a mock function with given fields: id
330221
func (_m *DBClient) GetDeviceProfilesByCommandId(id string) ([]models.DeviceProfile, error) {
	ret := _m.Called(id)

	var r0 []models.DeviceProfile
	if rf, ok := ret.Get(0).(func(string) []models.DeviceProfile); ok {
		r0 = rf(id)
	} 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(id)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1286135
func (os *OpenStack) GetDevicePath(volumeID string) string {
	devicePath := os.GetDevicePathBySerialID(volumeID)

	if devicePath == "" {
		devicePath = os.getDevicePathFromInstanceMetadata(volumeID)
	}

	if devicePath == "" {
		klog.Warningf("Failed to find device for the volumeID: %q", volumeID)
	}

	return devicePath
}
952047
func (disk *dataDisk) GetPodDeviceMapPath() (string, string) {
	name := azureDataDiskPluginName
	return disk.plugin.host.GetPodVolumeDeviceDir(disk.podUID, utilstrings.EscapeQualifiedName(name)), disk.volumeName
}
795999
func (m *execMounter) GetDeviceNameFromMount(mountPath, pluginMountDir string) (string, error) {
	return m.wrappedMounter.GetDeviceNameFromMount(mountPath, pluginMountDir)
}
1057741
func (f *Facade) GetServiceMonitoringProfile(ctx datastore.Context, serviceID string) (*domain.MonitorProfile, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.GetServiceMonitoringProfile"))
	svc, err := f.serviceStore.Get(ctx, serviceID)
	if err != nil {
		return nil, err
	}
	return &svc.MonitoringProfile, nil
}
1236776
func GetDeviceProfileCache(p *redis.Pool, id uuid.UUID) (DeviceProfile, error) {
	var dp DeviceProfile
	key := fmt.Sprintf(DeviceProfileKeyTempl, id)

	c := p.Get()
	defer c.Close()

	val, err := redis.Bytes(c.Do("GET", key))
	if err != nil {
		if err == redis.ErrNil {
			return dp, ErrDoesNotExist
		}
		return dp, errors.Wrap(err, "get error")
	}

	err = gob.NewDecoder(bytes.NewReader(val)).Decode(&dp)
	if err != nil {
		return dp, errors.Wrap(err, "gob decode error")
	}

	return dp, nil
}
751452
func (m *PoolMetadata) GetDevice(ctx context.Context, name string) (*DeviceInfo, error) {
	var (
		dev DeviceInfo
		err error
	)

	err = m.db.View(func(tx *bolt.Tx) error {
		bucket := tx.Bucket(devicesBucketName)
		return getObject(bucket, name, &dev)
	})

	return &dev, err
}
1327902
func getDeviceInfo(mode os.FileMode, rdev uint64) (kind rune, major uint64, minor uint64, err error) {
	kind = 'b'

	if mode&os.ModeCharDevice != 0 {
		kind = 'c'
	}

	major = (rdev >> 8) & 0xfff
	minor = (rdev & 0xff) | ((rdev >> 12) & 0xfff00)

	return
}
893523
func (d *Driver) GetMetadata(id string) (map[string]string, error) {
	m, err := d.DeviceSet.exportDeviceMetadata(id)

	if err != nil {
		return nil, err
	}

	metadata := make(map[string]string)
	metadata["DeviceId"] = strconv.Itoa(m.deviceID)
	metadata["DeviceSize"] = strconv.FormatUint(m.deviceSize, 10)
	metadata["DeviceName"] = m.deviceName
	return metadata, nil
}
1171337
func (n *NetworkServerAPI) DeleteDeviceProfile(ctx context.Context, req *ns.DeleteDeviceProfileRequest) (*empty.Empty, error) {
	var dpID uuid.UUID
	copy(dpID[:], req.Id)

	if err := storage.FlushDeviceProfileCache(storage.RedisPool(), dpID); err != nil {
		return nil, errToRPCError(err)
	}

	if err := storage.DeleteDeviceProfile(storage.DB(), dpID); err != nil {
		return nil, errToRPCError(err)
	}

	return &empty.Empty{}, nil
}
1352865
func (s *ConfigurationParser) FindJobsByProductID(id string) (jobs []Jobs) {
	jobs = s.InstallationSettings.FindJobsByProductID(id)
	return
}
1270160
func (ispr iscsiDevicePathResolver) getDevicePaths(devices []string, shouldExist bool) ([]string, error) {
	var paths []string
	for _, device := range devices {
		exist, err := regexp.MatchString("-part1", device)
		if err != nil {
			return paths, bosherr.WrapError(err, "There is a problem with your regexp: '-part1'. That is used to find existing device")
		}
		if exist == shouldExist {
			matchedPath := path.Join("/dev/mapper", strings.Split(strings.Fields(device)[0], "-")[0])
			ispr.logger.Debug(ispr.logTag, "path in device list: '%+v'", matchedPath)
			paths = append(paths, matchedPath)
		}
	}

	return paths, nil
}
245120
func (mounter *Mounter) GetDeviceNameFromMount(mountPath, pluginMountDir string) (string, error) {
	return GetDeviceNameFromMountLinux(mounter, mountPath, pluginMountDir)
}
785856
func (_m *DBClient) GetDevicesByProfileId(pid string) ([]models.Device, error) {
	ret := _m.Called(pid)

	var r0 []models.Device
	if rf, ok := ret.Get(0).(func(string) []models.Device); ok {
		r0 = rf(pid)
	} 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(pid)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1034569
func getDiskByIDPaths(pdName string, partition string) []string {
	devicePaths := []string{
		filepath.Join(diskByIDPath, diskGooglePrefix+pdName),
		filepath.Join(diskByIDPath, diskScsiGooglePrefix+pdName),
	}

	if partition != "" {
		for i, path := range devicePaths {
			devicePaths[i] = path + diskPartitionSuffix + partition
		}
	}

	return devicePaths
}
319386
func (c *HeapProfiler) GetObjectByHeapObjectId(objectId string, objectGroup string) (*RuntimeRemoteObject, error) {
	var v HeapProfilerGetObjectByHeapObjectIdParams
	v.ObjectId = objectId
	v.ObjectGroup = objectGroup
	return c.GetObjectByHeapObjectIdWithParams(&v)
}
806773
func (c *HeapProfiler) GetHeapObjectIdWithParams(v *HeapProfilerGetHeapObjectIdParams) (string, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "HeapProfiler.getHeapObjectId", Params: v})
	if err != nil {
		return "", err
	}

	var chromeData struct {
		Result struct {
			HeapSnapshotObjectId string
		}
	}

	if resp == nil {
		return "", &gcdmessage.ChromeEmptyResponseErr{}
	}

	// test if error first
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return "", &gcdmessage.ChromeRequestErr{Resp: cerr}
	}

	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return "", err
	}

	return chromeData.Result.HeapSnapshotObjectId, nil
}