UAPI Sorting

Overview

You can use additional parameters to sort UAPI output.

Sort output

UAPI sorting uses four basic parameters:

api.sort

Whether to enable sorting.

  • 1 — Enable sorting.
  • 0 — Disable sorting.

api.sort_column

The return to sort by. The name of one of the function's returns.

api.sort_method

The type of sorting to use.

This parameter defaults to lexicographic.

Warning:

You must set this parameter whenever you sort numeric values, or the function will fail.

  • ipv4 — Sort output by the numeric value of each octet in an IPv4 address.
  • numeric — Sort output in numeric order, with 0 as the lowest number.
  • numeric zero as_max — Sort output in numeric order, with 0 as the highest number.
  • lexicographic — Sort output in alphabetical order.

api.sort_reverse

Whether to sort data in reverse order.

  • 1 — Sort in reverse order.
  • 0 — Do not sort in reverse order.