// List all disks. If diskId is greater than 0, limit the results to given disk.
765828
func (t *LinodeDiskService) List(linodeId int, diskId int) (*LinodeDiskListResponse, error) {
	u := &url.Values{}
	u.Add("LinodeID", strconv.Itoa(linodeId))
	if diskId > 0 {
		u.Add("DiskID", strconv.Itoa(diskId))
	}
	v := LinodeDiskListResponse{}
	if err := t.client.do("linode.disk.list", u, &v.Response); err != nil {
		return nil, err
	}

	v.Disks = make([]Disk, 5)
	if err := json.Unmarshal(v.RawData, &v.Disks); err != nil {
		return nil, err
	}
	return &v, nil
}
1205163
func (c *Client) List() (*params.BackupsListResult, error) {
	var result params.BackupsListResult
	args := params.BackupsListArgs{}
	if err := c.facade.FacadeCall("List", args, &result); err != nil {
		return nil, errors.Trace(err)
	}
	return &result, nil
}
102528
func (d *driver) List(
	ctx types.Context,
	opts types.Store) ([]types.VolumeMapping, error) {

	client := context.MustClient(ctx)
	vols, err := client.Storage().Volumes(
		ctx,
		&types.VolumesOpts{
			Attachments: opts.GetAttachments(),
			Opts:        opts,
		},
	)
	if err != nil {
		return nil, err
	}

	serviceName, serviceNameOK := context.ServiceName(ctx)
	if !serviceNameOK {
		return nil, goof.New("service name is missing")
	}

	volMaps := []types.VolumeMapping{}
	for _, v := range vols {
		vs := buildVolumeStatus(v, serviceName)
		volMaps = append(volMaps, &volumeMapping{
			Name:             v.Name,
			VolumeMountPoint: v.MountPoint(),
			VolumeStatus:     vs,
		})
	}

	return volMaps, nil
}
952019
func (user *User) ListAllUserOpenIDs() ([]string, error) {
	nextOpenid := ""
	openids := []string{}
	count := 0
	for {
		ul, err := user.ListUserOpenIDs(nextOpenid)
		if err != nil {
			return nil, err
		}
		openids = append(openids, ul.Data.OpenIDs...)
		count += ul.Count
		if ul.Total > count {
			nextOpenid = ul.NextOpenID
		} else {
			return openids, nil
		}
	}
}
372131
func (v *azureVolumeSource) ListVolumes(ctx context.ProviderCallContext) ([]string, error) {
	if v.maybeStorageClient == nil {
		return v.listManagedDiskVolumes(ctx)
	}
	return v.listUnmanagedDiskVolumes(ctx)
}
1037700
func ListAll(fs *Filestore, fileOrder bool) (func() *ListRes, error) {
	if fileOrder {
		return listAllFileOrder(fs, false)
	}
	return listAll(fs, false)
}
1128975
func diskStats() (*disk, error) {
	var (
		freeBytes  uint64 = 0
		totalBytes uint64 = 0
	)

	// windows sets return value to 0 when function fails.
	ret, _, err := procGetDiskFreeSpaceExW.Call(
		0,
		uintptr(unsafe.Pointer(&freeBytes)),
		uintptr(unsafe.Pointer(&totalBytes)),
		0,
	)
	if ret == 0 {
		return nil, err
	}

	// diskStats functions from other platforms return disk usage in kiB.
	return &disk{
		Usage: (totalBytes - freeBytes) / 1024,
		Total: totalBytes / 1024,
	}, nil
}
698290
func (c *Client) ListVolumes(opts ListVolumesOptions) ([]Volume, error) {
	resp, err := c.do("GET", "/volumes?"+queryString(opts), doOptions{
		context: opts.Context,
	})
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	m := make(map[string]interface{})
	if err = json.NewDecoder(resp.Body).Decode(&m); err != nil {
		return nil, err
	}
	var volumes []Volume
	volumesJSON, ok := m["Volumes"]
	if !ok {
		return volumes, nil
	}
	data, err := json.Marshal(volumesJSON)
	if err != nil {
		return nil, err
	}
	if err := json.Unmarshal(data, &volumes); err != nil {
		return nil, err
	}
	return volumes, nil
}
784178
func (v *ebsVolumeSource) ListVolumes(ctx context.ProviderCallContext) ([]string, error) {
	filter := ec2.NewFilter()
	filter.Add("tag:"+tags.JujuModel, v.modelUUID)
	return listVolumes(v.env.ec2, ctx, filter, false)
}
1001179
func (s *VolumeSource) ListVolumes(ctx context.ProviderCallContext) ([]string, error) {
	s.MethodCall(s, "ListVolumes", ctx)
	if s.ListVolumesFunc != nil {
		return s.ListVolumesFunc(ctx)
	}
	return nil, nil
}
360962
func (d *driver) List(ctx context.Context, path string) ([]string, error) {
	d.mutex.RLock()
	defer d.mutex.RUnlock()

	normalized := normalize(path)

	found := d.root.find(normalized)

	if !found.isdir() {
		return nil, fmt.Errorf("not a directory") // TODO(stevvooe): Need error type for this...
	}

	entries, err := found.(*dir).list(normalized)

	if err != nil {
		switch err {
		case errNotExists:
			return nil, storagedriver.PathNotFoundError{Path: path}
		case errIsNotDir:
			return nil, fmt.Errorf("not a directory")
		default:
			return nil, err
		}
	}

	return entries, nil
}
146892
func (c *persistentVolumes) List(opts api.ListOptions) (result *api.PersistentVolumeList, err error) {
	result = &api.PersistentVolumeList{}
	err = c.client.Get().
		Resource("persistentvolumes").
		VersionedParams(&opts, api.ParameterCodec).
		Do().
		Into(result)
	return
}
1104584
func (idx *ListIndex) AllRecords(opts *Options) ([][]byte, error) {
	var list [][]byte

	c := internal.Cursor{C: idx.IndexBucket.Cursor(), Reverse: opts != nil && opts.Reverse}

	for k, id := c.First(); k != nil; k, id = c.Next() {
		if id == nil || bytes.Equal(k, []byte("storm__ids")) {
			continue
		}

		if opts != nil && opts.Skip > 0 {
			opts.Skip--
			continue
		}

		if opts != nil && opts.Limit == 0 {
			break
		}

		if opts != nil && opts.Limit > 0 {
			opts.Limit--
		}

		list = append(list, id)
	}

	return list, nil
}
1019153
func (s *persistentVolumeLister) List(selector labels.Selector) (ret []*v1.PersistentVolume, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*v1.PersistentVolume))
	})
	return ret, err
}
692582
func (s *DriveService) List(pageToken string, limit int) (files []*client.File, next string, err error) {
	req := s.apiservice.Files.List()
	req.Q(fmt.Sprintf("'%s' in parents and mimeType != '%s'", s.parentID, MimeTypeDriveFolder))

	if pageToken != "" {
		req.PageToken(pageToken)
	}

	if limit > 0 {
		req.MaxResults(int64(limit))
	}

	result, err := req.Do()
	if err != nil {
		return
	}
	return result.Items, result.NextPageToken, err
}
1284665
func (api *API) ListDvdIsos(args ...interface{}) ([]DvdIso, error) {
	url, err := processQueryParams(createUrl(api, dvdIsoPathSegment), args...)
	if err != nil {
		return nil, err
	}
	result := []DvdIso{}
	err = api.Client.Get(url, &result, http.StatusOK)
	if err != nil {
		return nil, err
	}
	for index, _ := range result {
		result[index].api = api
	}
	return result, nil
}
260478
func (c *ConfigLocal) DiskLimiter() DiskLimiter {
	c.lock.RLock()
	defer c.lock.RUnlock()
	return c.diskLimiter
}