Paging and ordering results for a RESTful request


A RESTful request can produce a large number of results. For any request, you can specify the maximum number of results and where the results start. You can also specify the sort order.

You can apply paging and sorting just to instances. You cannot apply paging and sorting to assets or classes. Use the query string arguments shown below. For a sample request, see Sample paging and ordering request.

Argument

Format

Description

maxResults

integer

Maximum number of results. Example: maxResults=5

firstResult

integer

Where to start retrieving results. Example: maxResults=5&firstResult=10
This example returns a result list that has up to 5 records and starts with the 11th record overall.

orderBy

property name Can be a single name, or a comma separated list of multiple names.

The name of the property on which you want to sort the result list. By default, results are sorted in ascending order (orderBy=name). This example sorts the result list on the name property. You can sort on more than one property, for example orderBy=name description. This returns a list of results first sorted by name in ascending order. If two or more records have the same name, then those records are sorted by description in ascending order.

ascending

true false

By default, results are sorted in ascending order. If you want results sorted in descending order, set ascending to false (ascending=false). If you are sorting on multiple properties, you can specify corresponding multiple sort orders. For example, orderBy=name,description&ascending=true,false. This returns a list of results first sorted by name in ascending order. If two or more records have the same name, then those records are sorted by description in descending order.

Sample paging and ordering request

https://myAppServer:9843/type/PropertySetClasses/SystemObject/Server/
?maxResults=5&username=BlAdmin&password=foo&role=BLAdmins
https://myAppServer:9843/type/PropertySetClasses/SystemObject/Server/
?firstResult=0&maxResults=100&orderBy=NAME&ascending=true&username=
BLAdmin&password=foo&role=BLAdmins

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*