// ListTPUs returns Cloud TPUs in the specified zone.
963092
func (g *Cloud) ListTPUs(ctx context.Context, zone string) ([]*tpuapi.Node, error) {
	mc := newTPUMetricContext("list", zone)

	parent := getTPUParentName(g.projectID, zone)
	response, err := g.tpuService.projects.Locations.Nodes.List(parent).Do()
	if err != nil {
		return nil, mc.Observe(err)
	}
	return response.Nodes, mc.Observe(nil)
}
327684
func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opt *ListOptions) ([]*RepoStatus, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/commits/%v/statuses", owner, repo, url.QueryEscape(ref))
	u, err := addOptions(u, opt)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var statuses []*RepoStatus
	resp, err := s.client.Do(ctx, req, &statuses)
	if err != nil {
		return nil, resp, err
	}

	return statuses, resp, nil
}
1018548
func (s *RepositoriesService) ListAll(ctx context.Context, opt *RepositoryListAllOptions) ([]*Repository, *Response, error) {
	u, err := addOptions("repositories", opt)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var repos []*Repository
	resp, err := s.client.Do(ctx, req, &repos)
	if err != nil {
		return nil, resp, err
	}

	return repos, resp, nil
}
927115
func (c *Client) ListLdapUsers(p *ListLdapUsersParameter) ([]*LdapUser, error) {
	obj, err := c.Request("listLdapUsers", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.([]*LdapUser), err
}
988139
func (l *s3Objects) ListMultipartUploads(ctx context.Context, bucket string, prefix string, keyMarker string, uploadIDMarker string, delimiter string, maxUploads int) (lmi minio.ListMultipartsInfo, e error) {
	result, err := l.Client.ListMultipartUploads(bucket, prefix, keyMarker, uploadIDMarker, delimiter, maxUploads)
	if err != nil {
		return lmi, err
	}

	return minio.FromMinioClientListMultipartsInfo(result), nil
}
1369892
func (s *DNSViewSnapshot) ListZones() []DNSZoneInfo {
	var zones []DNSZoneInfo
	for _, z := range s.zoneMap {
		zones = append(zones, DNSZoneInfo{
			Name: z.Name,
		})
	}
	return zones
}
1226251
func List(cmd *cli.Cmd) {
	provider := cmd.String(cli.StringOpt{
		Name:      "provider",
		Desc:      "Cloud provider(i.e. amazon)",
		HideValue: true,
	})

	identifier := cmd.String(cli.StringOpt{
		Name:      "identifier",
		Desc:      "Cloud provider specific region/zone/etc identifier (i.e. us-east-1)",
		HideValue: true,
	})

	cmd.Action = func() {
		l := location.Location{
			Provider: *provider,
			Region:   *identifier,
		}

		body, errs := l.Find()

		if len(errs) > 0 {
			log.Fatalf("Could not retrieve locations: %s", errs[0])
		}

		locations := &[]location.Location{}
		err := json.Unmarshal([]byte(body), locations)

		if err != nil {
			log.Fatal(err)
		}

		PrintLocationBrief(*locations)
	}
}
1294866
func (ix *Index) listAt(off uint32) (trigram, count, offset uint32) {
	d := ix.slice(ix.postIndex+off, postEntrySize)
	trigram = uint32(d[0])<<16 | uint32(d[1])<<8 | uint32(d[2])
	count = binary.BigEndian.Uint32(d[3:])
	offset = binary.BigEndian.Uint32(d[3+4:])
	return
}
1295289
func (api *API) ListWAFPackages(zoneID string) ([]WAFPackage, error) {
	var p WAFPackagesResponse
	var packages []WAFPackage
	var res []byte
	var err error
	uri := "/zones/" + zoneID + "/firewall/waf/packages"
	res, err = api.makeRequest("GET", uri, nil)
	if err != nil {
		return []WAFPackage{}, errors.Wrap(err, errMakeRequestError)
	}
	err = json.Unmarshal(res, &p)
	if err != nil {
		return []WAFPackage{}, errors.Wrap(err, errUnmarshalError)
	}
	if !p.Success {
		// TODO: Provide an actual error message instead of always returning nil
		return []WAFPackage{}, err
	}
	for pi := range p.Result {
		packages = append(packages, p.Result[pi])
	}
	return packages, nil
}
1142048
func (c *Client) ListFTPs(i *ListFTPsInput) ([]*FTP, error) {
	if i.Service == "" {
		return nil, ErrMissingService
	}

	if i.Version == 0 {
		return nil, ErrMissingVersion
	}

	path := fmt.Sprintf("/service/%s/version/%d/logging/ftp", i.Service, i.Version)
	resp, err := c.Get(path, nil)
	if err != nil {
		return nil, err
	}

	var ftps []*FTP
	if err := decodeJSON(&ftps, resp.Body); err != nil {
		return nil, err
	}
	sort.Stable(ftpsByName(ftps))
	return ftps, nil
}
1049645
func (ls *ListZones) ListRequest() (ListCommand, error) {
	if ls == nil {
		return nil, fmt.Errorf("%T cannot be nil", ls)
	}
	return ls, nil
}
1368885
func (iso ISO) ListRequest() (ListCommand, error) {
	req := &ListISOs{
		ID:     iso.ID,
		Name:   iso.Name,
		ZoneID: iso.ZoneID,
	}
	if iso.Bootable {
		*req.Bootable = true
	}
	if iso.IsFeatured {
		req.IsoFilter = "featured"
	}
	if iso.IsPublic {
		*req.IsPublic = true
	}
	if iso.IsReady {
		*req.IsReady = true
	}

	for i := range iso.Tags {
		req.Tags = append(req.Tags, iso.Tags[i])
	}

	return req, nil
}
1016919
func (zones *Zones) List(ctx context.Context) ([]*Zone, error) {
	return zones.listPages(ctx, 1)
}
535119
func (s *SSHService) ListSSHKeyPairs(p *ListSSHKeyPairsParams) (*ListSSHKeyPairsResponse, error) {
	resp, err := s.cs.newRequest("listSSHKeyPairs", p.toURLValues())
	if err != nil {
		return nil, err
	}

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

	return &r, nil
}
905180
func (s *Bucket) ListMultipart(objectKey string, input *ListMultipartInput) (*ListMultipartOutput, error) {
	r, x, err := s.ListMultipartRequest(objectKey, input)

	if err != nil {
		return x, err
	}

	err = r.Send()
	if err != nil {
		return nil, err
	}

	requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
	x.RequestID = &requestID

	return x, err
}
863914
func (c *FleetClient) ListUnitFiles() (err error) {
	var sortable sort.StringSlice
	units := make(map[string]*schema.Unit, 0)

	us, err := c.Fleet.Units()
	if err != nil {
		return err
	}

	for _, u := range us {
		if strings.HasPrefix(u.Name, "deis-") {
			units[u.Name] = u
			sortable = append(sortable, u.Name)
		}
	}
	sortable.Sort()
	c.printUnitFiles(units, sortable)
	return
}
1111142
func (z *Zone) List() (zones []*Info, err error) {
	_, err = z.Get("/zones", &zones)
	return
}