Returns a list of resource objects. Pagination is supported through the
        optional 'marker' and 'limit' parameters. Filtering the returned value
        is possible by specifying values for any of the other parameters.
553721
def list(self, limit=None, marker=None, name=None, visibility=None,
            member_status=None, owner=None, tag=None, status=None,
            size_min=None, size_max=None, sort_key=None, sort_dir=None):
        
        return self._manager.list(limit=limit, marker=marker, name=name,
                visibility=visibility, member_status=member_status,
                owner=owner, tag=tag, status=status, size_min=size_min,
                size_max=size_max, sort_key=sort_key, sort_dir=sort_dir)
678191
def find_many(self, url, type, resource):
        
        return [type(item) for item in RestClient.get(url)[resource]]
1144836
def api_get_collection(path, collection, *args)
      Enumerator.new do |enum|
        args[0] = {} unless args[0]
        page_size = (args[0].delete(:page_size) { 100 }).to_i
        page_number = (args[0].delete(:page_number) { 1 }).to_i

        loop do
          uri = URI::HTTP.build(path: "/#{path}", query: URI.encode_www_form(pageSize: page_size, pageNumber: page_number)).request_uri

          res = api_get(uri, *args)
          raise TableauError, res if res.code.to_s != '200'

          # ensure the result is an array because it will not be an array if there is only one element
          [collection.split('.').reduce(res['tsResponse']) { |acc, elem| acc && acc[elem] }].flatten.compact.each do |obj|
            enum.yield obj
          end

          break if res['tsResponse']['pagination'].nil?
          break if page_number >= (res['tsResponse']['pagination']['totalAvailable'].to_i / page_size.to_f).ceil

          page_number += 1
        end
      end
    end
726630
def list_streams(self):
        
        # Server does not do pagination on listings of this resource.
        # Return an iterator anyway for similarity with other API methods
        path = '/archive/{}/streams'.format(self._instance)
        response = self._client.get_proto(path=path)
        message = rest_pb2.ListStreamsResponse()
        message.ParseFromString(response.content)
        streams = getattr(message, 'stream')
        return iter([Stream(stream) for stream in streams])
1346666
def list_algorithms(self, page_size=None):
        
        params = {}

        if page_size is not None:
            params['limit'] = page_size

        return pagination.Iterator(
            client=self._client,
            path='/mdb/{}/algorithms'.format(self._instance),
            params=params,
            response_class=mdb_pb2.ListAlgorithmsResponse,
            items_key='algorithm',
            item_mapper=Algorithm,
        )
307553
def list_roles(self, service_id=None, limit=None, marker=None):
        
        uri = "OS-KSADM/roles"
        pagination_items = []
        if service_id is not None:
            pagination_items.append("serviceId=%s" % service_id)
        if limit is not None:
            pagination_items.append("limit=%s" % limit)
        if marker is not None:
            pagination_items.append("marker=%s" % marker)
        pagination = "&".join(pagination_items)
        if pagination:
            uri = "%s?%s" % (uri, pagination)
        resp, resp_body = self.method_get(uri)
        roles = resp_body.get("roles", [])
        return [Role(self, role) for role in roles]
778303
def list_resources(self, session, query='?*::INSTR'):
        

        # For each session type, ask for the list of connected resources and merge them into a single list.

        resources = self.devices.list_resources()

        resources = rname.filter(resources, query)

        if resources:
            return resources

        raise errors.VisaIOError(errors.StatusCode.error_resource_not_found.value)
1039188
def resource_list(cls):
        
        items = cls.list({'items_per_page': 500})
        ret = [vm['hostname'] for vm in items]
        ret.extend([str(vm['id']) for vm in items])
        return ret
1007751
def get_list(
        self,
        search='',
        start=0,
        limit=0,
        order_by='',
        order_by_dir='ASC',
        published_only=False,
        minimal=False
    ):
        

        parameters = {}
        args = ['search', 'start', 'limit', 'minimal']
        for arg in args:
            if arg in locals() and locals()[arg]:
                parameters[arg] = locals()[arg]
        if order_by:
            parameters['orderBy'] = order_by
        if order_by_dir:
            parameters['orderByDir'] = order_by_dir
        if published_only:
            parameters['publishedOnly'] = 'true'
        response = self._client.session.get(
            self.endpoint_url, params=parameters
        )
        return self.process_response(response)
467403
def get_items(self, paginator, current_page):
        """"""
        fields = self.get_model_config().get_list_fields()

        page = paginator.page(current_page)

        items = []
        for item in page:
            items.append({
                'id': item.id,
                'url': item.get_absolute_url(),
                'row_data': [
                    fields[field]['renderer'](item, field)
                    for field in self.get_current_fields()
                ]
            })
        return items
