Sort Parameters

The sort query parameter is used to sort items of a resource collection in a response. Some resource properties of Veeam Backup for Nutanix AHV REST API schemas can be used as parameter values for the sort query parameter.

The parameter accepts the array data type. To sort a resource collection, use the sort query parameter in the following format:

GET https://127.0.0.1/api/v7/<endpoint>?sort=[{"property":"<property>","direction":"<direction>","collation":"<collation>"}]

where:

  • endpoint is a resource collection endpoint.
  • property is the searched property name.

Note:

To sort a resource collection based on a property of a resource subschema, use the "<subschema>.<property>" format to specify the resource property name where <subschema> is the subschema name.

  • direction is a direction specifier. The following values are available:
  • ascending
  • descending
  • collation is the type of rules that determine how sorted values are compared to each other. The following types are available:
  • ordinal — compare strings symbol-by-symbol
  • ignorecase — compare strings symbol-by-symbol ignoring character case
  • lexicographic — compare words with words and numbers with numbers

The default value is ordinal.

For example, to sort items of the /sessions resource collection by start time where the sessions is located in the descending order, send the following request:

GET https://127.0.0.1/api/v7/sessions[{"property":"startTimeUtc","direction":"descending","collation":"ordinal"}]

To learn more about properties of a specific resource that can be used as sort query parameter values, see the Resource Reference.

Page updated 1/4/2024

Page content applies to build 12.7.0.172