Este conteúdo não está disponível no idioma selecionado.

Chapter 7. Using pagination in the API


The API paginates responses for collections. This means that while a collection might contain tens or hundreds of thousands of objects, in each web request, only a limited number of results are returned for API performance reasons.

When you receive the result for a collection, something similar to the following is displayed:

{'count': 25, 'next': 'http://testserver/api/controller/v2/some_resource?page=2', 'previous': None, 'results': [ ... ] }

Procedure

  1. Request the page given by the "next" sequential URL, to get to the next page.
  2. Use the page_size=XX query string parameter to change the number of results returned for each request.

    • The page_size has a default maximum limit of 200, which is enforced when a user tries a value beyond it, for example, ?page_size=1000. However, you can change this limit by setting the value in /etc/tower/conf.d/<some file>.py to something higher. For example, MAX_PAGE_SIZE=1000.
  3. Use the page query string parameter to retrieve a particular page of results:

    http://<gateway server name>/api/controller/v2/model_verbose_name?page_size=100&page=2
    Note

    The preceding and following links returned with the results set these query string parameters automatically.

    Do not request page sizes greater than 200.

    The user interface uses smaller values to avoid scrolling.

Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2026 Red Hat
Voltar ao topo