Product SiteDocumentation Site

7.2.3.3. Pagination

Some Red Hat Enterprise Virtualization environments contain large collections of resources. However, the API only displays a default number of resources for one search query to a collection. To display more than the default, the API separates collections into pages via a search query containing the page command.
Example 7.5. Paginating resources
This example paginates resources in a collection. The URL-encoded request is:
GET /api/collection?search=page%201 HTTP/1.1
Accept: application/xml
Increase the page value to view the next page of results.
GET /api/collection?search=page%202 HTTP/1.1
Accept: application/xml
Use the page command also in conjunction with other commands in a search query. For example:
GET /api/collection?search=sortby%20element%20asc%20page%202 HTTP/1.1
Accept: application/xml
This query displays the second page in a collection listing ordered by a chosen element.