// ListImages lists existing images.
6889
func (s *Server) ListImages(ctx context.Context, req *pb.ListImagesRequest) (resp *pb.ListImagesResponse, err error) {
	const operation = "list_images"
	defer func() {
		recordOperation(operation, time.Now())
		recordError(operation, err)
	}()

	logrus.Debugf("ListImagesRequest: %+v", req)
	filter := ""
	reqFilter := req.GetFilter()
	if reqFilter != nil {
		filterImage := reqFilter.GetImage()
		if filterImage != nil {
			filter = filterImage.Image
		}
	}
	results, err := s.StorageImageServer().ListImages(s.ImageContext(), filter)
	if err != nil {
		return nil, err
	}
	resp = &pb.ListImagesResponse{}
	for i := range results {
		result := &results[i]
		resImg := &pb.Image{
			Id:          result.ID,
			RepoTags:    result.RepoTags,
			RepoDigests: result.RepoDigests,
		}
		uid, username := getUserFromImage(result.User)
		if uid != nil {
			resImg.Uid = &pb.Int64Value{Value: *uid}
		}
		resImg.Username = username
		if result.Size != nil {
			resImg.Size_ = *result.Size
		}
		resp.Images = append(resp.Images, resImg)
	}
	logrus.Debugf("ListImagesResponse: %+v", resp)
	return resp, nil
}
11103
func (c *Client) ListTemplates(p *ListTemplatesParameter) ([]*Template, error) {
	obj, err := c.Request("listTemplates", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.([]*Template), err
}
551878
func (c *Client) SearchImages(term string) ([]APIImageSearch, error) {
	resp, err := c.do("GET", "/images/search?term="+term, doOptions{})
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	var searchResult []APIImageSearch
	if err := json.NewDecoder(resp.Body).Decode(&searchResult); err != nil {
		return nil, err
	}
	return searchResult, nil
}
416015
func (api *API) ListImageOs(args ...interface{}) ([]ImageOs, error) {
	url, err := processQueryParams(createUrl(api, imagePathSegment, "os"), args...)
	if err != nil {
		return nil, err
	}
	result := []ImageOs{}
	err = api.Client.Get(url, &result, http.StatusOK)
	if err != nil {
		return nil, err
	}

	return result, nil
}
472776
func (f *Finder) FindImages(al *apps.Apps) error {
	return al.Walk(func(app *apps.App) error {
		h, err := f.FindImage(app.Image, app.Asc)
		if err != nil {
			return err
		}
		app.ImageID = *h
		return nil
	})
}
333967
func (c *GitHubClient) ListAssets(ctx context.Context, releaseID int64) ([]*github.ReleaseAsset, error) {
	result := []*github.ReleaseAsset{}
	page := 1

	for {
		assets, res, err := c.Repositories.ListReleaseAssets(context.TODO(), c.Owner, c.Repo, releaseID, &github.ListOptions{Page: page})
		if err != nil {
			return nil, errors.Wrap(err, "failed to list assets")
		}

		if res.StatusCode != http.StatusOK {
			return nil, errors.Errorf("list release assets: invalid status code: %s", res.Status)
		}

		result = append(result, assets...)

		if res.NextPage <= page {
			break
		}

		page = res.NextPage
	}

	return result, nil
}
569415
func (ds *resourcesUnitDataStore) ListResources() (resource.ApplicationResources, error) {
	return ds.resources.ListResources(ds.unit.ApplicationName())
}
889967
func (b *Bag) ListFiles() ([]string, error) {

	var files []string

	// WalkDir function to collect files in the bag..
	visit := func(pathToFile string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}

		if !info.IsDir() {
			fp, err := filepath.Rel(b.Path(), pathToFile)
			if err != nil {
				return err
			}
			if fp != "." {
				files = append(files, fp)
			}
		}
		return err
	}

	if err := filepath.Walk(b.Path(), visit); err != nil {
		return nil, err
	}

	return files, nil
}
586095
func Convert_v1_ImageList_To_image_ImageList(in *v1.ImageList, out *image.ImageList, s conversion.Scope) error {
	return autoConvert_v1_ImageList_To_image_ImageList(in, out, s)
}
617873
func (c *Conn) ListImages() ([]ImageStatus, error) {
	result := make([][]interface{}, 0)
	if err := c.object.Call(dbusInterface+".ListImages", 0).Store(&result); err != nil {
		return nil, err
	}

	images := []ImageStatus{}
	for _, i := range result {
		image, err := imageFromInterfaces(i)
		if err != nil {
			return nil, err
		}
		images = append(images, *image)
	}

	return images, nil
}
1077872
func (d *Debugger) ListDynamicLibraries() []api.Image {
	d.processMutex.Lock()
	defer d.processMutex.Unlock()
	bi := d.target.BinInfo()
	r := make([]api.Image, len(bi.Images))
	for i := range bi.Images {
		r[i] = api.ConvertImage(bi.Images[i])
	}
	return r
}
177496
func (c *Client) ListStoragePools(p *ListStoragePoolsParameter) ([]*StoragePool, error) {
	obj, err := c.Request("listStoragePools", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.([]*StoragePool), err
}
713470
func ListFiles(dir string) ([]string, error) {
	var files []string
	err := filepath.Walk(dir, func(active string, info os.FileInfo, err error) error {
		// ignore directories
		if info.IsDir() {
			return nil
		}
		if err != nil {
			return err
		}
		rel, err := filepath.Rel(dir, active)
		files = append(files, rel)
		return nil
	})
	return files, err
}
15110
func (c *Client) ListSecondaryStagingStores(p *ListSecondaryStagingStoresParameter) ([]*ImageStore, error) {
	obj, err := c.Request("listSecondaryStagingStores", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.([]*ImageStore), err
}
595167
func (s *RPCServer) ListSources(arg ListSourcesIn, out *ListSourcesOut) error {
	ss, err := s.debugger.Sources(arg.Filter)
	if err != nil {
		return err
	}
	out.Sources = ss
	return nil
}
1258298
func (s *EnvironmentLanguage) SetImages(v []*EnvironmentImage) *EnvironmentLanguage {
	s.Images = v
	return s
}
450553
func (s *SnapshotService) ListSnapshots(p *ListSnapshotsParams) (*ListSnapshotsResponse, error) {
	resp, err := s.cs.newRequest("listSnapshots", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ListSnapshotsResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}