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

Chapter 4. Sorting in the API


To give you examples that are easy to follow, we use the following URL throughout this guide:

https://<gateway server name>/api/controller/v2/groups/

Learn how to use the order_by query parameter in a GET request to sort the returned {{model_verbose_name_plural}} by one or more fields, including how to specify reverse order by using a leading dash (-).

Procedure

  • To specify that {{ model_verbose_name_plural }} are returned in a particular order, use the order_by query string parameter on the GET request:

    https://<gateway server name>/api/controller/v2/model_verbose_name_plural?order_by={{ order_field }}
    • Prefix the field name with a dash (-) to sort in reverse:

      https://<gateway server name>/api/controller/v2/model_verbose_name_plural?order_by=-{{ order_field }}
    • You can specify the sorting fields by separating the field names with a comma (,):

      https://<gateway server name>/api/controller/v2/model_verbose_name_plural?order_by={{ order_field }},some_other_field
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