// ListRoutes in the cloud environment.
193052
func (g *Cloud) ListRoutes(ctx context.Context, clusterName string) ([]*cloudprovider.Route, error) {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newRoutesMetricContext("list")
	prefix := truncateClusterName(clusterName)
	f := filter.Regexp("name", prefix+"-.*").AndRegexp("network", g.NetworkURL()).AndRegexp("description", k8sNodeRouteTag)
	routes, err := g.c.Routes().List(ctx, f)
	if err != nil {
		return nil, mc.Observe(err)
	}
	var croutes []*cloudprovider.Route
	for _, r := range routes {
		target := path.Base(r.NextHopInstance)
		// TODO: Should we lastComponent(target) this?
		targetNodeName := types.NodeName(target) // NodeName == Instance Name on GCE
		croutes = append(croutes, &cloudprovider.Route{
			Name:            r.Name,
			TargetNode:      targetNodeName,
			DestinationCIDR: r.DestRange,
		})
	}
	return croutes, mc.Observe(nil)
}
555707
func (c oauthClient) Lists() ([]wl.List, error) {
	url := fmt.Sprintf(
		"%s/lists",
		c.apiURL,
	)

	req, err := c.newGetRequest(url)
	if err != nil {
		return nil, err
	}

	resp, err := c.do(req)
	if err != nil {
		return nil, err
	}

	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("Unexpected response code %d - expected %d", resp.StatusCode, http.StatusOK)
	}

	lists := []wl.List{}
	err = json.NewDecoder(resp.Body).Decode(&lists)
	if err != nil {
		return lists, err
	}
	return lists, nil
}
262892
func (*Service) ListVMs(c context.Context, req *crimson.ListVMsRequest) (*crimson.ListVMsResponse, error) {
	vms, err := listVMs(c, database.Get(c), req)
	if err != nil {
		return nil, err
	}
	return &crimson.ListVMsResponse{
		Vms: vms,
	}, nil
}
596364
func (r *Router) Routes() Routes {
	routes := make(Routes, len(r.routes))
	for i := 0; i < len(r.routes); i++ {
		routes[i] = r.routes[i]
	}

	for _, sr := range r.subrouters {
		routes = append(routes, sr.Routes()...)
	}

	return routes
}
760290
func (r *RoutesService) List(options *ListRoutesOptions) ([]*Route, *http.Response, error) {
	return r.ListWithContext(context.TODO(), options)
}
276585
func (s ingressRouteNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.IngressRoute, err error) {
	err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
		ret = append(ret, m.(*v1alpha1.IngressRoute))
	})
	return ret, err
}
548139
func (s *NetworkOfferingService) ListNetworkOfferings(p *ListNetworkOfferingsParams) (*ListNetworkOfferingsResponse, error) {
	resp, err := s.cs.newRequest("listNetworkOfferings", p.toURLValues())
	if err != nil {
		return nil, err
	}

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

	return &r, nil
}
1051662
func (c *UsersController) List(ctx *app.ListUsersContext) error {
	return proxy.RouteHTTP(ctx, c.config.GetAuthShortServiceHostName())
}
1038328
func (c *CloudAPI) ListNetworks() ([]cloudapi.Network, error) {
	if err := c.ProcessFunctionHook(c); err != nil {
		return nil, err
	}

	return c.networks, nil
}
1310527
func (d *driver) List(context context.Context, path string) ([]string, error) {
	var query *storage.Query
	query = &storage.Query{}
	query.Delimiter = "/"
	query.Prefix = d.pathToDirKey(path)
	list := make([]string, 0, 64)
	for {
		objects, err := storageListObjects(d.context(context), d.bucket, query)
		if err != nil {
			return nil, err
		}
		for _, object := range objects.Results {
			// GCS does not guarantee strong consistency between
			// DELETE and LIST operations. Check that the object is not deleted,
			// and filter out any objects with a non-zero time-deleted
			if object.Deleted.IsZero() && object.ContentType != uploadSessionContentType {
				list = append(list, d.keyToPath(object.Name))
			}
		}
		for _, subpath := range objects.Prefixes {
			subpath = d.keyToPath(subpath)
			list = append(list, subpath)
		}
		query = objects.Next
		if query == nil {
			break
		}
	}
	if path != "/" && len(list) == 0 {
		// Treat empty response as missing directory, since we don't actually
		// have directories in Google Cloud Storage.
		return nil, storagedriver.PathNotFoundError{Path: path}
	}
	return list, nil
}
1371310
func (c *ingressRoutes) List(opts v1.ListOptions) (result *v1alpha1.IngressRouteList, err error) {
	result = &v1alpha1.IngressRouteList{}
	err = c.client.Get().
		Namespace(c.ns).
		Resource("ingressroutes").
		VersionedParams(&opts, scheme.ParameterCodec).
		Do().
		Into(result)
	return
}
37537
func (vm *VM) listHostedServices() ([]hostedservice.HostedService, error) {
	sc, err := vm.getServiceClient()
	if err != nil {
		return nil, fmt.Errorf(errGetClient, err)
	}

	resp, err := sc.ListHostedServices()
	if err != nil {
		return nil, err
	}

	return resp.HostedServices, nil
}
841042
func (ctx *Context) ListServices() ([]string, error) {
	ctx.mutex.RLock()
	defer ctx.mutex.RUnlock()

	r := make([]string, 0, len(ctx.services))

	for vsID := range ctx.services {
		r = append(r, vsID)
	}

	return r, nil
}
663311
func (firewalls *Firewalls) List(ctx context.Context, zone string) ([]*Firewall, error) {
	return firewalls.listPages(ctx, zone, 1)
}
738984
func (no NetworkOffering) ListRequest() (ListCommand, error) {
	req := &ListNetworkOfferings{
		Availability: no.Availability,
		ID:           no.ID,
		Name:         no.Name,
		State:        no.State,
		TrafficType:  no.TrafficType,
	}

	return req, nil
}
178180
func (ipaddress IPAddress) ListRequest() (ListCommand, error) {
	req := &ListPublicIPAddresses{
		AssociatedNetworkID: ipaddress.AssociatedNetworkID,
		ID:                  ipaddress.ID,
		IPAddress:           ipaddress.IPAddress,
		PhysicalNetworkID:   ipaddress.PhysicalNetworkID,
		VlanID:              ipaddress.VlanID,
		ZoneID:              ipaddress.ZoneID,
	}
	if ipaddress.IsElastic {
		req.IsElastic = &ipaddress.IsElastic
	}
	if ipaddress.IsSourceNat {
		req.IsSourceNat = &ipaddress.IsSourceNat
	}
	if ipaddress.ForVirtualNetwork {
		req.ForVirtualNetwork = &ipaddress.ForVirtualNetwork
	}

	return req, nil
}
1117988
func (s *RouterService) ListRouters(p *ListRoutersParams) (*ListRoutersResponse, error) {
	resp, err := s.cs.newRequest("listRouters", p.toURLValues())
	if err != nil {
		return nil, err
	}

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

	return &r, nil
}