// List returns list of clusters
196835
func (s *Server) List(ctx context.Context, q *ClusterQuery) (*appv1.ClusterList, error) {
	clusterList, err := s.db.ListClusters(ctx)
	if err != nil {
		return nil, err
	}
	clustersByServer := make(map[string][]appv1.Cluster)
	for _, clust := range clusterList.Items {
		if s.enf.Enforce(ctx.Value("claims"), rbacpolicy.ResourceClusters, rbacpolicy.ActionGet, clust.Server) {
			clustersByServer[clust.Server] = append(clustersByServer[clust.Server], clust)
		}
	}
	servers := make([]string, 0)
	for server := range clustersByServer {
		servers = append(servers, server)
	}

	items := make([]appv1.Cluster, len(servers))
	err = util.RunAllAsync(len(servers), func(i int) error {
		clusters := clustersByServer[servers[i]]
		clust := clusters[0]
		warningMessage := ""
		if len(clusters) > 1 {
			warningMessage = fmt.Sprintf("There are %d credentials configured this cluster.", len(clusters))
		}
		if clust.ConnectionState.Status == "" {
			clust.ConnectionState = s.getConnectionState(ctx, clust, warningMessage)
		}
		items[i] = *redact(&clust)
		return nil
	})
	if err != nil {
		return nil, err
	}

	clusterList.Items = items
	return clusterList, err
}
872380
func (a *AzureClusterLister) List() (*containerservice.ListResult, error) {
	bearerAuthorizer, err := NewBearerAuthorizer(a.Config, azure.PublicCloud.ResourceManagerEndpoint)
	if err != nil {
		log.Printf("Error trying to create Bearer Authorizer: %s", err)
		return nil, err
	}

	csClient := containerservice.NewContainerServicesClient(a.Config.SubscriptionID)
	csClient.Authorizer = bearerAuthorizer
	listResult, err := csClient.List()
	if err != nil {
		log.Printf("Error trying to fetch Azure Cluster List: %s\n", err)
		return nil, err
	}
	return &listResult, nil
}
546734
func (list *TargetList) List() []TargetID {
	list.RLock()
	defer list.RUnlock()

	keys := []TargetID{}
	for k := range list.targets {
		keys = append(keys, k)
	}

	return keys
}
402113
func (s *clusterRoleBindingLister) List(selector labels.Selector) (ret []*v1.ClusterRoleBinding, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*v1.ClusterRoleBinding))
	})
	return ret, err
}
479502
func (r *KeyResource) List() ([]*Key, error) {
	keys := []*Key{}
	const path = "/user/keys"

	if err := r.client.do("GET", path, nil, &keys); err != nil {
		return nil, err
	}

	return keys, nil
}
394060
func (a *Allocations) List(q *QueryOptions) ([]*AllocationListStub, *QueryMeta, error) {
	var resp []*AllocationListStub
	qm, err := a.client.query("/v1/allocations", &resp, q)
	if err != nil {
		return nil, nil, err
	}
	sort.Sort(AllocIndexSort(resp))
	return resp, qm, nil
}
309963
func (s *GroupsService) List() *GroupsListCall {
	var call GroupsListCall
	call.service = s
	return &call
}
217406
func (c *Client) List(
	stream, region string,
	series, arches []string,
	virtType, rootStorageType string,
) ([]params.CloudImageMetadata, error) {
	in := params.ImageMetadataFilter{
		Region:          region,
		Series:          series,
		Arches:          arches,
		Stream:          stream,
		VirtType:        virtType,
		RootStorageType: rootStorageType,
	}
	out := params.ListCloudImageMetadataResult{}
	err := c.facade.FacadeCall("List", in, &out)
	return out.Result, err
}
321280
func (r *Region) List(args *structs.GenericRequest, reply *[]string) error {
	*reply = r.srv.Regions()
	return nil
}
964897
func (r *GroupService) List(appId string) *GroupListCall {
	c := &GroupListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.appId = appId
	return c
}
340453
func (s *Set) List() []interface{} {
	s.l.RLock()
	defer s.l.RUnlock()

	list := make([]interface{}, 0, len(s.m))

	for item := range s.m {
		list = append(list, item)
	}

	return list
}
1055285
func (p *Project) List(c *check.C) []types.Container {
	containers, err := p.project.List()
	c.Assert(err, check.IsNil,
		check.Commentf("error while listing containers"))
	return containers
}
136720
func (r *Runc) List(context context.Context) ([]*Container, error) {
	data, err := cmdOutput(r.command(context, "list", "--format=json"), false)
	if err != nil {
		return nil, err
	}
	var out []*Container
	if err := json.Unmarshal(data, &out); err != nil {
		return nil, err
	}
	return out, nil
}
1366704
func (i *InmemBackend) List(ctx context.Context, prefix string) ([]string, error) {
	i.permitPool.Acquire()
	defer i.permitPool.Release()

	i.RLock()
	defer i.RUnlock()

	return i.ListInternal(ctx, prefix)
}
528185
func (c *Client) ListClusters(p *ListClustersParameter) ([]*Cluster, error) {
	obj, err := c.Request("listClusters", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.([]*Cluster), err
}
853871
func (s *SyncedSet) List() *[]interface{} {
	s.RLock()
	defer s.RUnlock()
	i := 0
	l := make([]interface{}, s.Len())
	for k := range s.set {
		l[i] = k
		i++
	}
	return &l
}
364359
func (m *Miniredis) List(k string) ([]string, error) {
	return m.DB(m.selectedDB).List(k)
}