646720
public static Resource[] listResources(Resource[] resources, ResourceFilter filter) {
	int count = 0;
	Resource[] children;
	ArrayList<Resource[]> list = new ArrayList<Resource[]>();
	for (int i = 0; i < resources.length; i++) {
	    children = filter == null ? resources[i].listResources() : resources[i].listResources(filter);
	    if (children != null) {
		count += children.length;
		list.add(children);
	    }
	    else list.add(new Resource[0]);
	}
	Resource[] rtn = new Resource[count];
	int index = 0;
	for (int i = 0; i < resources.length; i++) {
	    children = list.get(i);
	    for (int y = 0; y < children.length; y++) {
		rtn[index++] = children[y];
	    }
	}
	// print.out(rtn);
	return rtn;
    }
372154
def get(self, request, **resources):
        

        instance = resources.get(self._meta.name)
        if not instance is None:
            return instance

        return self.paginate(
            request, self.get_collection(request, **resources))
210553
def paginate_queryset(self, queryset, request, view=None):
        
        result = super(MultipleModelLimitOffsetPagination, self).paginate_queryset(queryset, request, view)

        try:
            if self.max_count < self.count:
                self.max_count = self.count
        except AttributeError:
            self.max_count = self.count

        try:
            self.total += self.count
        except AttributeError:
            self.total = self.count

        return result
788268
def resource_list(cls):
        
        items = cls.list({'items_per_page': 500})
        ret = [str(ip['id']) for ip in items]
        ret.extend([ip['ip'] for ip in items])
        return ret
884548
def get_all(cls, parent=None, **params):

        if parent is not None:
            route = copy(parent.route)
        else:
            route = {}
        if cls.ID_NAME is not None:
            # Empty string triggers "get all resources"
            route[cls.ID_NAME] = ""

        base_obj = cls(key=parent.key, route=route, config=parent.config)
        """"""

        start = datetime.now()
        r = requests.get(
            base_obj._url(), auth=(base_obj.key, ""), params=params)
        cls._delay_for_ratelimits(start)

        if r.status_code not in cls.TRUTHY_CODES:
            return base_obj._handle_request_exception(r)

        response = r.json()
        objects_data = response.get(base_obj.ENVELOPE or base_obj, [])

        return_objects = []
        for data in objects_data:
            # Note that this approach does not get meta data
            return_objects.append(
                cls.get(
                    parent=parent,
                    id=data.get(cls.ID_NAME, data.get("id")),
                    data=data))

        return return_objects
63003
def paginate(self):
        
        self.tcex.log.warning(u'Using deprecated method (paginate).')
        resources = []
        self._request.add_payload('resultStart', self._result_start)
        self._request.add_payload('resultLimit', self._result_limit)
        results = self.request()
        response = results.get('response')
        if results.get('status') == 'Success':
            data = response.json()['data']
            resources = data[self.request_entity]

            # set results count returned by first API call
            if data.get('resultCount') is not None:
                self._result_count = data.get('resultCount')
                # self._result_start = self._result_limit

            self.tcex.log.debug(u'Result Count: {}'.format(self._result_count))

            while True:
                if len(resources) >= self._result_count:
                    break
                self._result_start += self._result_limit
                self._request.add_payload('resultStart', self._result_start)
                results = self.request()
                resources.extend(results['data'])

            self.tcex.log.debug(u'Resource Count: {}'.format(len(resources)))

        return resources
549320
def list_with_post(self, request):
        """"""
        if self.is_search_request():
            search = self.search()

            page = self.paginate_queryset(search)
            if page is None:
                items = search
            else:
                items = page

            try:
                primary_keys = []
                order_map_cases = []
                for order, item in enumerate(items):
                    pk = item[self.primary_key_field]
                    primary_keys.append(pk)
                    order_map_cases.append(When(pk=pk, then=Value(order)))

                queryset = self.get_queryset().filter(
                    pk__in=primary_keys
                ).order_by(
                    Case(*order_map_cases, output_field=IntegerField()).asc()
                )
            except KeyError:
                raise KeyError("Combined viewset requires that your index contains a field with "
                               "the primary key. By default this field is called 'id', but you "
                               "can change it by setting primary_key_field.")

            # Pagination must be handled differently.
            serializer = self.get_serializer(queryset, many=True)
            if page is not None:
                return self.get_paginated_response(serializer.data)

            return Response(serializer.data)
        else:
            queryset = self.filter_queryset(self.get_queryset())
            return self.paginate_response(queryset)