Cisco Cisco Evolved Programmable Network Manager 1.2 Developer's Guide

Page of 360
Using Sorting
 
 
Cisco EPN Manager RESTConf NBI Guide  
356
 
 
 
9  Using Sorting 
Sorting lets you control the order in which resources are returned. They can be sorted in 
Ascending or Descending order based on user preference.  
 
Sorting is enabled using the .sort(attribute_name) query parameter. Sorting is 
supported for all request types. 
 
For example, to sort a list of Devices by their latest collection times, you may use the 
following URL: 
https://<server_name>/restconf/v1/data/epnm-restconf-xmp-im-ext-
managedelement:ManagedElement?.sort(+collectionTime)
  
Ascending vs. Descending 
Ascending or Descending order is controlled by adding a "+" or "-" in front of the 
attribute name. 
 
 
To sort based on collectionTime in ascending order, use the + sign (the default): 
https://<server_name>/restconf/v1/data/epnm-restconf-xmp-im-ext-
managedelement:ManagedElement?.sort(+collectionTime)
  
 
To sort based on collectionTime in descending order, use the – sign: 
https://<server_name>/restconf/v1/data/epnm-restconf-xmp-im-ext-
managedelement:ManagedElement?.sort(-collectionTime)