Articles in this section

Pagination, Sorting and Filtering

Pagination

Allows balancing of retrieved items compared to speed/size.

  • By default, each page contains 100 items maximum. You need to iterate through pages linked to get the other items
  • You can change the page max the URI with the limit keyword, and iterate with the header standard link

 

Example


GET http://localhost:12340/v1/jobs?limit=2

(To have the first 2 items)

Then,


GET http://localhost:12340/v1/jobs?limit=2&page=2

To get the second page.

 

Sorting

Allows you to get the desired order to process resources faster or smarter.

  • Default sorting is based on the default sorting of each service and their speed to answer
  • Multiple Sort options can not be combined
  • Note that the :asc or :desc suffixes are mandatory

 

Example

Example to get the jobs sorted using finished timestamps and the header information:


GET http://localhost:12340/v1/jobs?sort=form.evolution.finished:desc

 

Filtering

Gets only the relevant data to speed up the communication.

  • Filters can be combined with & or |, and * (Wildcards)
  • Sub-nodes can be used for example: form.message, but not in arrays.

 

Example

To show only devices that are in running state:


GET http://localhost:12340/v1/devices?state=running
Was this article helpful?
0 out of 0 found this helpful