Cisco Prime Infrastructure API
Prime Infrastructure API Documentation

# Using Sorting

Sorting lets you control the order in which resources are returned. They can be sorted in Ascending or Descending order based on multiple sort fields. Check the documentation for each request type to see if it supports Sorting.

For example, to sort a list of Devices by their latest collection times, you may use the following URL

    	../webacs/api/v1/data/Devices?.sort=collectionTime

## Ascending vs. Descending

Ascending or Descending order is controlled by adding a "+" or "-" in front of the attribute name.

    	../webacs/api/v1/data/Devices?.sort=+collectionTime

... sorts on Ascending collectionTime, whereas

    	../webacs/api/v1/data/Devices?.sort=-collectionTime

... sorts on Descending collectionTime.

## Sorting on Multiple Attributes

Sorting can be controlled over multiple attributes by specifying a comma-separated list of attribute names with their respective order. For example:

    	../webacs/api/v1/data/Devices?.sort=+collectionTime,-softwareVersion

... sorts by ascending collectionTime first and descending softwareVersion.

- ← Filtering
- Sorting
- Paging →