Hey! These docs are for version 6.3, which is no longer officially supported. Click here for the latest version, 6.7!

Amending the order of lists

Ordering of results is based on the “order” parameter. The value for this parameter can be a single entity or comma separated list of entities to order by.

Ordering will be performed in order from left to right. For example, to order the results by hosts with SNMP enabled then name, the order should be “snmp_enabled,name”.

The default order is ascending, but can be changed to descending by appending the criterion with “_desc”. For example, to reverse order by name, “order=name_desc”.

It is possible to order by sub-entity, ie. entities that don't have a straight value, such as enable_snmp, name, ip, but rather entities that have multiple values: hostgroup, hosttemplates, servicechecks, etc. To do this, the criterion must be the name of that value, followed by a fullstop, then the entity to order by. For example, to order the hosts by host group name, order should be “hostgroup.name”.